高级设置和开发工作流。新用户请先看 concepts/start-getting-started。

三种工作流

工作流适用场景
稳定(推荐)安装 macOS App,让它管理 Gateway
开发(最新)自己运行 Gateway(pnpm gateway:watch),App 附加 Local 模式
定制配置和工作区放在 ~/.openclaw/ 外,repo 更新不影响

定制策略(更新不破坏配置)

  • 配置:~/.openclaw/openclaw.json
  • 工作区:~/.openclaw/workspace(建议设为私有 git repo)
openclaw setup  # 一次性初始化

从源码运行 Gateway

pnpm install
pnpm openclaw setup  # 首次或重置后
pnpm gateway:watch   # 热重载开发模式

gateway:watch 在命名 tmux session 中启动,自动附加到交互终端。

# 从打包 CLI 直接运行
node openclaw.mjs gateway --port 18789 --verbose

凭证存储位置

凭证类型路径
WhatsApp~/.openclaw/credentials/whatsapp/<accountId>/creds.json
Telegram bot tokenconfig/env 或 channels.telegram.tokenFile
Discord bot tokenconfig/env 或 SecretRef
Slack tokensconfig/env
配对白名单~/.openclaw/credentials/<channel>-allowFrom.json
Model auth profiles~/.openclaw/agents/<agentId>/agent/auth-profiles.json
文件密钥(可选)~/.openclaw/secrets.json

Linux systemd 用户服务

# 防止注销时 Gateway 停止
sudo loginctl enable-linger $USER

相关

  • gateway/configuration — Gateway 配置 schema
  • concepts/start-personal-assistant — 个人助手设置