
# CLI reference

`agc` (also installed as `agentcloud`) is the only supported way to drive Agent Cloud. This page lists every command, subcommand and flag agc 0.3.0 dispatches, its `agc help` topics, and the commands that answer `cli.not_available` because they aren't built yet.

Most commands print one final envelope; three follow commands can stream several (see [The JSON envelope](/docs/reference/the-json-envelope.md#streaming-ndjson)). The envelope is `{"ok": …, "product": "agent.cloud", "command": …, "data": …, "next": [...]}`, and exits with a code from [Exit codes](/docs/reference/the-json-envelope.md#exit-codes). For a person at a terminal it renders the same envelope as text; see [Output modes](/docs/reference/the-json-envelope.md#output-modes).

```bash
agc version
```

```json
{"ok":true,"product":"agent.cloud","command":"version","data":{"version":"0.3.0","built":"2026-10-19T21:04:11.000Z","node":"v24.9.0"},"next":[]}
```

`built` is `null` when agc runs from a source checkout. The tables below are generated from `packages/cli/src/main.ts`; a command the dispatcher doesn't know isn't here.

## Reference

### Global flags and parsing

| Flag | Effect |
|---|---|
| `--json` | JSON envelope, always. Wins over everything else. |
| `--human` | Text view, always. |
| `--help`, `-h` | `agc help <command>` for the command given (before any `--`). |
| `--version` | With no command, the same as `agc version`. |
| `--` | Ends flag parsing; everything after it is passed through untouched (`agc exec -- npm test`). |

Flags take `--flag value` or `--flag=value`. Only the flags in the list below take a value; any other argument starting with `-` is a boolean flag, so `--no-wait` and `--delete` never consume the next word. A flag the command doesn't take is refused before anything runs, with `usage.unknown_flag` (exit 2), `data.flag`, and `data.closest` when one is close. `agc notifications` and `agc steer hook` don't check their flags this way.

Flags that take a value:

<!-- generated: value-flags -->
`--add` `--after` `--app` `--app-id` `--asked-by` `--at` `--autonomy` `--base` `--before` `--body` `--branch` `--budget` `--connection` `--counter` `--cursor` `--data` `--default` `--email` `--env` `--error` `--event` `--exception` `--file` `--fixes` `--from` `--from-git` `--grep` `--idempotency-key` `--invite` `--join` `--kind` `--level` `--limit` `--name` `--note` `--notices` `--op` `--option` `--org` `--outcome` `--owner` `--page` `--pr` `--process` `--prompt` `--q` `--question` `--receipt` `--release` `--request` `--run` `--since` `--sort` `--stack` `--tab` `--tagline` `--timeout` `--title` `--to` `--until` `--url` `--why` `--word` `--work` `-m`
<!-- /generated: value-flags -->

### Commands

`[name]` is a mirror name; it defaults to the current git branch (lowercased, non-alphanumerics turned into `-`, at most 41 characters), or `dev` outside git. Where a command takes `[name]`, `--name <name>` does the same. The last column is what `agc help <command>` opens; "unknown topic" means it answers `help.unknown_topic`.

<!-- generated: commands -->
| Command | Subcommands | Flags | What it does | `agc help <command>` |
|---|---|---|---|---|
| `agc help [topic\|command]` | – | – | Lists help topics with where to start, or prints one topic's markdown in `data.markdown`. A command name maps to the topic that covers it. Unknown topic: `help.unknown_topic`. | unknown topic |
| `agc status` | – | – | Where you are: the app, production's URL and release, pending approvals and operations, mirrors (with local ports and egress), your identity, and the first task. Refreshes the Agent Cloud section of AGENTS.md. Run it first in every session. | `status` |
| `agc preview <create\|get\|list\|stop> [--pr <n>]` | `create`, `get`, `list`, `stop` | `--pr <pr>` | PR previews for an operator-qualified app's linked GitHub repository: create or reuse, read, list (with quota), or request cleanup. Infers the PR from the branch's upstream remote unless `--pr` is given. Source supports qualified staging and production; live activation is not established here. | `preview` |
| `agc version` | – | – | `data.version`, `data.built` (the build time, or `null` from source) and `data.node`. | `output` |
| `agc doctor` | – | – | Checks PATH (is the first `agc` ours), updates, login, manifest, link, uv for Python apps, and whether the code reads the `[data.db] env` variable. Fails with `doctor.checks_failed` when any check fails. | `onboarding` |
| `agc init [--name <name>]` | – | `--app-id <app-id>` `--bring` `--event <event>` `--from <from>` `--invite <invite>` `--join <join>` `--name <name>` `--no-git` `--no-up` `--org <org>` `--prompt <prompt>` `--reset-identity` `--stack <stack>` `--steer-hook` | Creates the app on Agent Cloud (and its production database) and links this folder. An empty folder gets a starter; a folder with code gets an inferred `agentcloud.toml`. Writes AGENTS.md and the `@AGENTS.md` line in CLAUDE.md, adds `.env.mirror` to .gitignore, and mints this machine's agent if it has none. `--bring` makes this folder's existing code the app on purpose; without it, `--name` in a folder that isn't new and empty is `init.not_new_folder`. `--join <code>` creates it in the code's organization; `--prompt` keeps the person's first prompt as the app's first task; `--event <agce_…>` makes this machine's new agent under an event's code; `--from <tag>` records where the app came from; `--steer-hook` installs the `agc steer hook claude` hook. `--app-id <app_…> --org <org>` verifies an existing app from its `agentcloud.toml` instead of creating one. | `onboarding` |
| `agc whoami` | – | – | The credential agc uses: id, kind, state, person, organization, purpose, claim deadline or expiry, and `data.source` (`AGC_TOKEN` or the identity file). | `reference` |
| `agc login` | – | – | Not available in `agc`: it answers `cli.not_available` (milestone M3). Only `agc-root`, Agent Cloud's own staff build, signs in this way, with a staff person approving a code in their browser. | `onboarding` |
| `agc up [name]` | – | `--at <at>` `--deps-only` `--detach` `--name <name>` `--no-frames` | Creates or resumes a mirror (default name: the git branch, else `dev`): forks production masked, installs dependencies outside the sandbox, migrates and seeds an empty copy, then starts the app (and worker) on localhost inside the OS sandbox. Returns once the app answers. `--at` makes a copy of production as it was then. `--deps-only` installs the dependencies and does nothing else: no copy, no request to Agent Cloud, no app. | `mirror` |
| `agc down [name]` | – | `--delete` `--name <name>` | Stops the mirror's local processes. `--delete` also deletes the mirror and its database on Agent Cloud. | `mirror` |
| `agc exec [name] -- <command>` | – | `--name <name>` | Runs a command in the app folder with the mirror's environment and connection variables, inside the mirror's sandbox. Output is scrubbed of credentials. | `mirror` |
| `agc migrate [name]` | – | `--name <name>` | Snapshots the mirror's data, applies pending migration files in order (one transaction each unless opted out), checks no existing row was lost, then runs a pending seed. | `migrations` |
| `agc migration new <slug>` | `new` | – | Creates `<migrations>/<timestamp>_<slug>.sql` and prints its stem. | `migrations` |
| `agc import <dump> \| --cancel` | – | `--cancel` | Checks a pg_dump locally (format, size, owners) and answers with the console Import data page link for a person. Uploads nothing. `--cancel` drops an unfinished upload. | `import` |
| `agc check [name]` | – | `--name <name>` | Runs smoke flows against the running mirror, the sign-in state check, then invariants on its database (read-only, 30 s each). Lint warnings ride in `data.warnings`. A failure exits 11. | `checks` |
| `agc outbox [name]` | – | `--name <name>` | The email the mirror's app sent, as captured by Agent Cloud. Nothing on a mirror is delivered. | `background` |
| `agc verify [name]` | – | `--name <name>` | AI browser verification of each `[[verify]]` goal on the running mirror, two tries each. Needs the organization's AI browser checks setting and jev-ultrafast installed. Never blocks a ship. | `verify` |
| `agc walkthrough [file]` | – | `--name <name>` `--release <release>` `--url <url>` `--work <work>` `--yes` | Runs one Playwright test file against the running mirror (or a loopback `--url`) and records it, so the person approving a release can watch the change work. It is evidence and never blocks anything: its result rides along with the next `agc ship` of the same content, with the video once an owner turns walkthrough videos on. `--release <op>` records an expired release’s video again. | `walkthrough` |
| `agc review` | – | – | The Well-Architected Review's open findings, highest risk first; `fixed_by` is `agent` (with `fix.prompt`) or `person`. | `review` |
| `agc logs` | – | `--before <before>` `--follow` `--grep <grep>` `--level <level>` `--limit <limit>` `--process <process>` `--release <release>` `--since <since>` | Production web and worker lines (and the platform's lines about them), scrubbed, newest first; the live release and last 15 minutes by default. `data.next` is the `--before` cursor. `--follow` prints NDJSON until interrupted. | `logs` |
| `agc events` | – | `--failed` `--limit <limit>` | The app's platform events (releases, approvals, rehearsals, repo syncs and their failures), newest first, each with `type`, `at`, `message` and `op`, scrubbed by Agent Cloud. The newest 30 by default; `--limit` takes 1 to 100 (`events.bad_limit` otherwise); `--failed` answers only failures. | `output` |
| `agc features [feature]` | – | `--export` `--release <release>` `--timeline` | The app’s feature map at its latest stored release, or the one `--release v<N>` names: each feature with its maturity, reason, coverage and parts. `--timeline` shows how the map grew; `--export` prints the map as the features.toml an app ships to own it. `[features] map = false` stores no map. | `features` |
| `agc context [show <slug> \| search <words> \| add --title "<title>" --file <path> \| edit <slug> --base <updated_at>]` | `show`, `search`, `add`, `edit` | `--base <base>` `--file <file>` `--title <title>` | The organization's docs for agents: list (with `data.writes`, what this agent may write), read one (`data.content`), search, add or edit. Only an agent with the Builder purpose writes. | `context` |
| `agc connections [request <name> --why "<reason>" [--write]]` | `request` | `--why <why>` `--write` | The organization's connections for this app: each capability's state and the variable names the app gets. `request` asks for read (or write) access; may exit 10 for an owner. | `connections` |
| `agc notifications [channels \| add <channel> \| add --email <address> \| pause\|resume\|remove <channel>]` | `channels`, `add`, `pause`, `resume`, `remove` | `--app <app>` `--email <email>` `--notices <notices>` | Where the app's notices go besides the people they're for: Slack channels and email addresses, what each gets, and whether it's paused or confirmed. Only an agent working for an owner of the app or its organization changes them (`notifications.not_owner` otherwise). Only where this Agent Cloud has notifications turned on: elsewhere the list says `on: false` and changes are refused with `notifications.not_available`. | `notifications` |
| `agc audience [set <anyone\|org\|people\|group> [names...]]` | – | – | Who can open the app: anyone, the organization, named people or a group. Any agent credential reads it. `agc audience set` is for a Builder agent working for an owner of the app or its organization, and is recorded as that person’s change; the app’s settings (Who can use it) change the same setting. | `audience` |
| `agc apps move <app> --to <organization slug> \| give <app> --to <email>` | `move`, `give` | `--to <to>` | An owner’s agent moves an app to another organization of theirs, as the console’s Move to an organization does. It names the app, so it runs in any folder. Refusals: `move.not_owner`, `move.not_member` and `move.personal_destination` (exit 12), `move.same_org` (exit 2), and `move.rollback_active` (exit 14) while a rollback holds the app, with `agc wait <op>` in `next`. After a move, `next` says to set `[app] org` in the app’s agentcloud.toml and use an agent of the new organization. | `apps` |
| `agc icon [history \| use <file.svg\|file.png> \| use --version <v> \| preview]` | `history`, `use`, `preview` | `--default <default>` `--file <file>` `--tagline <tagline>` `--title <title>` | The app’s icon: its version, source, title, tagline and the address of each file derived from it. Any credential of the app reads it; a Builder agent of someone in the app’s organization sets it. An SVG with a square viewBox (at most 256 KB) or a square PNG of 512 to 4096 px (at most 1 MB); each set is a new version, and an app takes 30 changes a day. Until one is set, the app has the default, the first letter of its name on a color, and `agc check` and a live `agc ship` say so. | `icon` |
| `agc secret <ls \| set <NAME> \| rm <NAME>>` | `ls`, `set`, `rm` | `--generate` `--here` | Secrets by name only. `set` and `rm` answer with the console link for a person; `set --generate` has Agent Cloud make a 32-byte value nobody sees; `--here` refuses with `secret.person_only`. | `secrets` |
| `agc address <label>` | – | – | The console link where a person moves the app to `<label>.ac0.app`. Changes nothing itself. | `reference` |
| `agc delete [app]` | – | – | Deletes nothing: only the app’s owner or an organization owner deletes an app, in the console. For a live app it names that console form and who can use it; once the app is deleted it says what was removed, what is still being removed and what is kept. A name other than this folder’s app is `delete.not_this_app`. | `delete` |
| `agc domain [add <name> \| remove <name>]` | `add`, `remove` | – | The app's custom domains with each one's state, step and DNS records. `add` and `remove` ask a person (exit 10) unless an operator calls. | `domains` |
| `agc domains [add <name> \| remove <name>]` | – | – | Alias of `agc domain`. | `domains` |
| `agc feedback <bug\|idea> "<title>"` | `bug`, `idea` | `--app <app>` `--body <body>` `--error <error>` `--op <op>` `--page <page>` `--receipt <receipt>` | Files a bug or idea about Agent Cloud itself as an issue on Agent Cloud's own repository; `data.filed_as` says where. Body from `--body <file>` or `--body -` (stdin). | `feedback` |
| `agc replay <type:id> [name]` | – | `--name <name>` | Every workflow event on the mirror's log that names the entity, oldest first. | `replay` |
| `agc capsule <type:id \| inc_…> \| --from <t> --to <t>` | – | `--from <from>` `--to <to>` | Production shapes and counts around an entity, an incident or a time window: workflow steps, failed requests by route, error classes and code locations. Never values. | `capsule` |
| `agc ship` | – | `--app <app>` `--branch <branch>` `--counter <counter>` `--fixes <fixes>` `--from-git <from-git>` `--idempotency-key <idempotency-key>` `--no-wait` `--pr <pr>` `--work <work>` `-m <text>` | Snapshots the folder (or one commit with `--from-git`), uploads assets and the snapshot, starts the release and follows it for up to 10 minutes: build, rehearse, decide, migrate, switch. Success is exit 0 with `outcome: "live"`. `-m "<intent>"` names the release (one line, at most 120 characters; `ship.bad_intent` otherwise) in place of the last commit's subject. | `ship` |
| `agc task <start\|status\|take\|release\|renew\|end\|record> --work <id>` | `start`, `status`, `take`, `release`, `renew`, `end`, `record` | `--counter <counter>` `--data <data>` `--exception <exception>` `--kind <kind>` `--outcome <outcome>` `--work <work>` | One task per change, with an owner and a counter. agc keeps the counter it was given and sends that one. | `tasks` |
| `agc now "<what you’re about to do>"` | – | – | Sends one line (at most 120 characters) of what the agent is about to do to the people watching the folder’s live session, through the running mirror. No live session in the folder is `live.not_running`; a session written as another credential is `live.not_writer`. | `now` |
| `agc steer [take\|done\|wont <id>]` | `take`, `done`, `wont` | `--check` `--note <note>` `--why <why>` | The steers people on the app's team sent for the open Work item this agent builds, oldest first, each with its `id`, `text`, `lane` and `target`. `--check` answers `data.now`, the waiting "now" steer or null, and always exits 0. No such item: `steer.no_item`. | `steer` |
| `agc twin [up] [--name <name>]` | `up` | `--name <name>` | Bring an app from another repository onto Agent Cloud (staging only). Bare `agc twin` scans the folder and names what the app needs; on Agent Cloud production it answers `cli.not_available` and points to `agc init --bring`, then `agc ship`. | `twin` |
| `agc branch <name> --from <checkpoint> \| switch\|merge\|delete <name> \| list \| prune` | `switch`, `merge`, `list`, `delete`, `prune` | `--from <from>` | Build branches from a step’s checkpoint. Each move checkpoints the working tree first, so nothing uncommitted is lost, and tells the folder’s live session. A build branch `word-game` is the git branch `agc/word-game`. | `steer` |
| `agc blueprint [folder]` | – | – | The blueprint a live session sends for a folder’s code (its nodes, edges and digest), parsed locally. It asks Agent Cloud nothing. | `reference` |
| `agc work <list \| show <n> \| ask "<ask>" \| answer <n> "<answer>" --question <id> \| end <n> "<why>">` | `list`, `show`, `ask`, `answer`, `end` | `--after <after>` `--app <app>` `--asked-by <asked-by>` `--cursor <cursor>` `--follow` `--gap` `--limit <limit>` `--note <note>` `--option <option>` `--owner <owner>` `--q <q>` `--question <question>` `--since <since>` `--sort <sort>` `--tab <tab>` `--timeout <timeout>` `--title <title>` `--until <until>` | The app's Work items, as this credential may see them. `ask`, `answer` and `end` act for the person whose Builder agent this is. | `work` |
| `agc builder <on\|off\|status>` | `on`, `off`, `status` | – | The app's hosted builder. `on` and `off` ask the app's owner in the console (exit 10, `builder.approval_required`); `status` says where it stands. | `tasks` |
| `agc limits [set]` | – | `--autonomy <autonomy>` `--budget <budget>` | The app’s budget, autonomy, availability, region and caps. `agc limits set --budget <n> --autonomy <routine\|watch>` is a person’s: from a Builder credential it asks them, and nothing changes until they approve it in the console (exit 10, with the link to relay). | `limits` |
| `agc repo retry` | `retry` | – | `agc repo retry` asks Agent Cloud to try the app's failed repo sync again, as Try again on the app's settings page does. Only a credential that may ship the app asks, and only while the repo's state is failed (`repo.nothing_to_retry` otherwise). Answers the repo as `agc status` shows it, or `running: true` while the try goes on. | `status` |
| `agc pull --fresh \| --base-only` | – | `--base-only` `--fresh` | `--fresh` keeps this tree under `.agentcloud/kept/<time>`, puts the live release's code in its place, and lists what differs, so you can apply your change again. `--base-only` records the live release as this tree's base and changes no file; it's refused when the tree isn't that release's code. Bare `agc pull` answers `cli.not_available`. | `ship` |
| `agc cancel <op_…>` | – | – | Ends a ship stuck judging its rehearsal: the operation ends `cancelled`, production is unchanged and the app is free for the next `agc ship`. Any other operation is refused with `op.not_cancellable`, naming its state; follow it with `agc wait`. | `wait` |
| `agc receipt <op_…\|rcp_…>` | – | – | An operation's receipt, by its op id or its release record's id: what changed, which checks ran with what evidence, who or what decided, cost and how to undo it, for every outcome. Changes nothing. An unowned app's private preview has none until its person publishes it (`receipt.preview`); an id this app doesn't know is `receipt.not_found`. | `receipt` |
| `agc wait <op> \| --idempotency-key <key> \| --work <id>` | – | `--idempotency-key <idempotency-key>` `--watch` `--work <work>` | Reattaches to an operation (or the ship a key or work item started) and follows it for up to 10 minutes, one NDJSON line per stage when not at a terminal. `--watch` answers `cli.not_available`. | `wait` |
| `agc approvals` | – | – | What waits on a person, each with its `decision`; for an in-session decision, `data.how` says exactly how to ask. | `approvals` |
| `agc approve <apr_…> --word <word>` | – | `--autonomy <autonomy>` `--budget <budget>` `--word <word>` | Records the person's approval of exactly that approval. A first release takes `--budget` (5 to 1000) and `--autonomy` (`routine` or `watch`). | `approvals` |
| `agc decline <apr_…> --word <word>` | – | `--why <why>` `--word <word>` | Records the person's decline; `--why` carries their words (up to 2,000 characters). | `approvals` |
| `agc deny <apr_…> --word <word>` | – | `--why <why>` `--word <word>` | Alias of `agc decline`. | `approvals` |
| `agc agent <install\|uninstall> codex` | `install`, `uninstall` | – | Adds or removes a short agc section in Codex's global AGENTS.md (`$CODEX_HOME/AGENTS.md`, default `~/.codex/AGENTS.md`). `codex` is the only target. | `onboarding` |
| `agc devbox [join <code>\|connect\|ports\|db] [--app <name>]` | `join`, `connect`, `ports`, `db` | `--add <add>` `--app <app>` `--join <join>` `--request <request>` `--stop` | The person's Devbox for one app (staging only). Bare `agc devbox` links the app and makes or resumes its Devbox; `--app` is remembered for later commands. | `devbox` |
| `agc db [name] \| query "<sql>" \| diff [name] \| reset [name]` | `query`, `diff`, `reset` | `--connection <connection>` `--env <env>` `--file <file>` `--fresh` `--name <name>` | Bare `agc db` opens psql on the mirror (terminal only). | `data` |
| `agc steer hook claude` | – | – | Claude Code's pre-tool hook, which `agc init --steer-hook` installs. When a "now" steer waits, it takes it and stops the next action with the steer as the reason; otherwise it prints nothing. It answers in Claude Code's format, never an envelope, and always exits 0. `claude` is the only agent it serves. | unknown topic; read `agc help steer` |
| `agc update` | – | – | Checks for and installs a newer agc now, whatever the hourly schedule; answers whether it updated, that it's current, or `cli.update_failed`. | `reference` |
<!-- /generated: commands -->

### Subcommands

<!-- generated: subcommands -->
| Command | What it does |
|---|---|
| `agc preview create` | Allocate or reuse the preview for a PR; queues an update when the PR head changed. |
| `agc preview get` | The preview's state, links and expiry; never allocates. |
| `agc preview list` | Active, cleanup-pending and recent previews, with allocated/limit counts. Takes no `--pr`. |
| `agc preview stop` | Request retirement of the PR's preview; safe to repeat. |
| `agc migration new <slug>` | Create a timestamped migration file. |
| `agc context show <slug>` | One doc's markdown in `data.content`. |
| `agc context search <words>` | Docs containing every word, with a snippet. |
| `agc context add` | Add a doc: `--title` and its markdown from `--file <path>` (`--file -` reads standard input). |
| `agc context edit <slug>` | Replace a doc's title or markdown. `--base` is the `updated_at` you read; a doc changed since is refused with `context.changed`. |
| `agc connections request <name>` | Ask for read access, or write with `--write`; `--why` is required. |
| `agc notifications channels` | The Slack channels Agent Cloud's bot is in. |
| `agc notifications add <channel>` | Send the app's notices to a channel, by its Slack id; `--notices` picks which, comma-separated. With `--email <address>`, to an address, which gets nothing until it confirms. |
| `agc notifications pause <channel>` | Stop sending to it for now. |
| `agc notifications resume <channel>` | Start sending to it again. |
| `agc notifications remove <channel>` | Stop sending to it. |
| `agc apps move` | Moves the named app to the organization `--to` names, by its slug. `move.db_login_open` (exit 14) while a production database login made in the console is open for the app. |
| `agc apps give` | Offers the named app to the person `--to` names, by email; they accept it in their own console into any organization of theirs, Personal included, within 7 days. Refusals: `give.not_owner` and `give.pending` (exit 12), `give.self` and `give.bad_request` (exit 2). |
| `agc icon history` | Every version, and which one is current. |
| `agc icon use` | `agc icon use icon.svg` sets a new icon; `agc icon use --version <v>` goes back to an earlier one as a new version. |
| `agc icon preview` | The link preview: `--title` (1 to 40 characters) and `--tagline` (at most 90) for Agent Cloud to draw, or `--file` for your own 1200×630 PNG. |
| `agc secret ls` | Names, who set each and when, whether the live release has it, and which `[secrets] required` are missing. |
| `agc secret set <NAME>` | The console link to set it; with `--generate`, Agent Cloud makes the value. |
| `agc secret rm <NAME>` | The console link to remove it. |
| `agc domain add <name>` | Store the domain and ask a person to approve; answers the TXT and CNAME records. |
| `agc domain remove <name>` | Ask a person to approve removing it. |
| `agc feedback bug "<title>"` | A problem with Agent Cloud. |
| `agc feedback idea "<title>"` | A suggestion for Agent Cloud. |
| `agc task start` | Become the owner (needs `--outcome`), or answer the task as it is. |
| `agc task status` | State, owner, counter, lease and your role. |
| `agc task take` | Take an unowned task or one whose lease lapsed. |
| `agc task release` | Give up ownership (owner only). |
| `agc task renew` | Renew the lease (owner only). |
| `agc task end` | End the task (owner only; needs `--exception`). |
| `agc task record` | The owner's record: `--kind` built, checked, paused, resumed, note or cost, with `--data` JSON. |
| `agc steer take <id>` | Say you're on it. |
| `agc steer done <id>` | Close it; `--note` says what you did. |
| `agc steer wont <id>` | Close it without doing it; `--why` is required. |
| `agc twin up` | Scan this folder, create the app as `agc init --bring` does and ship it. |
| `agc branch switch <name>` | Switch to a build branch. |
| `agc branch merge <name>` | Merge a build branch into the one you’re on. |
| `agc branch list` | The build branches, and which one you’re on. |
| `agc branch delete <name>` | Delete a build branch other than the one you’re on. |
| `agc branch prune` | Drops every checkpoint, and nothing else; branches stay. |
| `agc work list` | A page of items; `next` carries the `--cursor` for the page after. |
| `agc work show` | One item's steps, where it stands, and its record. `--follow` follows it until its next stop or `--timeout` (30s to 60m; default 10m). |
| `agc work ask` | Add an ask: what should be different when it's done, as one quoted argument of up to 4,000 characters; `--title` gives it a one-line title. |
| `agc work answer` | Answer the builder's open question, in words or with `--option`; `--question` names the question you read. |
| `agc work end` | End an item, with why it ends kept word for word in its record. |
| `agc builder on` | Ask the owner to turn the hosted builder on. |
| `agc builder off` | Ask the owner to turn it off. |
| `agc builder status` | State, since when, who decided, what's waiting. |
| `agc repo retry` | Try the failed repo sync again. |
| `agc agent install codex` | Add or update the section. |
| `agc agent uninstall codex` | Remove it. |
| `agc devbox join <code>` | Alias of `agc devbox --join <code>`: connects this laptop with the person's join code, links the app, then makes or reopens its Devbox. With no code it's `cli.usage`. |
| `agc devbox connect` | Write the `agentcloud-<app>` SSH host block, register the key, probe the path, tell Codex desktop, and hand `--request` to the Devbox. |
| `agc devbox ports` | Forward the Devbox's declared ports to 127.0.0.1 in the background; `--stop` ends it; inside a Devbox `--add <port>` declares one. |
| `agc devbox db` | Run psql (or the tool after `--`) on the Devbox's database copy through the tunnel. |
| `agc db query "<sql>"` | One statement on the mirror (first 100 rows), or with `--env prod` a masked, read-only query on production; `--fresh` waits for a new copy. |
| `agc db diff [name]` | Schema and row changes since the last `agc migrate` snapshot. |
| `agc db reset [name]` | Delete the mirror and make a fresh masked fork (`agc down --delete` then `agc up`). |
<!-- /generated: subcommands -->

### Internal entry points

agc runs these itself; they don't print an envelope and aren't for you to call. `agc devbox proxy` is SSH's `ProxyCommand` for a Devbox host (stdout is the SSH stream). `agc devbox ports` with no other argument in a terminal stays in the foreground printing one line per port.

<!-- generated: internal -->
- `agc __supervise`
- `agc __live-front`
- `agc __sandboxed`
- `agc __devbox-ports`
- `agc devbox proxy`
- `agc devbox ports`
<!-- /generated: internal -->

## agc help topics

`agc help <topic>` prints a page of agc's own documentation, offline, in `data.markdown`. Topics are generated at build time from sections of `docs/cli-spec.md` (and `agents` from `docs/AGENTS.md`), so they match the agc you have installed. The table maps each topic to its source and to the docs page that covers the same thing in more depth.

```bash
agc help
agc help migrations
```

`agc help` with no topic answers `data.start_here` (`new app`: `onboarding`; `existing app`: `bring`; `data change`: `migrations`, `checks`) and `data.topics`, the full list.

<!-- generated: topics -->
| `agc help <topic>` | Built from | Also opened by `agc help <command>` | Docs page |
|---|---|---|---|
| `reference` | cli-spec §5.1 | `address`, `blueprint`, `break-glass`, `freeze`, `limits`, `update`, `whoami` | [reference/cli-reference](/docs/reference/cli-reference.md) |
| `status` | cli-spec §5.2 | `repo` | [reference/cli-reference](/docs/reference/cli-reference.md) |
| `onboarding` | cli-spec §10 | `agent`, `doctor`, `init`, `login` | [getting-started/quickstart-new-app](/docs/getting-started/quickstart-new-app.md), [getting-started/installing-agc](/docs/getting-started/installing-agc.md) |
| `manifest` | cli-spec §3, cli-spec §3.1, cli-spec §3.2 | `mcp` | [reference/agentcloud-toml-reference](/docs/reference/agentcloud-toml-reference.md) |
| `mirror` | cli-spec §5.3 | `cron`, `down`, `exec`, `up` | [build/local-development-with-agc-up](/docs/build/local-development-with-agc-up.md) |
| `ssh` | cli-spec §5.4 | `ssh-config` | none: describes a command that isn't built |
| `migrations` | cli-spec §3.1, cli-spec §5.5 | `migrate`, `migration` | [data/migrations](/docs/data/migrations.md), [data/safe-schema-changes](/docs/data/safe-schema-changes.md) |
| `checks` | cli-spec §3.2, cli-spec §5.6 | `check` | [checks/checks-overview](/docs/checks/checks-overview.md), [checks/smoke-flows](/docs/checks/smoke-flows.md) |
| `features` | cli-spec §3.3 | – | [reference/cli-reference](/docs/reference/cli-reference.md) |
| `verify` | cli-spec §5.7 | – | [checks/ai-browser-verification](/docs/checks/ai-browser-verification.md) |
| `review` | cli-spec §5.8 | – | [ship/well-architected-review](/docs/ship/well-architected-review.md) |
| `background` | cli-spec §5.9 | `email`, `jobs`, `mail`, `outbox`, `queue`, `worker`, `workers` | [build/background-work-and-workers](/docs/build/background-work-and-workers.md), [build/sending-email](/docs/build/sending-email.md) |
| `replay` | cli-spec §5.10 | – | [build/workflow-events-and-replay](/docs/build/workflow-events-and-replay.md) |
| `capsule` | cli-spec §5.11 | – | [ship/investigating-a-reported-problem](/docs/ship/investigating-a-reported-problem.md) |
| `context` | cli-spec §5.12 | `context` | [owners/context-docs-for-agents](/docs/owners/context-docs-for-agents.md) |
| `connections` | cli-spec §5.13 | `connection`, `connections` | [owners/connections](/docs/owners/connections.md), [reference/app-runtime-contract](/docs/reference/app-runtime-contract.md) |
| `notifications` | cli-spec §5.21 | – | [reference/cli-reference](/docs/reference/cli-reference.md) |
| `audience` | cli-spec §5.25 | – | [build/choosing-a-sign-in-shape](/docs/build/choosing-a-sign-in-shape.md) |
| `apps` | cli-spec §5.30 | – | [owners/setting-up-an-organization](/docs/owners/setting-up-an-organization.md) |
| `receipt` | cli-spec §5.31 | – | [ship/agc-ship-end-to-end](/docs/ship/agc-ship-end-to-end.md) |
| `twin` | cli-spec §5.32 | – | [reference/cli-reference](/docs/reference/cli-reference.md) |
| `icon` | cli-spec §5.28 | – | [build/your-apps-icon](/docs/build/your-apps-icon.md) |
| `analytics` | cli-spec §5.26 | – | [reference/cli-reference](/docs/reference/cli-reference.md) |
| `feedback` | cli-spec §5.14 | – | [getting-started/working-with-your-coding-agent](/docs/getting-started/working-with-your-coding-agent.md) |
| `preview` | cli-spec §5.16 | – | [ship/pr-previews](/docs/ship/pr-previews.md) |
| `devbox` | cli-spec §5.17 | `devbox` | [ship/devboxes](/docs/ship/devboxes.md) |
| `import` | cli-spec §5.18 | `import` | [data/importing-existing-data](/docs/data/importing-existing-data.md) |
| `bring` | cli-spec §5.19 | – | [getting-started/quickstart-existing-app](/docs/getting-started/quickstart-existing-app.md) |
| `steer` | cli-spec §5.20 | `branch` | [ship/work-tab-and-builders](/docs/ship/work-tab-and-builders.md) |
| `now` | cli-spec §5.27 | – | [ship/the-live-screen](/docs/ship/the-live-screen.md) |
| `person` | cli-spec §5.29 | – | [getting-started/working-with-your-coding-agent](/docs/getting-started/working-with-your-coding-agent.md) |
| `delete` | cli-spec §5.23 | – | [ship/deleting-and-restoring-an-app](/docs/ship/deleting-and-restoring-an-app.md) |
| `walkthrough` | cli-spec §5.22 | – | [reference/cli-reference](/docs/reference/cli-reference.md) |
| `ship` | cli-spec §6.1, cli-spec §6.2, cli-spec §6.3, cli-spec §6.6 | `plan`, `pull`, `ship` | [ship/agc-ship-end-to-end](/docs/ship/agc-ship-end-to-end.md) |
| `wait` | cli-spec §4.4 | `cancel`, `ops` | [concepts/operations-and-waiting](/docs/concepts/operations-and-waiting.md) |
| `undo` | cli-spec §6.5 | – | [ship/after-release-watch-and-rollback](/docs/ship/after-release-watch-and-rollback.md) |
| `tasks` | cli-spec §6.7 | `builder`, `task` | [ship/work-tab-and-builders](/docs/ship/work-tab-and-builders.md) |
| `work` | cli-spec §6.8 | – | [ship/work-tab-and-builders](/docs/ship/work-tab-and-builders.md) |
| `approvals` | cli-spec §6.4 | `approve`, `decline`, `deny` | [concepts/approvals](/docs/concepts/approvals.md), [ship/approving-in-a-session-vs-the-console](/docs/ship/approving-in-a-session-vs-the-console.md) |
| `autonomy` | cli-spec §7, cli-spec §7.1, cli-spec §7.2 | – | [owners/release-governance](/docs/owners/release-governance.md) |
| `limits` | cli-spec §7.3 | – | [owners/release-governance](/docs/owners/release-governance.md) |
| `data` | cli-spec §8.2 | `db` | [data/reading-production-safely](/docs/data/reading-production-safely.md), [data/mirror-db-tools](/docs/data/mirror-db-tools.md) |
| `secrets` | cli-spec §8.3 | `secret` | [build/secrets](/docs/build/secrets.md) |
| `logs` | cli-spec §8.4 | `errors`, `metrics` | [ship/investigating-a-reported-problem](/docs/ship/investigating-a-reported-problem.md) |
| `domains` | cli-spec §8.5 | `domain` | [build/custom-domains](/docs/build/custom-domains.md) |
| `storage` | cli-spec §8.6 | – | none published yet |
| `output` | cli-spec §4.1, cli-spec §4.2, cli-spec §4.3, cli-spec §4.5, cli-spec §4.6 | `events`, `version`, `why` | [reference/the-json-envelope](/docs/reference/the-json-envelope.md) |
<!-- /generated: topics -->

### How topics are built

- A topic heading names its subject; spec section numbers and rule IDs are removed, and "section 5.5" becomes `` `agc help migrations` ``.
- Every mention of a command that isn't built yet (from `packages/cli/src/milestones.ts`) is marked "(not yet)", in prose and as `# not yet` in code blocks.- Relative links are reduced to their text; help never links to a file you don't have.
- `agc help agents` prints the full product AGENTS.md, the same text served at `https://agent.cloud/agents.md`.

## Errors

| Code | Exit | Cause | Fix |
|---|---|---|---|
| `cli.unknown_command` | 2 | The command doesn't exist. | `agc help reference` lists every command. |
| `usage.unknown_flag` | 2 | A flag the command doesn't take, often a typo (`--nmae`). Nothing was done. | Run it again with `data.closest`, or without the flag. |
| `cli.not_available` | 1 | A command agc doesn't run in this release, `agc wait <op> --watch`, or a bare `agc pull`. | Use what agc has: roll forward with `agc check` and `agc ship`, follow operations with `agc status` and `agc wait <op>`, and read errors with `agc logs --level error` and `agc capsule`. |
| `help.unknown_topic` | 2 | `agc help <x>` with no topic or command mapping. | `agc help` lists topics. |
| `manifest.invalid` | 2 | `agentcloud.toml` doesn't parse, a key has the wrong type, or `[app] control` isn't an accepted origin. | Fix the line or key the message names; `agc help manifest`. |
| `cli.environment_mismatch` | 1 | The folder's app belongs to another Agent Cloud than this agc talks to. | Run the executable for that environment (for staging, `agc-staging`). |

An unknown help topic:

```json
{"ok":false,"product":"agent.cloud","command":"help","error":{"retryable":false,"code":"help.unknown_topic","message":"No help topic \"deploy\".","fix":"Run `agc help` to list topics."},"next":[{"cmd":"agc help","why":"list topics"}]}
```

Every code: [Error code catalog](/docs/reference/error-code-catalog.md).

## Agent notes

- `agc up --detach` is safe to run and is what AGENTS.md says, but agc never reads `--detach`: `agc up` always returns once the app answers, leaving the mirror running under a detached supervisor until `agc down`.
- No dry-run equivalent of `agc ship`: review locally and run `agc check` on your mirror, and run `agc ship` only when deployment is intended.
- `agc ship` follows the release for 10 minutes. If it returns exit 20 (`ship.still_running`), run `agc wait <op>`; never ship again to "check".
- `agc approve` and `agc decline` record a person's answer. Run them only with the word from that person's reply to the question agc gave you.
- `agc db` with no subcommand opens psql and needs a terminal (`db.needs_terminal`). Use `agc db query "<sql>"`.
- `agc help <command>` opens the topic that covers a command without one of its own: `task` and `builder` open `tasks`, `approve`, `decline` and `deny` open `approvals`, `agent` opens `onboarding`, and `whoami`, `address` and `update` open `reference`.
- Help pages are long (the `reference` topic is the whole command table). Read the topic `docs` names, not all of them.
- Don't build a substitute for a command that isn't built. A script that rolls back by redeploying an old tree, or edits production data outside a migration, bypasses the rehearsal and approval that `agc ship` enforces.
- `cli.not_available` is a platform code, so agc adds an `agc feedback bug` suggestion to `next` (once a day per code and app). File it when the missing command blocks the task.
- agc never takes a secret's value: `agc secret set NAME` answers the console link for a person, `--here` refuses with `secret.person_only` (exit 2) and the same link, and `--generate` has Agent Cloud make a value nobody sees.
- `agc builder on` asks the app's owner when a decision is needed: exit 10, `builder.approval_required`; relay `data.approval.url`.
- `agc preview` runs where the control serves previews; a control without them answers `cli.not_available`. See [PR previews](/docs/ship/pr-previews.md).

## Related

- [The JSON envelope, output modes and exit codes](/docs/reference/the-json-envelope.md)
- [After release: "live", the watch window, rollback](/docs/ship/after-release-watch-and-rollback.md)
- [Error code catalog](/docs/reference/error-code-catalog.md)
- [Working with your coding agent](/docs/getting-started/working-with-your-coding-agent.md)
- [agc environment variables](/docs/reference/agc-environment-variables.md)

<!-- feedback:start -->
---
Wrong, outdated or unclear? Run `agc feedback docs "reference/cli-reference: <what is wrong>" --body <file>` with the sentence quoted in the file. No code or app data is sent.
<!-- feedback:end -->
