OpenClaw 处于 1.0 版本之前的开发阶段,更新频繁。更新应该被视为基础设施变更:更新、运行检查、重启(或使用 openclaw update),然后验证功能。
主要更新方法:网站安装器
推荐的方法是重新运行安装器,它会检测现有安装并就地升级,同时自动运行 openclaw doctor。
curl -fsSL https://openclaw.ai/install.sh | bash
选项:
- 添加
--no-onboard在后续运行时跳过引导向导 - 对于源码安装:添加
--install-method git --no-onboard - 对于全局安装,脚本使用
npm install -g openclaw@latest
更新前准备
更新前,请确认:
- 安装类型:全局(npm/pnpm)或源码(git clone)
- Gateway 运行环境:前台终端或受监管的服务(launchd/systemd)
- 备份位于
~/.openclaw/的配置、凭证和工作区文件
全局安装更新
更新命令:
npm i -g openclaw@latest
或
pnpm add -g openclaw@latest
由于现有 bug,不建议使用 Bun 运行 Gateway。
切换更新频道:
openclaw update --channel beta/dev/stable
更新后验证:
openclaw doctor
openclaw gateway restart
openclaw health
源码安装更新
推荐方法:
openclaw update
此命令执行安全的更新工作流:验证干净的工作树、切换频道、获取并变基代码、安装依赖、构建应用程序和 Control UI、运行诊断,并默认重启 gateway。
手动替代方法:
git pull
pnpm install
pnpm build
pnpm ui:build
openclaw doctor
openclaw health
Control UI 更新选项
Control UI 提供"更新并重启"功能(RPC: update.run),它执行源码更新流程、生成结构化的重启报告,并将结果通知活动会话。如果变基失败,gateway 会中止更新并在不做更改的情况下重启。
Doctor 命令
"Doctor 是'安全更新'命令",它负责修复、迁移和警告。它处理配置迁移、审核安全策略、检查 gateway 健康状态、检测旧版服务,并确保 Linux systemd 用户驻留。
Gateway 管理
CLI 命令:
openclaw gateway status
openclaw gateway stop
openclaw gateway restart
openclaw gateway --port 18789
openclaw logs --follow
服务重启(特定于操作系统):
- macOS:
launchctl kickstart -k gui/$UID/bot.molt.gateway - Linux:
systemctl --user restart openclaw-gateway.service - Windows (WSL2):
systemctl --user restart openclaw-gateway.service
回滚步骤
对于全局安装:
npm i -g openclaw@<version>
openclaw doctor
openclaw gateway restart
对于源码安装(按日期):
git fetch origin
git checkout "$(git rev-list -n 1 --before=\"YYYY-MM-DD\" origin/main)"
pnpm install
pnpm build
openclaw gateway restart
故障排除
如果出现问题,运行 openclaw doctor 并仔细查看其输出。查看故障排除文档,或在 Discord 社区 https://discord.gg/clawd 寻求帮助。
提示
更多详细信息请访问 官方英文文档。