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

# Command Reference

> The core unbound commands and flags, with defaults, constraints and exit codes

The core CLI commands, with exact flag spellings. The task-oriented pages explain *when* to use these; this page is the lookup. The `oacb` family has its own page — see [OACB](https://docs.getunbound.ai/cli/oacb).

All long flags take **two** dashes. `-o`, `-y`, `-m` and `-c` are the only short flags in the CLI.

## Global

```bash theme={null}
unbound [--version] [--help] <command> [subcommand] [options]
```

Binaries are `unbound` and `unbound-cli` — the same program. Requires Node 18 or later.

## Account

| Command | Flags |
| - | - |
| `unbound login` | `--role <name>` · `--permissions <list>` · `--expires-in-days <n>` · `--api-key <token>` · `--gateway-url <url>` · `--frontend-url <url>` · `--backend-url <url>` · `--domain <domain>` |
| `unbound logout` | none - removes the login token, keeps your URL settings and the device key |
| `unbound status` | `--json` |

Omit `--api-key` on login and a browser opens instead. That flow times out after 120 seconds, so pass `--api-key` on a headless machine. `login --api-key` takes a token from **Settings → API Tokens**; the `--api-key` on `setup`, `onboard` and `discover` takes a device or admin key instead. The three scope flags narrow the browser login - see [Authentication](https://docs.getunbound.ai/cli/authentication.md#scoped-login).

## Health

| Command | Flags |
| - | - |
| `unbound doctor` | `--fix` · `--json` |

`doctor` exits non-zero when a tool is tampered, your API key is invalid, **or** `CLAUDE_CONFIG_DIR` is set-but-empty or points somewhere other than your install. The last two fail the run **with every tool healthy** — see [Doctor](https://docs.getunbound.ai/cli/doctor.md).

## Setup

| Command | Flags |
| - | - |
| `unbound setup [tools...]` | `--api-key <key>` · `--clear` · `--subscription` · `--gateway` · `--all` · `--backfill` |
| `unbound nuke` *(alias `uninstall`)* | `-y, --yes` |
| `unbound onboard` | `--api-key <key>` · `--domain <url>` · `--set-cron` · `--backfill` |
| `unbound onboard unschedule` | none |

**Tool names.** `cursor`, `copilot`, `augment`, `pi`, `claude-code`, `claude-code-subscription`, `claude-code-gateway`, `gemini-cli`, `codex`, `codex-subscription`, `codex-gateway`, `roo-code`, `cline`, `kilo-code`, `custom-access`.

**Constraints.** `--subscription` and `--gateway` are mutually exclusive and apply only to Claude Code and Codex. `--all` cannot be combined with explicit tool names. Scope follows privileges — there is no scope flag; run under `sudo` for org-wide.

> [!NOTE]
>
> `unbound setup` needs **Python 3 on your `PATH`**. Without it, setup exits with `Python 3 not found`. Instruction-only tools — `roo-code`, `cline`, `kilo-code`, `custom-access` — don't need it.

## Policies

| Command | Flags |
| - | - |
| `unbound policy list` | `--type <COST\|SECURITY>` · `--enabled` · `--search <term>` · `--json` |
| `unbound policy get <id>` | `--json` |
| `unbound policy delete <id>` | `--yes` — **no `--json`** |
| `unbound policy form-data` | `--json` |
| `unbound policy effective <id>` | `--user` · `--group` · `--json` |

`--user` and `--group` are **booleans**; `<id>` is a required positional. `--group` treats the id as a user-group id, `--user` is the default.

There is also a raw-config pair, `unbound policy create` and `unbound policy update <id>`, taking `--name`, `--type <COST|SECURITY>` and `--config <json>` (all three required on create) plus `--scope-groups <ids>`, `--scope-tools <types>`, `--priority <n>` and `--enabled` / `--no-enabled`. Prefer the type-specific commands below — the CLI's own help says so.

### Cost and security

| Command | Flags |
| - | - |
| `policy cost create` | `--name` *(required)* · `--monthly-budget <amount>` · `--group` · `--priority` · `--disabled` · `--config` · `--json` |
| `policy cost update <id>` | as create, plus `--enabled` / `--disabled` |
| `policy security create` | `--name` *(required)* · `--sub-type <guardrails\|default-routing\|error-code-routing>` · `--guardrail <name:action[:threshold]>` · `--route-model` · `--route <src:tgt>` · `--error-route <code:src:tgt>` · `--group` · `--priority` · `--disabled` · `--config` · `--json` |
| `policy security update <id>` | `--name` · `--group` · `--priority` · `--enabled` / `--disabled` · `--config` · `--json` |

`--guardrail`, `--route` and `--error-route` are repeatable. **`policy security update` does not accept the create-time type flags** — guardrail and routing changes go through `--config '<json>'`.

### Tool policies

| Command | Flags |
| - | - |
| `policy tool list` | `--type <TERMINAL\|MCP>` · `--search` · `--page` · `--page-size` · `--all` · `--json` |
| `policy tool get <id>` | `--json` |
| `policy tool delete <id>` | `--yes` |
| `policy tool create-terminal` | `--prompt <text>` **XOR** `--no-ai` · `--name` · `--command-family` · `--field <key=pattern>` · `--action` · `--description` · `--custom-message` · `--group` · `--disabled` · `--config` · `--yes` · `--json` |
| `policy tool create-mcp` | `--prompt` **XOR** `--no-ai` · `--name` · `--mcp-server` · `--mcp-tool` **XOR** `--mcp-action-type` · `--action` · plus the same shared flags |
| `policy tool update <id>` | `--name` · `--description` · `--action` · `--custom-message` · `--group` · `--enabled` / `--disabled` · type-specific match flags · `--config` · `--json` |
| `policy tool families` | `--json` |
| `policy tool mcp-servers` | `--json` |

**Both create commands require a mode.** Pass `--prompt` for AI assist or `--no-ai` for raw flags; with neither the command exits `2`. `--field` is repeatable and ANDed. `--action` is one of `AUDIT`, `BLOCK`, `WARN`, `REQUIRE_SLACK_APPROVAL`, and **`BLOCK` or `WARN` always requires `--custom-message`**.

## Users and groups

| Command | Flags |
| - | - |
| `unbound users list` | `--json` |
| `unbound users effective-policies <user-id>` | `--json` |
| `unbound user-groups list` *(alias `groups`)* | `--search <term>` · `--json` |
| `unbound user-groups get <id>` | `--json` |
| `unbound user-groups create` | `--name` *(required)* · `--all-org-users` / `--no-all-org-users` · `--user-ids <ids>` — **no `--json`** |
| `unbound user-groups update <id>` | same set — **no `--json`** |
| `unbound user-groups delete <id>` | `--yes` — **no `--json`** |
| `unbound user-groups effective-policies <id>` | `--json` |
| `unbound tools list` | `--json` |
| `unbound tools connect <tool-type>` | `--json` |
| `unbound tools approved` | `--json` |

> [!WARNING]
>
> `--user-ids` takes **numeric** ids, as shown in the `ID` column of `unbound users list`. A non-numeric value is silently dropped rather than rejected, so the member simply doesn't get added.
>
> `unbound tools connect <TOOL_TYPE>` prints the newly generated API key in plaintext. Redact it before pasting that output anywhere.

## Analytics and exports

| Command | Flags |
| - | - |
| `unbound analytics tool-use <dataset>` | see below |
| `unbound download kinds` | `--json` |
| `unbound download start <kind>` | `--last <window>` · `--start` · `--end` · `--search` · `--filter <key=value>` · `-o <file>` · `--check` · `--json` · `--no-wait` |
| `unbound download get <job-id>` | `-o <file>` |

Datasets: `terminal`, `mcp-actions`, `unsanctioned`, `mcp-servers`.

Shared flags: `--time-window` · `--start` / `--end` · `--tool` · `--user` · `--risk` · `--policy` · `--format <table\|json\|csv>` · `--json` · `-o` · `--limit` · `--offset` · `--wide`.

Per-dataset flags — this is the part that surprises people:

| Dataset | `--family` | `--server` | `--initiator` |
| - | :-: | :-: | :-: |
| `terminal` | | — | |
| `mcp-actions` | — | | |
| `unsanctioned` | — | | — |
| `mcp-servers` | — | | — |

Passing one where it isn't accepted fails with `unknown option`.

**Limits.** `--limit` defaults to 20, caps at 100 for a table and 1,000 for JSON, and **over the cap the command exits rather than clamping**. `-o` requires `--format json` or `--format csv`. Custom date ranges must be used in pairs and span 90 days or less. Exports cap at 25,000 rows and are kept for 6 hours.

Both need **Analytics · View**; the Logs and Tasks exports also need **Logs · View**.

## Flags and traces

| Command | Flags |
| - | - |
| `unbound flags terminal` | `--action <block,approval,warn,audit>` · `--policy` · `--trace` · `--tool` · `--family` · `--page` · `--json` · `--wide` |
| `unbound flags terminal mark-fp <id>` | `--risk-score <1-10>` *(required)* · `--comment` · `--json` |
| `unbound flags data-security` | `--guardrail <names>` · `--action <block,redact,route,audit>` · `--findings <real\|false-positive\|all>` · `--trace` · `--reveal` · `--page` · `--json` · `--wide` |
| `unbound flags data-security mark-fp <action-id>` | `--json` |
| `unbound trace <trace-id>` | `--reveal` · `--json` · `--wide` |

Both list commands also take `--time-window` and `--start` / `--end`. Listing needs **Analytics · View**, `--reveal` also needs **Logs · View**, and `mark-fp` needs **Analytics · Edit**. See [Flags and Traces](https://docs.getunbound.ai/cli/flags.md).

## Chat

| Command | Flags |
| - | - |
| `unbound chat` | `-m, --message <text>` · `--json` · `-o, --output <path>` · `-c, --continue <conversation_id>` |

No flags starts an interactive session. `--json`, `-o` and `-c` each require a non-empty `-m`. `-c` takes the `conversation_id` from a previous reply. Messages cap at 4,000 characters. Needs **Logs · View**.

## Discovery

| Command | Flags |
| - | - |
| `unbound discover` | `--api-key <key>` *(required)* · `--domain <url>` · `--set-cron` |
| `unbound discover unschedule` | none |
| `unbound discover status` | none — **macOS only** |

On Linux use `systemctl --user status unbound-scheduled.timer`, or on systems with no systemd user session (WSL2, containers, headless) the crontab fallback `crontab -l | grep 'ai.getunbound.scheduled'`; on Windows `Get-ScheduledTask -TaskName "ai.getunbound.scheduled"`.

## Configuration

| Command | Flags |
| - | - |
| `unbound config urls <gateway> <frontend> <backend>` | three required positionals, fixed order |
| `unbound config set-backend-url <url>` | none |
| `unbound config set-frontend-url <url>` | none |
| `unbound config set-gateway-url <url>` | none |
| `unbound config show` | `--json` |

Settings live in `~/.unbound`. The directory and the files holding credentials are created readable by your account only.

| File | Contents |
| - | - |
| `config.json` | The device key the installed hooks use, your email and organization name, and the Unbound URLs the CLI talks to. The login token lives in the OS keychain |
| `identity.json` | This machine's cached serial number, shared with the installed hooks |
| `update-check.json` | The cached result of the daily version check |
| `scheduled-creds.json` | Linux only: the API key a scheduled scan runs with |

These are the CLI's own files. The discovery scan and the installed hooks keep their state in the same directory — see [Discovery](https://docs.getunbound.ai/cli/discovery.md).

`unbound logout` removes the login token from the keychain, clears `email` and `org_name`, and keeps the URLs and the device key. `unbound nuke` removes the login token from the keychain, deletes `config.json`, and tears down the scheduled scan and the key it runs with (`scheduled-creds.json` on Linux, Keychain / Credential Manager elsewhere); `identity.json` and `update-check.json` are left in place. Under `sudo` the keychain reached is root's, so run `unbound logout` without `sudo` afterwards to remove your own token.

> [!WARNING]
>
> If you clone or image a machine, delete `identity.json` first — otherwise every clone reports as the same device.

The CLI checks for a newer version at most once a day and tells you on stderr if there is one. It never blocks the command you ran, it does not run in CI, and `UNBOUND_NO_UPDATE_CHECK` turns it off everywhere.

**Crash reporting is off.** The CLI reports its own crashes only if you set `UNBOUND_CLI_SENTRY_DSN` yourself; nothing in the CLI sets it, and while it is unset nothing is sent. Where you do turn it on, API keys, key-shaped tokens, your home directory, your username and your hostname are all stripped before anything leaves the machine, and `UNBOUND_TELEMETRY=0` turns it off again.

### Environment variables

| Variable | Effect |
| - | - |
| `UNBOUND_API_URL` | Sets the **backend** URL — despite the name, not the gateway |
| `UNBOUND_FRONTEND_URL` | Sets the frontend URL |
| `UNBOUND_GATEWAY_URL` | Sets the gateway URL |
| `UNBOUND_API_KEY` | Fallback API key for `onboard` |
| `UNBOUND_TOKEN` | A token from **Settings → API Tokens**, used when the keychain holds no login. The way to authenticate in CI, for example with `unbound pack` |
| `CLAUDE_CONFIG_DIR` | Where Claude Code hooks are installed and verified. Set-but-empty is a hard failure |
| `UNBOUND_NO_UPDATE_CHECK` | Any value disables the update check |
| `UNBOUND_TELEMETRY` | Set to `0`, `false` or `no` to disable crash reporting (which is off anyway unless `UNBOUND_CLI_SENTRY_DSN` is set) |
| `UNBOUND_DEBUG` | Any non-empty value prints why a device serial could not be read, to stderr |
| `UNBOUND_ALLOW_NO_AI_UNDER_CLAUDE` | Set to `1` to allow `--no-ai` on `policy tool create-*` inside Claude Code — see [Policies](https://docs.getunbound.ai/cli/policies.md) |
| `COLUMNS` | Table width when output is piped or redirected and the terminal width is unknown. Defaults to 120 |
| `NO_COLOR` | Disables coloured output |

> [!WARNING]
>
> The three URL variables **override anything in the config file**, silently. If a command reaches the wrong host after you ran `unbound config urls`, check these first — a stale export from an earlier shell shadows the file. `unbound config show` prints what's actually in effect.

## Exit codes

| Code | Meaning |
| - | - |
| `0` | Success, or a confirmation you declined |
| `1` | General failure — invalid input, network, not logged in, a permission error, or a failed operation |
| `1` | `pack diff` only: the org differs from the pack files (drift). Every other failure of `pack diff` is `2` |
| `2` | `policy tool create-terminal` / `create-mcp` only: validation or steering error, such as a missing mode flag or a prompt over 1,800 characters. `pack` commands: a pack file failed validation; for `pack diff`, any error at all |
| `3` | `policy tool create-terminal` / `create-mcp` only: not logged in, or the role lacks Policies · Edit. Every other command reports these as `1` |
| `4` | Transient backend failure on `policy tool create-terminal` / `create-mcp` — the backend could not be reached, or answered `5xx`. Retry, or fall back to `--no-ai` flag-based creation |
| `130` | Interrupted with Ctrl-C |

`unbound oacb` subcommands exit `1` on failure; see [OACB](https://docs.getunbound.ai/cli/oacb).

The direct installers `unbound setup` calls also use `3`, but there it means the device is MDM-managed and the install was skipped. `unbound setup` reports that as a skip rather than passing the code through.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.