diff --git a/docs/cli/index.md b/docs/cli/index.md index ff822259c61..006964ebf97 100644 --- a/docs/cli/index.md +++ b/docs/cli/index.md @@ -1,103 +1,61 @@ --- -summary: "OpenClaw CLI reference for `openclaw` commands, subcommands, and options" +summary: "OpenClaw CLI index: command list, global flags, and links to per-command pages" read_when: - - Adding or modifying CLI commands or options - - Documenting new command surfaces + - Finding the right `openclaw` subcommand + - Looking up global flags or output styling rules title: "CLI Reference" --- # CLI reference -This page describes the current CLI behavior. If commands change, update this doc. +`openclaw` is the main CLI entry point. Each subcommand has its own dedicated +reference page; this index lists the commands, the global flags, and the +output styling rules that apply across the CLI. ## Command pages -- [`setup`](/cli/setup) -- [`onboard`](/cli/onboard) -- [`configure`](/cli/configure) -- [`config`](/cli/config) -- [`completion`](/cli/completion) -- [`doctor`](/cli/doctor) -- [`dashboard`](/cli/dashboard) -- [`backup`](/cli/backup) -- [`reset`](/cli/reset) -- [`uninstall`](/cli/uninstall) -- [`update`](/cli/update) -- [`message`](/cli/message) -- [`agent`](/cli/agent) -- [`agents`](/cli/agents) -- [`acp`](/cli/acp) -- [`mcp`](/cli/mcp) -- [`status`](/cli/status) -- [`health`](/cli/health) -- [`sessions`](/cli/sessions) -- [`gateway`](/cli/gateway) -- [`logs`](/cli/logs) -- [`system`](/cli/system) -- [`models`](/cli/models) -- [`infer`](/cli/infer) -- [`memory`](/cli/memory) -- [`wiki`](/cli/wiki) -- [`directory`](/cli/directory) -- [`nodes`](/cli/nodes) -- [`devices`](/cli/devices) -- [`node`](/cli/node) -- [`approvals`](/cli/approvals) -- [`sandbox`](/cli/sandbox) -- [`tui`](/cli/tui) -- [`browser`](/cli/browser) -- [`cron`](/cli/cron) -- [`tasks`](/cli/tasks) -- [`flows`](/cli/flows) -- [`dns`](/cli/dns) -- [`docs`](/cli/docs) -- [`hooks`](/cli/hooks) -- [`webhooks`](/cli/webhooks) -- [`pairing`](/cli/pairing) -- [`qr`](/cli/qr) -- [`plugins`](/cli/plugins) (plugin commands) -- [`channels`](/cli/channels) -- [`security`](/cli/security) -- [`secrets`](/cli/secrets) -- [`skills`](/cli/skills) -- [`daemon`](/cli/daemon) (legacy alias for gateway service commands) -- [`clawbot`](/cli/clawbot) (legacy alias namespace) -- [`voicecall`](/cli/voicecall) (plugin; if installed) +| Area | Commands | +| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Setup and onboarding | [`setup`](/cli/setup) · [`onboard`](/cli/onboard) · [`configure`](/cli/configure) · [`config`](/cli/config) · [`completion`](/cli/completion) · [`doctor`](/cli/doctor) · [`dashboard`](/cli/dashboard) | +| Reset and uninstall | [`backup`](/cli/backup) · [`reset`](/cli/reset) · [`uninstall`](/cli/uninstall) · [`update`](/cli/update) | +| Messaging and agents | [`message`](/cli/message) · [`agent`](/cli/agent) · [`agents`](/cli/agents) · [`acp`](/cli/acp) · [`mcp`](/cli/mcp) | +| Health and sessions | [`status`](/cli/status) · [`health`](/cli/health) · [`sessions`](/cli/sessions) | +| Gateway and logs | [`gateway`](/cli/gateway) · [`logs`](/cli/logs) · [`system`](/cli/system) | +| Models and inference | [`models`](/cli/models) · [`infer`](/cli/infer) · [`memory`](/cli/memory) · [`wiki`](/cli/wiki) | +| Network and nodes | [`directory`](/cli/directory) · [`nodes`](/cli/nodes) · [`devices`](/cli/devices) · [`node`](/cli/node) | +| Runtime and sandbox | [`approvals`](/cli/approvals) · [`sandbox`](/cli/sandbox) · [`tui`](/cli/tui) · [`browser`](/cli/browser) | +| Automation | [`cron`](/cli/cron) · [`tasks`](/cli/tasks) · [`flows`](/cli/flows) · [`hooks`](/cli/hooks) · [`webhooks`](/cli/webhooks) | +| Discovery and docs | [`dns`](/cli/dns) · [`docs`](/cli/docs) | +| Pairing and channels | [`pairing`](/cli/pairing) · [`qr`](/cli/qr) · [`channels`](/cli/channels) | +| Security and plugins | [`security`](/cli/security) · [`secrets`](/cli/secrets) · [`skills`](/cli/skills) · [`plugins`](/cli/plugins) | +| Legacy aliases | [`daemon`](/cli/daemon) (gateway service) · [`clawbot`](/cli/clawbot) (namespace) | +| Plugins (optional) | [`voicecall`](/cli/voicecall) (if installed) | ## Global flags -- `--dev`: isolate state under `~/.openclaw-dev` and shift default ports. -- `--profile `: isolate state under `~/.openclaw-`. -- `--container `: target a named container for execution. -- `--no-color`: disable ANSI colors. -- `--update`: shorthand for `openclaw update` (source installs only). -- `-V`, `--version`, `-v`: print version and exit. +| Flag | Purpose | +| ----------------------- | --------------------------------------------------------------------- | +| `--dev` | Isolate state under `~/.openclaw-dev` and shift default ports | +| `--profile ` | Isolate state under `~/.openclaw-` | +| `--container ` | Target a named container for execution | +| `--no-color` | Disable ANSI colors (`NO_COLOR=1` is also respected) | +| `--update` | Shorthand for [`openclaw update`](/cli/update) (source installs only) | +| `-V`, `--version`, `-v` | Print version and exit | -## Output styling +## Output modes -- ANSI colors and progress indicators only render in TTY sessions. -- OSC-8 hyperlinks render as clickable links in supported terminals; otherwise we fall back to plain URLs. +- ANSI colors and progress indicators render only in TTY sessions. +- OSC-8 hyperlinks render as clickable links where supported; otherwise the + CLI falls back to plain URLs. - `--json` (and `--plain` where supported) disables styling for clean output. -- `--no-color` disables ANSI styling; `NO_COLOR=1` is also respected. - Long-running commands show a progress indicator (OSC 9;4 when supported). -## Color palette - -OpenClaw uses a lobster palette for CLI output. - -- `accent` (#FF5A2D): headings, labels, primary highlights. -- `accentBright` (#FF7A3D): command names, emphasis. -- `accentDim` (#D14A22): secondary highlight text. -- `info` (#FF8A5B): informational values. -- `success` (#2FBF71): success states. -- `warn` (#FFB020): warnings, fallbacks, attention. -- `error` (#E23D2D): errors, failures. -- `muted` (#8B7F77): de-emphasis, metadata. - -Palette source of truth: `src/terminal/palette.ts` (the “lobster palette”). +Palette source of truth: `src/terminal/palette.ts`. ## Command tree + + ``` openclaw [--dev] [--profile ] setup @@ -375,1473 +333,33 @@ openclaw [--dev] [--profile ] tui ``` -Note: plugins can add additional top-level commands (for example `openclaw voicecall`). +Plugins can add additional top-level commands (for example `openclaw voicecall`). -## Security - -- `openclaw security audit` — audit config + local state for common security foot-guns. -- `openclaw security audit --deep` — best-effort live Gateway probe. -- `openclaw security audit --fix` — tighten safe defaults and state/config permissions. - -## Secrets - -### `secrets` - -Manage SecretRefs and related runtime/config hygiene. - -Subcommands: - -- `secrets reload` -- `secrets audit` -- `secrets configure` -- `secrets apply --from ` - -`secrets reload` options: - -- `--url`, `--token`, `--timeout`, `--expect-final`, `--json` - -`secrets audit` options: - -- `--check` -- `--allow-exec` -- `--json` - -`secrets configure` options: - -- `--apply` -- `--yes` -- `--providers-only` -- `--skip-provider-setup` -- `--agent ` -- `--allow-exec` -- `--plan-out ` -- `--json` - -`secrets apply --from ` options: - -- `--dry-run` -- `--allow-exec` -- `--json` - -Notes: - -- `reload` is a Gateway RPC and keeps the last-known-good runtime snapshot when resolution fails. -- `audit --check` returns non-zero on findings; unresolved refs use a higher-priority non-zero exit code. -- Dry-run exec checks are skipped by default; use `--allow-exec` to opt in. - -## Plugins - -Manage plugins and their config: - -- `openclaw plugins list` — discover plugins (use `--json` for machine output). -- `openclaw plugins inspect ` — show details for a plugin (`info` is an alias). -- `openclaw plugins install ` — install a plugin (or add a plugin path to `plugins.load.paths`; use `--force` to overwrite an existing install target). -- `openclaw plugins marketplace list ` — list marketplace entries before install. -- `openclaw plugins enable ` / `disable ` — toggle `plugins.entries..enabled`. -- `openclaw plugins doctor` — report plugin load errors. - -Most plugin changes require a gateway restart. See [/plugin](/tools/plugin). - -## Memory - -Vector search over `MEMORY.md` + `memory/*.md`: - -- `openclaw memory status` — show index stats; use `--deep` for vector + embedding readiness checks or `--fix` to repair stale recall/promotion artifacts. -- `openclaw memory index` — reindex memory files. -- `openclaw memory search ""` (or `--query ""`) — semantic search over memory. -- `openclaw memory promote` — rank short-term recalls and optionally append top entries into `MEMORY.md`. - -## Sandbox - -Manage sandbox runtimes for isolated agent execution. See [/cli/sandbox](/cli/sandbox). - -Subcommands: - -- `sandbox list [--browser] [--json]` -- `sandbox recreate [--all] [--session ] [--agent ] [--browser] [--force]` -- `sandbox explain [--session ] [--agent ] [--json]` - -Notes: - -- `sandbox recreate` removes existing runtimes so the next use seeds them again with current config. -- For `ssh` and OpenShell `remote` backends, recreate deletes the canonical remote workspace for the selected scope. + ## Chat slash commands -Chat messages support `/...` commands (text and native). See [/tools/slash-commands](/tools/slash-commands). +Chat messages support `/...` commands. See [slash commands](/tools/slash-commands). Highlights: -- `/status` for quick diagnostics. -- `/trace` for session-scoped plugin trace/debug lines. -- `/config` for persisted config changes. -- `/debug` for runtime-only config overrides (memory, not disk; requires `commands.debug: true`). +- `/status` — quick diagnostics. +- `/trace` — session-scoped plugin trace/debug lines. +- `/config` — persisted config changes. +- `/debug` — runtime-only config overrides (memory, not disk; requires `commands.debug: true`). -## Setup + onboarding +## Usage tracking -### `completion` +`openclaw status --usage` and the Control UI surface provider usage/quota when +OAuth/API credentials are available. Data comes directly from provider usage +endpoints and is normalized to `X% left`. Providers with current usage +windows: Anthropic, GitHub Copilot, Gemini CLI, OpenAI Codex, MiniMax, +Xiaomi, and z.ai. -Generate shell-completion scripts and optionally install them into your shell profile. +See [Usage tracking](/concepts/usage-tracking) for details. -Options: +## Related -- `-s, --shell ` -- `-i, --install` -- `--write-state` -- `-y, --yes` - -Notes: - -- Without `--install` or `--write-state`, `completion` prints the script to stdout. -- `--install` writes an `OpenClaw Completion` block into your shell profile and points it at the cached script under the OpenClaw state directory. - -### `setup` - -Initialize config + workspace. - -Options: - -- `--workspace `: agent workspace path (default `~/.openclaw/workspace`). -- `--wizard`: run onboarding. -- `--non-interactive`: run onboarding without prompts. -- `--mode `: onboard mode. -- `--remote-url `: remote Gateway URL. -- `--remote-token `: remote Gateway token. - -Onboarding auto-runs when any onboarding flags are present (`--non-interactive`, `--mode`, `--remote-url`, `--remote-token`). - -### `onboard` - -Interactive onboarding for gateway, workspace, and skills. - -Options: - -- `--workspace ` -- `--reset` (reset config + credentials + sessions before onboarding) -- `--reset-scope ` (default `config+creds+sessions`; use `full` to also remove workspace) -- `--non-interactive` -- `--mode ` -- `--flow ` (manual is an alias for advanced) -- `--auth-choice ` where `` is one of: - `chutes`, `deepseek-api-key`, `openai-codex`, `openai-api-key`, - `openrouter-api-key`, `kilocode-api-key`, `litellm-api-key`, `ai-gateway-api-key`, - `cloudflare-ai-gateway-api-key`, `moonshot-api-key`, `moonshot-api-key-cn`, - `kimi-code-api-key`, `synthetic-api-key`, `venice-api-key`, `together-api-key`, - `huggingface-api-key`, `apiKey`, `gemini-api-key`, `google-gemini-cli`, `zai-api-key`, - `zai-coding-global`, `zai-coding-cn`, `zai-global`, `zai-cn`, `xiaomi-api-key`, - `minimax-global-oauth`, `minimax-global-api`, `minimax-cn-oauth`, `minimax-cn-api`, - `opencode-zen`, `opencode-go`, `github-copilot`, `copilot-proxy`, `xai-api-key`, - `mistral-api-key`, `volcengine-api-key`, `byteplus-api-key`, `qianfan-api-key`, - `qwen-standard-api-key-cn`, `qwen-standard-api-key`, `qwen-api-key-cn`, `qwen-api-key`, - `modelstudio-standard-api-key-cn`, `modelstudio-standard-api-key`, - `modelstudio-api-key-cn`, `modelstudio-api-key`, `custom-api-key`, `skip` -- Qwen note: `qwen-*` is the canonical auth-choice family. `modelstudio-*` - ids remain accepted as legacy compatibility aliases only. -- `--secret-input-mode ` (default `plaintext`; use `ref` to store provider default env refs instead of plaintext keys) -- `--anthropic-api-key ` -- `--openai-api-key ` -- `--mistral-api-key ` -- `--openrouter-api-key ` -- `--ai-gateway-api-key ` -- `--moonshot-api-key ` -- `--kimi-code-api-key ` -- `--gemini-api-key ` -- `--zai-api-key ` -- `--minimax-api-key ` -- `--opencode-zen-api-key ` -- `--opencode-go-api-key ` -- `--custom-base-url ` (non-interactive; used with `--auth-choice custom-api-key`) -- `--custom-model-id ` (non-interactive; used with `--auth-choice custom-api-key`) -- `--custom-api-key ` (non-interactive; optional; used with `--auth-choice custom-api-key`; falls back to `CUSTOM_API_KEY` when omitted) -- `--custom-provider-id ` (non-interactive; optional custom provider id) -- `--custom-compatibility ` (non-interactive; optional; default `openai`) -- `--gateway-port ` -- `--gateway-bind ` -- `--gateway-auth ` -- `--gateway-token ` -- `--gateway-token-ref-env ` (non-interactive; store `gateway.auth.token` as an env SecretRef; requires that env var to be set; cannot be combined with `--gateway-token`) -- `--gateway-password ` -- `--remote-url ` -- `--remote-token ` -- `--tailscale ` -- `--tailscale-reset-on-exit` -- `--install-daemon` -- `--no-install-daemon` (alias: `--skip-daemon`) -- `--daemon-runtime ` -- `--skip-channels` -- `--skip-skills` -- `--skip-search` -- `--skip-health` -- `--skip-ui` -- `--cloudflare-ai-gateway-account-id ` -- `--cloudflare-ai-gateway-gateway-id ` -- `--node-manager ` (setup/onboarding node manager for skills; pnpm recommended, bun also supported) -- `--json` - -### `configure` - -Interactive configuration wizard (models, channels, skills, gateway). - -Options: - -- `--section
` (repeatable; limit the wizard to specific sections) - -### `config` - -Non-interactive config helpers (get/set/unset/file/schema/validate). Running `openclaw config` with no -subcommand launches the wizard. - -Subcommands: - -- `config get `: print a config value (dot/bracket path). -- `config set`: supports four assignment modes: - - value mode: `config set ` (JSON5-or-string parsing) - - SecretRef builder mode: `config set --ref-provider --ref-source --ref-id ` - - provider builder mode: `config set secrets.providers. --provider-source ...` - - batch mode: `config set --batch-json ''` or `config set --batch-file ` -- `config set --dry-run`: validate assignments without writing `openclaw.json` (exec SecretRef checks are skipped by default). -- `config set --allow-exec --dry-run`: opt in to exec SecretRef dry-run checks (may execute provider commands). -- `config set --dry-run --json`: emit machine-readable dry-run output (checks + completeness signal, operations, refs checked/skipped, errors). -- `config set --strict-json`: require JSON5 parsing for path/value input. `--json` remains a legacy alias for strict parsing outside dry-run output mode. -- `config unset `: remove a value. -- `config file`: print the active config file path. -- `config schema`: print the generated JSON schema for `openclaw.json`, including propagated field `title` / `description` docs metadata across nested object, wildcard, array-item, and composition branches, plus best-effort live plugin/channel schema metadata. -- `config validate`: validate the current config against the schema without starting the gateway. -- `config validate --json`: emit machine-readable JSON output. - -### `doctor` - -Health checks + quick fixes (config + gateway + legacy services). - -Options: - -- `--no-workspace-suggestions`: disable workspace memory hints. -- `--yes`: accept defaults without prompting (headless). -- `--non-interactive`: skip prompts; apply safe migrations only. -- `--deep`: scan system services for extra gateway installs. -- `--repair` (alias: `--fix`): attempt automatic repairs for detected issues. -- `--force`: force repairs even when not strictly needed. -- `--generate-gateway-token`: generate a new gateway auth token. - -### `dashboard` - -Open the Control UI with your current token. - -Options: - -- `--no-open`: print the URL but do not launch a browser - -Notes: - -- For SecretRef-managed gateway tokens, `dashboard` prints or opens a non-tokenized URL instead of exposing the secret in terminal output or browser launch arguments. - -### `update` - -Update the installed CLI. - -Root options: - -- `--json` -- `--no-restart` -- `--dry-run` -- `--channel ` -- `--tag ` -- `--timeout ` -- `--yes` - -Subcommands: - -- `update status` -- `update wizard` - -`update status` options: - -- `--json` -- `--timeout ` - -`update wizard` options: - -- `--timeout ` - -Notes: - -- `openclaw --update` rewrites to `openclaw update`. - -### `backup` - -Create and verify local backup archives for OpenClaw state. - -Subcommands: - -- `backup create` -- `backup verify ` - -`backup create` options: - -- `--output ` -- `--json` -- `--dry-run` -- `--verify` -- `--only-config` -- `--no-include-workspace` - -`backup verify ` options: - -- `--json` - -## Channel helpers - -### `channels` - -Manage chat channel accounts (WhatsApp/Telegram/Discord/Google Chat/Slack/Mattermost (plugin)/Signal/iMessage/Microsoft Teams). - -Subcommands: - -- `channels list`: show configured channels and auth profiles. -- `channels status`: check gateway reachability and channel health (`--probe` runs live per-account probe/audit checks when the gateway is reachable; if not, it falls back to config-only channel summaries. Use `openclaw health` or `openclaw status --deep` for broader gateway health probes). -- Tip: `channels status` prints warnings with suggested fixes when it can detect common misconfigurations (then points you to `openclaw doctor`). -- `channels logs`: show recent channel logs from the gateway log file. -- `channels add`: wizard-style setup when no flags are passed; flags switch to non-interactive mode. - - When adding a non-default account to a channel still using single-account top-level config, OpenClaw promotes account-scoped values into the channel account map before writing the new account. Most channels use `accounts.default`; Matrix can preserve an existing matching named/default target instead. - - Non-interactive `channels add` does not auto-create/upgrade bindings; channel-only bindings continue to match the default account. -- `channels remove`: disable by default; pass `--delete` to remove config entries without prompts. -- `channels login`: interactive channel login (WhatsApp Web only). -- `channels logout`: log out of a channel session (if supported). - -Common options: - -- `--channel `: `whatsapp|telegram|discord|googlechat|slack|mattermost|signal|imessage|msteams` -- `--account `: channel account id (default `default`) -- `--name