> ## Documentation Index
> Fetch the complete documentation index at: https://www.anything.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI

> Build, iterate on, and manage Anything apps from your terminal

The Anything CLI lets you create apps, send prompts, publish, and manage everything from your terminal. It's the same Anything agent you use in the browser, driven by commands instead of clicks. It's built for scripting and for AI coding agents, so every command can speak structured JSON.

<Info>
  The CLI is rolling out to select accounts. If you don't have access yet, email [hello@anything.com](mailto:hello@anything.com).
</Info>

## Install

```bash theme={null}
npm install -g @anythingai/cli
```

Requires Node.js 24 or later. The command is `anything`.

## Authenticate

Log in through your browser, or use an API key for scripts and CI. Create an API key from the **Anything API Keys** section in [Settings](https://anything.com/dashboard/settings) in the dashboard.

```bash theme={null}
# Browser-based login
anything auth login

# Or pass an API key directly
anything auth login --api-key anything_xxx
```

You can also set the key as an environment variable, which is the better fit for CI and agents:

```bash theme={null}
export ANYTHING_API_KEY=anything_xxx
```

Check your state anytime, or log out:

```bash theme={null}
anything auth status
anything auth logout
```

## Quick start

```bash theme={null}
# See your account and orgs
anything user
anything orgs list

# Create an app
anything projects create --prompt "Build a todo app with dark mode" --org <org-id>

# Send a follow-up prompt
anything projects generate <project-id> --prompt "Add a filter for completed tasks"

# Publish it
anything projects publish <project-id>
```

Or do the whole thing in one command:

```bash theme={null}
anything ship "Build a markdown viewer for blog posts"
```

`ship` creates the app, runs the agent, and publishes, all in one shot. The prompt is a positional argument, so you don't need `--prompt`. To iterate on an existing app instead of creating one, pass `--project`:

```bash theme={null}
anything ship --project <project-id> "Add a settings page"
```

<Warning>
  After `ship` finishes, check `anything projects messages <id>` before telling anyone the app is live. `ship` can return `ok: true, published: true` while the agent actually paused on a clarifying question or replied with a plan only, in which case the published URL serves an empty template. If the last assistant turn is a question or a plan, answer it (or send `"proceed"`) with `anything projects generate <id> --prompt "..."`, then publish again.
</Warning>

## Commands

Run `anything <command> --help` for the full, current flag list on any command. The tables below cover the common paths.

### Projects

| Command                                          | What it does                                                                |
| ------------------------------------------------ | --------------------------------------------------------------------------- |
| `anything projects create --prompt "..."`        | Create a new app and start generation                                       |
| `anything projects generate <id> --prompt "..."` | Send a follow-up prompt                                                     |
| `anything projects get <id>`                     | View app info: platform (web or mobile), build status, deployment, and URLs |
| `anything projects list --org <org-id>`          | List apps you can access                                                    |
| `anything projects messages <id>`                | Read the agent's messages                                                   |
| `anything projects status <id>`                  | Check generation status                                                     |
| `anything projects logs <id>`                    | Read development logs (supports tailing)                                    |
| `anything projects files list <id>`              | List generated files                                                        |
| `anything projects files get <id> app/page.tsx`  | Read one file                                                               |
| `anything projects rename <id> --name "..."`     | Rename an app                                                               |
| `anything projects duplicate <id>`               | Duplicate an app                                                            |
| `anything projects delete <id> --yes`            | Delete an app (recoverable for 30 days)                                     |
| `anything projects restore <id>`                 | Restore a deleted app within its 30-day grace period                        |
| `anything projects set <id>`                     | Set the active project for later commands                                   |
| `anything projects unset`                        | Clear the active project                                                    |

`create` and `generate` accept the prompt over a pipe too, so `echo "Add dark mode" | anything projects generate <id>` works.

### Publishing

| Command                                                | What it does                                 |
| ------------------------------------------------------ | -------------------------------------------- |
| `anything projects publish <id>`                       | Publish to production (waits for the deploy) |
| `anything projects publish <id> --no-wait`             | Publish without waiting                      |
| `anything projects publish status <id> <deploy-id>`    | Check a publish deployment                   |
| `anything projects unpublish <id> --yes`               | Take an app offline                          |
| `anything projects submit <id> --store app-store`      | Submit to the App Store                      |
| `anything projects submit <id> --store play-store`     | Submit to Google Play                        |
| `anything projects submit status <id> <submission-id>` | Check a submission                           |

### Logs

```bash theme={null}
anything projects logs <id>                  # recent dev logs
anything projects logs <id> --follow         # stream (alias: --tail)
anything projects logs <id> --level error    # filter by info, warn, or error
anything projects logs <id> --search "fetch" # filter by substring
```

### Secrets

| Command                                                       | What it does    |
| ------------------------------------------------------------- | --------------- |
| `anything projects secrets add <id> --name KEY --value "..."` | Add a secret    |
| `anything projects secrets list <id>`                         | List secrets    |
| `anything projects secrets remove <id> <secret-id> --yes`     | Remove a secret |

<Warning>
  By default, `secrets add` writes to **all environments** (development, preview, and production), so a key your published app needs actually reaches it. Pass `--env development`, `--env preview`, or `--env production` to target one. If you only set a secret in development, the live app won't see it.
</Warning>

The value can also come from stdin: `cat key.txt | anything projects secrets add <id> --name OPENAI_API_KEY`.

### Databases

| Command                                      | What it does                                                  |
| -------------------------------------------- | ------------------------------------------------------------- |
| `anything databases list --org <org-id>`     | List databases                                                |
| `anything databases get <id>`                | Inspect a database                                            |
| `anything databases create --project <id>`   | Create a database for a project                               |
| `anything databases query <id> "SELECT ..."` | Run a read-only SQL query                                     |
| `anything databases connect <id>`            | Print the connection string (`--mask` to redact the password) |
| `anything databases reset <id> --yes`        | Reset a database (destructive)                                |
| `anything databases delete <id> --yes`       | Delete a database                                             |

### Domains

| Command                                               | What it does            |
| ----------------------------------------------------- | ----------------------- |
| `anything domains list <org-id>`                      | List domains for an org |
| `anything domains add app.example.com --project <id>` | Add a custom domain     |
| `anything domains remove <domain-id> --yes`           | Remove a domain         |
| `anything domains verify <domain-id>`                 | Check DNS configuration |

### Deployments

| Command                                    | What it does                         |
| ------------------------------------------ | ------------------------------------ |
| `anything deployments list <id>`           | List a project's deployments         |
| `anything deployments get <deploy-id>`     | View deployment details              |
| `anything deployments logs <deploy-id>`    | View build logs                      |
| `anything deployments rollback <id> --yes` | Roll back to the previous deployment |

### Members

| Command                                                               | What it does                     |
| --------------------------------------------------------------------- | -------------------------------- |
| `anything members list --org <org-id>`                                | List members and pending invites |
| `anything members invite user@email.com --org <org-id> --role editor` | Invite a member                  |
| `anything members remove user@email.com --org <org-id> --yes`         | Remove a member                  |
| `anything members role user@email.com admin --org <org-id>`           | Change a member's role           |

Roles are `owner`, `admin`, `editor`, and `viewer`.

### Assets

| Command                                  | What it does            |
| ---------------------------------------- | ----------------------- |
| `anything assets upload <id> ./logo.png` | Upload an image asset   |
| `anything assets list <id>`              | List a project's assets |
| `anything assets remove <id> <asset-id>` | Remove an asset         |

### Account and context

| Command                      | What it does                                                       |
| ---------------------------- | ------------------------------------------------------------------ |
| `anything user`              | Show your account, org, and credits (`--brief` for the essentials) |
| `anything orgs list`         | List your organizations                                            |
| `anything orgs get <org-id>` | Inspect an organization                                            |
| `anything orgs set <org-id>` | Set the active org                                                 |
| `anything status`            | Show current org, project, user, and auth state                    |
| `anything switch`            | Pick an org or project interactively                               |

### Utility

| Command                     | What it does                                             |
| --------------------------- | -------------------------------------------------------- |
| `anything update`           | Update to the latest published version                   |
| `anything update <version>` | Install or downgrade to a specific version               |
| `anything update --check`   | Report whether an update is available                    |
| `anything link [id]`        | Link the current directory to a project (sets it active) |
| `anything unlink`           | Remove the link from the current directory               |
| `anything pull`             | Pull project files to your machine                       |
| `anything watch <id>`       | Watch a project and stream events                        |
| `anything introspect`       | Print the full command tree as JSON                      |
| `anything skill`            | Print the packaged skill for AI coding agents            |

## Output modes

Every command takes these flags. They're what make the CLI scriptable.

| Flag                | Behavior                                                       |
| ------------------- | -------------------------------------------------------------- |
| `--json`            | Print a structured JSON envelope (see below)                   |
| `--quiet`           | Print only the primary identifier (an ID or URL), for chaining |
| `--dry-run`         | Show the planned actions without running them                  |
| `--non-interactive` | Fail on ambiguity instead of prompting                         |

`--non-interactive` turns on automatically when the CLI detects an agent or CI environment (`CLAUDECODE`, `CODEX`, `CI`, or `OPENCLAW` set). When `--json` and `--quiet` are combined, `--json` wins.

### The JSON envelope

On success, `--json` prints to stdout:

```json theme={null}
{
  "ok": true,
  "command": "projects create",
  "data": { "id": "proj_123", "status": "BUILDING" }
}
```

On failure, the shape is the same but with an error:

```json theme={null}
{
  "ok": false,
  "command": "projects get",
  "error": { "code": "NOT_FOUND", "message": "Project not found" }
}
```

Streaming commands (`ship`, `create`, `generate`, and `publish`) emit one JSON object per line (NDJSON) to stdout. The terminal line is tagged `"type": "result"` and carries the same `command` field as the one-shot envelope, so a stream reader can attribute the result without tracking which command it ran. Even on failure the result stays a single line, parseable by a line-by-line reader:

```json theme={null}
{ "type": "result", "ok": false, "command": "projects generate", "error": { "code": "generation_failed", "message": "..." } }
```

Both success and error JSON go to **stdout**, so `anything ... --json | jq` works whether the command succeeds or fails. Human-readable error text goes to stderr.

### Exit codes

Scripts can branch on the exit code instead of parsing output:

| Code | Meaning                |
| ---- | ---------------------- |
| `0`  | Success                |
| `1`  | Generic error          |
| `2`  | Invalid arguments      |
| `3`  | Not found              |
| `4`  | Authentication failure |
| `5`  | Conflict               |
| `6`  | Timeout                |
| `7`  | Server error           |
| `8`  | Rate limited           |
| `9`  | Credit limit reached   |

### Chaining commands

Use `--quiet` to pass an ID or URL straight into the next command:

```bash theme={null}
PROJECT_ID="$(anything projects create --quiet --prompt 'Build a todo app' --org <org-id>)"
anything projects generate "$PROJECT_ID" --prompt 'Add dark mode' --quiet
PUBLISH_URL="$(anything projects publish "$PROJECT_ID" --quiet)"
echo "Published to: $PUBLISH_URL"
```

<Warning>
  Check the exit code before using a value captured from `--quiet`. On failure, `--quiet` prints the JSON error envelope to stdout, so `PROJECT_ID="$(... --quiet)"` would capture a JSON blob instead of an ID. Branch on `$?` (or the exit codes above) before passing the captured value to the next command.
</Warning>

## Async generation

By default, `create` and `generate` wait for the agent to finish. The wait is heartbeat-based: as long as the server keeps making progress, the CLI keeps waiting, so longer builds don't get cut off (real builds routinely run past five minutes). It gives up only after a stall with no progress, or after a hard 30-minute cap. Real builds typically take 10 to 40 minutes (publish adds roughly 1.5 to 2 minutes, and `pull` can take 8 to 14 minutes), so a long-running build is normal, not hung.

Pass `--no-wait` to return right away instead, then poll:

```bash theme={null}
# Start and return immediately
anything projects create --prompt "Build a CRM" --org <org-id> --no-wait --quiet

# Poll until done
anything projects status <project-id> --json
```

Status values: `CREATED` and `BUILDING` mean it's still working; `VALID` means done; `INVALID` and `INVALID_PROMPT` mean it failed.

<Note>
  `VALID` also covers a chat-only or plan-only turn that made zero file changes, so a `VALID` status alone doesn't guarantee the agent built anything. Before publishing, confirm the last assistant turn with `anything projects messages <id>`; if it's a question or a plan, answer it and generate again.
</Note>

### When the wait runs long

If the wait does time out, it's not a failure. The build keeps running on the server. `create`, `generate`, and `ship` emit a resumable `still_building` result that carries the project ID and a hint telling you how to pick back up:

```json theme={null}
{ "type": "result", "ok": false, "command": "projects create", "error": { "code": "still_building", "projectId": "proj_123", "hint": "Check progress with `anything projects status proj_123`, then publish with `anything projects publish proj_123` once status is VALID." } }
```

So even on a slow build you never lose the project ID. Poll `projects status` until it reads `VALID`, then publish. A genuine `INVALID` or `INVALID_PROMPT` build (or a `generation_failed`) still fails terminally, as you'd expect.

### Recovering from a failed publish

A first publish can fail on a build error in the generated code. The failed-deploy result embeds the build output so you can recover without leaving the terminal:

* **Build error**: read `buildLogs` from the failed result (or `anything deployments logs <deployment-id>`), send the error back as a fix prompt with `anything projects generate <id> --prompt "..."`, then publish again.
* **Transient infra error** (for example a conflict on a first-ever deploy): retry the publish as-is.
* **`INVALID` or `INVALID_PROMPT`**: rephrase the prompt and `generate` again before publishing.

## Using with AI coding agents

The CLI ships a skill file that AI coding agents (Claude Code, Codex, Cursor, OpenClaw) can read to drive Anything for you. Print it with:

```bash theme={null}
anything skill
```

For the full machine-readable command tree, use `anything introspect`.

<Tip>
  For agent and CI workflows, pass `--json` on every command, use `--no-wait` with `projects status` polling, and branch on the exit code. The CLI auto-enables `--non-interactive` in those environments, so commands fail fast instead of hanging on a prompt.
</Tip>

## Updating

The CLI checks for a newer version in the background and tells you when one is out. To update:

```bash theme={null}
anything update
```

It detects how you installed the CLI (npm, pnpm, yarn, or bun) and runs the matching command. Pass a version to pin or downgrade: `anything update 0.1.3`.

The update notice shows up in non-interactive runs too (agents, CI, anything reading the CLI over a pipe), printed as a single plain line to stderr. It never touches stdout, so it won't break a `--json` consumer.

<CardGroup cols={2}>
  <Card title="Agent" icon="wand-magic-sparkles" href="/builder/agent">
    How the agent builds
  </Card>

  <Card title="Controls" icon="sliders" href="/builder/controls">
    The builder interface
  </Card>

  <Card title="Publish" icon="rocket" href="/launch/publish">
    Take your app live
  </Card>

  <Card title="Credits" icon="coins" href="/account/credits">
    How credits work
  </Card>
</CardGroup>
