openclaw onboard 是推荐的跨平台引导方式(macOS/Linux/Windows WSL2)。

基本用法

openclaw onboard                    # 交互式引导
openclaw onboard --install-daemon   # 同时安装后台服务
openclaw onboard --non-interactive  # 脚本化(非交互)
openclaw onboard --reset            # 重置配置(保留工作区)
openclaw onboard --reset-scope full # 完全重置(含工作区)

QuickStart vs Advanced

  • QuickStart(默认):本地 Gateway(loopback)、默认工作区、端口 18789、Token Auth(自动生成)、工具策略 coding
  • Advanced(完全控制):暴露所有步骤(模式/工作区/Gateway/Channel/Daemon/Skills)

引导步骤(本地模式)

  1. 模型/Auth — 选择提供商(Anthropic/OpenAI/Google 等),设置 API Key 或 OAuth
  2. 工作区 — 默认 ~/.openclaw/workspace,生成引导文件
  3. Gateway — 端口、绑定地址、Auth 模式(Token/Password)
  4. Channels — Telegram/WhatsApp/Discord/Signal/iMessage 等
  5. Daemon — macOS LaunchAgent / Linux systemd user unit / Windows Scheduled Task
  6. 健康检查
  7. Skills 设置

非交互模式(脚本化)

openclaw onboard --non-interactive \
  --provider anthropic \
  --api-key $ANTHROPIC_API_KEY \
  --secret-input-mode ref \
  --gateway-token-ref-env OPENCLAW_TOKEN

--secret-input-mode ref 将 env-backed refs 存入 auth profiles 而非明文 API Key。

重新配置

openclaw configure
openclaw configure --section web    # 仅配置 web 搜索
openclaw agents add <name>

输出文件

  • 配置:~/.openclaw/openclaw.json
  • 工作区:~/.openclaw/workspace/
  • 凭证:~/.openclaw/credentials/
  • Auth profiles:~/.openclaw/agents/<agentId>/agent/auth-profiles.json

相关

  • concepts/start-onboarding-overview — 引导路径选择
  • concepts/start-bootstrapping — 首次 Agent 运行引导仪式
  • agent-workspace — 工作区文件布局