2026-02-05 13:46:11 -05:00
---
2026-03-15 21:39:36 -07:00
summary: "Complete reference for CLI setup flow, auth/model setup, outputs, and internals"
2026-02-05 13:46:11 -05:00
read_when:
2026-03-16 05:50:48 +00:00
- You need detailed behavior for openclaw onboard
- You are debugging onboarding results or integrating onboarding clients
2026-03-15 21:39:36 -07:00
title: "CLI Setup Reference"
2026-02-05 13:46:11 -05:00
sidebarTitle: "CLI reference"
---
2026-03-15 21:39:36 -07:00
# CLI Setup Reference
2026-02-05 13:46:11 -05:00
2026-03-16 05:50:48 +00:00
This page is the full reference for `openclaw onboard` .
2026-03-16 19:50:31 -05:00
For the short guide, see [Onboarding (CLI) ](/start/wizard ).
2026-02-05 13:46:11 -05:00
## What the wizard does
Local mode (default) walks you through:
2026-04-04 14:49:42 +09:00
- Model and auth setup (OpenAI Code subscription OAuth, Anthropic Claude CLI or API key, plus MiniMax, GLM, Ollama, Moonshot, StepFun, and AI Gateway options)
2026-02-05 13:46:11 -05:00
- Workspace location and bootstrap files
- Gateway settings (port, bind, auth, tailscale)
2026-04-04 15:13:14 +01:00
- Channels and providers (Telegram, WhatsApp, Discord, Google Chat, Mattermost, Signal, BlueBubbles, and other bundled channel plugins)
2026-04-04 10:49:13 +01:00
- Daemon install (LaunchAgent, systemd user unit, or native Windows Scheduled Task with Startup-folder fallback)
2026-02-05 13:46:11 -05:00
- Health check
- Skills setup
Remote mode configures this machine to connect to a gateway elsewhere.
It does not install or modify anything on the remote host.
## Local flow details
<Steps>
<Step title="Existing config detection">
- If `~/.openclaw/openclaw.json` exists, choose Keep, Modify, or Reset.
- Re-running the wizard does not wipe anything unless you explicitly choose Reset (or pass `--reset` ).
2026-02-26 17:35:55 +01:00
- CLI `--reset` defaults to `config+creds+sessions` ; use `--reset-scope full` to also remove workspace.
2026-02-05 13:46:11 -05:00
- If config is invalid or contains legacy keys, the wizard stops and asks you to run `openclaw doctor` before continuing.
- Reset uses `trash` and offers scopes:
- Config only
- Config + credentials + sessions
- Full reset (also removes workspace)
</Step>
<Step title="Model and auth">
- Full option matrix is in [Auth and model options ](#auth-and-model-options ).
</Step>
<Step title="Workspace">
- Default `~/.openclaw/workspace` (configurable).
- Seeds workspace files needed for first-run bootstrap ritual.
- Workspace layout: [Agent workspace ](/concepts/agent-workspace ).
</Step>
<Step title="Gateway">
- Prompts for port, bind, auth mode, and tailscale exposure.
- Recommended: keep token auth enabled even for loopback so local WS clients must authenticate.
2026-03-15 21:39:36 -07:00
- In token mode, interactive setup offers:
2026-03-05 12:53:56 -06:00
- **Generate/store plaintext token** (default)
- **Use SecretRef** (opt-in)
2026-03-15 21:39:36 -07:00
- In password mode, interactive setup also supports plaintext or SecretRef storage.
2026-03-05 12:53:56 -06:00
- Non-interactive token SecretRef path: `--gateway-token-ref-env <ENV_VAR>` .
2026-03-16 05:50:48 +00:00
- Requires a non-empty env var in the onboarding process environment.
2026-03-05 12:53:56 -06:00
- Cannot be combined with `--gateway-token` .
2026-02-05 13:46:11 -05:00
- Disable auth only if you fully trust every local process.
- Non-loopback binds still require auth.
</Step>
<Step title="Channels">
- [WhatsApp ](/channels/whatsapp ): optional QR login
- [Telegram ](/channels/telegram ): bot token
- [Discord ](/channels/discord ): bot token
- [Google Chat ](/channels/googlechat ): service account JSON + webhook audience
2026-04-04 15:13:14 +01:00
- [Mattermost ](/channels/mattermost ): bot token + base URL
2026-02-05 13:46:11 -05:00
- [Signal ](/channels/signal ): optional `signal-cli` install + account config
- [BlueBubbles ](/channels/bluebubbles ): recommended for iMessage; server URL + password + webhook
- [iMessage ](/channels/imessage ): legacy `imsg` CLI path + DB access
- DM security: default is pairing. First DM sends a code; approve via
`openclaw pairing approve <channel> <code>` or use allowlists.
</Step>
<Step title="Daemon install">
- macOS: LaunchAgent
- Requires logged-in user session; for headless, use a custom LaunchDaemon (not shipped).
- Linux and Windows via WSL2: systemd user unit
- Wizard attempts `loginctl enable-linger <user>` so gateway stays up after logout.
- May prompt for sudo (writes `/var/lib/systemd/linger` ); it tries without sudo first.
2026-04-04 10:49:13 +01:00
- Native Windows: Scheduled Task first
- If task creation is denied, OpenClaw falls back to a per-user Startup-folder login item and starts the gateway immediately.
- Scheduled Tasks remain preferred because they provide better supervisor status.
2026-02-05 13:46:11 -05:00
- Runtime selection: Node (recommended; required for WhatsApp and Telegram). Bun is not recommended.
</Step>
<Step title="Health check">
- Starts gateway (if needed) and runs `openclaw health` .
2026-04-04 18:56:46 +01:00
- `openclaw status --deep` adds the live gateway health probe to status output, including channel probes when supported.
2026-02-05 13:46:11 -05:00
</Step>
<Step title="Skills">
- Reads available skills and checks requirements.
2026-04-04 11:19:11 +01:00
- Lets you choose node manager: npm, pnpm, or bun.
2026-02-05 13:46:11 -05:00
- Installs optional dependencies (some use Homebrew on macOS).
</Step>
<Step title="Finish">
- Summary and next steps, including iOS, Android, and macOS app options.
</Step>
</Steps>
<Note>
If no GUI is detected, the wizard prints SSH port-forward instructions for the Control UI instead of opening a browser.
If Control UI assets are missing, the wizard attempts to build them; fallback is `pnpm ui:build` (auto-installs UI deps).
</Note>
## Remote mode details
Remote mode configures this machine to connect to a gateway elsewhere.
<Info>
Remote mode does not install or modify anything on the remote host.
</Info>
What you set:
- Remote gateway URL (`ws://...` )
- Token if remote gateway auth is required (recommended)
<Note>
- If gateway is loopback-only, use SSH tunneling or a tailnet.
- Discovery hints:
- macOS: Bonjour (`dns-sd` )
- Linux: Avahi (`avahi-browse` )
</Note>
## Auth and model options
<AccordionGroup>
2026-03-03 00:02:25 +00:00
<Accordion title="Anthropic API key">
2026-02-05 13:46:11 -05:00
Uses `ANTHROPIC_API_KEY` if present or prompts for a key, then saves it for daemon use.
</Accordion>
<Accordion title="OpenAI Code subscription (Codex CLI reuse)">
If `~/.codex/auth.json` exists, the wizard can reuse it.
2026-04-04 12:11:37 +01:00
Reused Codex CLI credentials stay managed by Codex CLI; on expiry OpenClaw
re-reads that source first and, when the provider can refresh it, writes
the refreshed credential back to Codex storage instead of taking ownership
itself.
2026-02-05 13:46:11 -05:00
</Accordion>
<Accordion title="OpenAI Code subscription (OAuth)">
Browser flow; paste `code#state` .
2026-03-06 08:01:37 +03:00
Sets `agents.defaults.model` to `openai-codex/gpt-5.4` when model is unset or `openai/*` .
2026-02-05 13:46:11 -05:00
</Accordion>
<Accordion title="OpenAI API key">
2026-02-24 16:26:51 -06:00
Uses `OPENAI_API_KEY` if present or prompts for a key, then stores the credential in auth profiles.
2026-02-05 16:54:44 -05:00
2026-03-21 08:39:50 -07:00
Sets `agents.defaults.model` to `openai/gpt-5.4` when model is unset, `openai/*` , or `openai-codex/*` .
2026-02-05 16:54:44 -05:00
2026-02-05 13:46:11 -05:00
</Accordion>
2026-02-06 22:41:19 -08:00
<Accordion title="xAI (Grok) API key">
Prompts for `XAI_API_KEY` and configures xAI as a model provider.
</Accordion>
2026-03-11 16:31:06 +11:00
<Accordion title="OpenCode">
Prompts for `OPENCODE_API_KEY` (or `OPENCODE_ZEN_API_KEY` ) and lets you choose the Zen or Go catalog.
2026-02-05 13:46:11 -05:00
Setup URL: [opencode.ai/auth ](https://opencode.ai/auth ).
</Accordion>
<Accordion title="API key (generic)">
Stores the key for you.
</Accordion>
<Accordion title="Vercel AI Gateway">
Prompts for `AI_GATEWAY_API_KEY` .
More detail: [Vercel AI Gateway ](/providers/vercel-ai-gateway ).
</Accordion>
<Accordion title="Cloudflare AI Gateway">
Prompts for account ID, gateway ID, and `CLOUDFLARE_AI_GATEWAY_API_KEY` .
More detail: [Cloudflare AI Gateway ](/providers/cloudflare-ai-gateway ).
</Accordion>
2026-03-20 00:04:32 -04:00
<Accordion title="MiniMax">
2026-04-04 12:47:07 +01:00
Config is auto-written. Hosted default is `MiniMax-M2.7` ; API-key setup uses
`minimax/...` , and OAuth setup uses `minimax-portal/...` .
2026-02-05 13:46:11 -05:00
More detail: [MiniMax ](/providers/minimax ).
</Accordion>
2026-04-03 14:53:50 +08:00
<Accordion title="StepFun">
Config is auto-written for StepFun standard or Step Plan on China or global endpoints.
Standard currently includes `step-3.5-flash` , and Step Plan also includes `step-3.5-flash-2603` .
More detail: [StepFun ](/providers/stepfun ).
</Accordion>
2026-02-05 13:46:11 -05:00
<Accordion title="Synthetic (Anthropic-compatible)">
Prompts for `SYNTHETIC_API_KEY` .
More detail: [Synthetic ](/providers/synthetic ).
</Accordion>
2026-03-11 14:00:22 -07:00
<Accordion title="Ollama (Cloud and local open models)">
2026-04-15 19:06:21 +05:30
Prompts for `Cloud + Local` , `Cloud only` , or `Local only` first.
`Cloud only` uses `OLLAMA_API_KEY` with `https://ollama.com` .
The host-backed modes prompt for base URL (default `http://127.0.0.1:11434` ), discover available models, and suggest defaults.
`Cloud + Local` also checks whether that Ollama host is signed in for cloud access.
2026-03-11 14:00:22 -07:00
More detail: [Ollama ](/providers/ollama ).
</Accordion>
2026-02-05 13:46:11 -05:00
<Accordion title="Moonshot and Kimi Coding">
Moonshot (Kimi K2) and Kimi Coding configs are auto-written.
More detail: [Moonshot AI (Kimi + Kimi Coding) ](/providers/moonshot ).
</Accordion>
2026-02-12 03:48:45 +08:00
<Accordion title="Custom provider">
Works with OpenAI-compatible and Anthropic-compatible endpoints.
2026-02-24 22:26:33 -06:00
Interactive onboarding supports the same API key storage choices as other provider API key flows:
- **Paste API key now** (plaintext)
2026-02-25 17:58:10 -06:00
- **Use secret reference** (env ref or configured provider ref, with preflight validation)
2026-02-24 22:26:33 -06:00
2026-02-12 03:48:45 +08:00
Non-interactive flags:
- `--auth-choice custom-api-key`
- `--custom-base-url`
- `--custom-model-id`
- `--custom-api-key` (optional; falls back to `CUSTOM_API_KEY` )
- `--custom-provider-id` (optional)
- `--custom-compatibility <openai|anthropic>` (optional; default `openai` )
</Accordion>
2026-02-05 13:46:11 -05:00
<Accordion title="Skip">
Leaves auth unconfigured.
</Accordion>
</AccordionGroup>
Model behavior:
- Pick default model from detected options, or enter provider and model manually.
2026-04-04 11:30:18 +01:00
- When onboarding starts from a provider auth choice, the model picker prefers
that provider automatically. For Volcengine and BytePlus, the same preference
also matches their coding-plan variants (`volcengine-plan/*` ,
`byteplus-plan/*` ).
- If that preferred-provider filter would be empty, the picker falls back to
the full catalog instead of showing no models.
2026-02-05 13:46:11 -05:00
- Wizard runs a model check and warns if the configured model is unknown or missing auth.
Credential and profile paths:
- Auth profiles (API keys + OAuth): `~/.openclaw/agents/<agentId>/agent/auth-profiles.json`
2026-04-04 07:50:13 +01:00
- Legacy OAuth import: `~/.openclaw/credentials/oauth.json`
2026-02-05 13:46:11 -05:00
2026-03-05 12:53:56 -06:00
Credential storage mode:
2026-02-24 16:26:51 -06:00
2026-03-16 05:50:48 +00:00
- Default onboarding behavior persists API keys as plaintext values in auth profiles.
2026-02-24 22:26:33 -06:00
- `--secret-input-mode ref` enables reference mode instead of plaintext key storage.
2026-03-15 21:39:36 -07:00
In interactive setup, you can choose either:
2026-02-25 17:58:10 -06:00
- environment variable ref (for example `keyRef: { source: "env", provider: "default", id: "OPENAI_API_KEY" }` )
- configured provider ref (`file` or `exec` ) with provider alias + id
2026-02-24 22:26:33 -06:00
- Interactive reference mode runs a fast preflight validation before saving.
2026-03-16 05:50:48 +00:00
- Env refs: validates variable name + non-empty value in the current onboarding environment.
2026-02-25 17:58:10 -06:00
- Provider refs: validates provider config and resolves the requested id.
2026-03-16 05:50:48 +00:00
- If preflight fails, onboarding shows the error and lets you retry.
2026-02-24 22:26:33 -06:00
- In non-interactive mode, `--secret-input-mode ref` is env-backed only.
2026-03-16 05:50:48 +00:00
- Set the provider env var in the onboarding process environment.
- Inline key flags (for example `--openai-api-key` ) require that env var to be set; otherwise onboarding fails fast.
2026-02-25 17:58:10 -06:00
- For custom providers, non-interactive `ref` mode stores `models.providers.<id>.apiKey` as `{ source: "env", provider: "default", id: "CUSTOM_API_KEY" }` .
2026-03-16 05:50:48 +00:00
- In that custom-provider case, `--custom-api-key` requires `CUSTOM_API_KEY` to be set; otherwise onboarding fails fast.
2026-03-15 21:39:36 -07:00
- Gateway auth credentials support plaintext and SecretRef choices in interactive setup:
2026-03-05 12:53:56 -06:00
- Token mode: **Generate/store plaintext token ** (default) or **Use SecretRef ** .
- Password mode: plaintext or SecretRef.
- Non-interactive token SecretRef path: `--gateway-token-ref-env <ENV_VAR>` .
2026-02-24 16:26:51 -06:00
- Existing plaintext setups continue to work unchanged.
2026-02-05 13:46:11 -05:00
<Note>
Headless and server tip: complete OAuth on a machine with a browser, then copy
2026-04-04 07:50:13 +01:00
that agent's `auth-profiles.json` (for example
`~/.openclaw/agents/<agentId>/agent/auth-profiles.json` , or the matching
`$OPENCLAW_STATE_DIR/...` path) to the gateway host. `credentials/oauth.json`
is only a legacy import source.
2026-02-05 13:46:11 -05:00
</Note>
## Outputs and internals
Typical fields in `~/.openclaw/openclaw.json` :
- `agents.defaults.workspace`
- `agents.defaults.model` / `models.providers` (if Minimax chosen)
2026-03-16 05:50:48 +00:00
- `tools.profile` (local onboarding defaults to `"coding"` when unset; existing explicit values are preserved)
2026-02-05 13:46:11 -05:00
- `gateway.*` (mode, bind, auth, tailscale)
2026-03-16 05:50:48 +00:00
- `session.dmScope` (local onboarding defaults this to `per-channel-peer` when unset; existing explicit values are preserved)
2026-03-29 01:47:25 -04:00
- `channels.telegram.botToken` , `channels.discord.token` , `channels.matrix.*` , `channels.signal.*` , `channels.imessage.*`
2026-02-05 13:46:11 -05:00
- Channel allowlists (Slack, Discord, Matrix, Microsoft Teams) when you opt in during prompts (names resolve to IDs when possible)
- `skills.install.nodeManager`
2026-04-04 13:34:02 +01:00
- The `setup --node-manager` flag accepts `npm` , `pnpm` , or `bun` .
- Manual config can still set `skills.install.nodeManager: "yarn"` later.
2026-02-05 13:46:11 -05:00
- `wizard.lastRunAt`
- `wizard.lastRunVersion`
- `wizard.lastRunCommit`
- `wizard.lastRunCommand`
- `wizard.lastRunMode`
`openclaw agents add` writes `agents.list[]` and optional `bindings` .
WhatsApp credentials go under `~/.openclaw/credentials/whatsapp/<accountId>/` .
Sessions are stored under `~/.openclaw/agents/<agentId>/sessions/` .
<Note>
2026-03-15 21:39:36 -07:00
Some channels are delivered as plugins. When selected during setup, the wizard
2026-02-05 13:46:11 -05:00
prompts to install the plugin (npm or local path) before channel configuration.
</Note>
Gateway wizard RPC:
- `wizard.start`
- `wizard.next`
- `wizard.cancel`
- `wizard.status`
Clients (macOS app and Control UI) can render steps without re-implementing onboarding logic.
Signal setup behavior:
- Downloads the appropriate release asset
- Stores it under `~/.openclaw/tools/signal-cli/<version>/`
- Writes `channels.signal.cliPath` in config
- JVM builds require Java 21
- Native builds are used when available
- Windows uses WSL2 and follows Linux signal-cli flow inside WSL
## Related docs
2026-03-16 19:50:31 -05:00
- Onboarding hub: [Onboarding (CLI) ](/start/wizard )
2026-02-05 13:46:11 -05:00
- Automation and scripts: [CLI Automation ](/start/wizard-cli-automation )
2026-03-16 05:50:48 +00:00
- Command reference: [`openclaw onboard` ](/cli/onboard )