mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 08:50:43 +00:00
Keep startup-derived plugin enablement, gateway auth tokens, control UI origins, and owner-display secrets runtime-only instead of persisting them into openclaw.json.
Refuse config writers, mutating update/plugin lifecycle commands, and doctor repair/token generation in Nix mode with agent-first nix-openclaw guidance.
Verification:
- pnpm check
- pnpm build
- pnpm test -- src/config/io.write-config.test.ts src/config/mutate.test.ts src/config/io.owner-display-secret.test.ts src/gateway/server-startup-config.recovery.test.ts src/gateway/startup-auth.test.ts src/gateway/startup-control-ui-origins.test.ts src/cli/plugins-cli.install.test.ts src/cli/plugins-cli.policy.test.ts src/cli/plugins-cli.uninstall.test.ts src/cli/plugins-cli.update.test.ts src/cli/update-cli.test.ts src/auto-reply/reply/commands-plugins.install.test.ts src/auto-reply/reply/commands-plugins.test.ts src/commands/onboarding-plugin-install.test.ts src/commands/doctor.runs-legacy-state-migrations-yes-mode-without.e2e.test.ts src/commands/doctor/shared/codex-route-warnings.test.ts src/commands/doctor/repair-sequencing.test.ts src/agents/auth-profile-runtime-contract.test.ts src/auto-reply/reply/agent-runner-execution.test.ts
- GitHub CI green on 05a2c71b90
Co-authored-by: Codex <noreply@openai.com>
61 lines
2.3 KiB
Markdown
61 lines
2.3 KiB
Markdown
---
|
||
summary: "CLI reference for `openclaw setup` (initialize config + workspace)"
|
||
read_when:
|
||
- You’re doing first-run setup without full CLI onboarding
|
||
- You want to set the default workspace path
|
||
title: "Setup"
|
||
---
|
||
|
||
# `openclaw setup`
|
||
|
||
Initialize `~/.openclaw/openclaw.json` and the agent workspace.
|
||
|
||
<Note>
|
||
`openclaw setup` is for mutable config installs. In Nix mode (`OPENCLAW_NIX_MODE=1`), OpenClaw refuses setup writes because the config file is managed by Nix. Agents should use the first-party [nix-openclaw Quick Start](https://github.com/openclaw/nix-openclaw#quick-start) or the equivalent source config for another Nix package.
|
||
</Note>
|
||
|
||
Related:
|
||
|
||
- Getting started: [Getting started](/start/getting-started)
|
||
- CLI onboarding: [Onboarding (CLI)](/start/wizard)
|
||
|
||
## Examples
|
||
|
||
```bash
|
||
openclaw setup
|
||
openclaw setup --workspace ~/.openclaw/workspace
|
||
openclaw setup --wizard
|
||
openclaw setup --wizard --import-from hermes --import-source ~/.hermes
|
||
openclaw setup --non-interactive --mode remote --remote-url wss://gateway-host:18789 --remote-token <token>
|
||
```
|
||
|
||
## Options
|
||
|
||
- `--workspace <dir>`: agent workspace directory (stored as `agents.defaults.workspace`)
|
||
- `--wizard`: run onboarding
|
||
- `--non-interactive`: run onboarding without prompts
|
||
- `--mode <local|remote>`: onboarding mode
|
||
- `--import-from <provider>`: migration provider to run during onboarding
|
||
- `--import-source <path>`: source agent home for `--import-from`
|
||
- `--import-secrets`: import supported secrets during onboarding migration
|
||
- `--remote-url <url>`: remote Gateway WebSocket URL
|
||
- `--remote-token <token>`: remote Gateway token
|
||
|
||
To run onboarding via setup:
|
||
|
||
```bash
|
||
openclaw setup --wizard
|
||
```
|
||
|
||
Notes:
|
||
|
||
- Plain `openclaw setup` initializes config + workspace without the full onboarding flow.
|
||
- After plain setup, run `openclaw configure` to choose models, channels, Gateway, plugins, skills, or health checks.
|
||
- Onboarding auto-runs when any onboarding flags are present (`--wizard`, `--non-interactive`, `--mode`, `--import-from`, `--import-source`, `--import-secrets`, `--remote-url`, `--remote-token`).
|
||
- If Hermes state is detected, interactive onboarding can offer migration automatically. Import onboarding requires a fresh setup; use [Migrate](/cli/migrate) for dry-run plans, backups, and overwrite mode outside onboarding.
|
||
|
||
## Related
|
||
|
||
- [CLI reference](/cli)
|
||
- [Install overview](/install)
|