




OpenClaw 发展迅速(尚未到”1.0”)。将更新视为发布基础设施:更新 → 运行检查 → 重启(或使用会重启的openclaw update)→ 验证。
首选的更新路径是重新运行网站上的安装程序。它会检测现有安装、原地升级,并在需要时运行openclaw doctor。
curl -fsSL https://openclaw.ai/install.sh | bash
说明:
如果你不想再次运行新手引导向导,添加--no-onboard。
对于源码安装,使用:
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --install-method git --no-onboard
安装程序仅在仓库干净时才会执行git pull --rebase。
对于全局安装,脚本底层使用npm install -g openclaw@latest。
旧版说明:clawdbot仍可作为兼容性垫片使用。
~/.openclaw/openclaw.json~/.openclaw/credentials/~/.openclaw/workspace全局安装(选择一个):
pnpm add -g openclaw@latest
我们不推荐将 Bun 用于 Gateway 网关运行时(WhatsApp/Telegram 有 bug)。 切换更新渠道(git + npm 安装):
openclaw update --channel beta openclaw update --channel dev openclaw update --channel stable
使用--tag <dist-tag|version进行一次性安装指定标签/版本。 渠道语义和发布说明参见开发渠道。 注意:在 npm 安装上,Gateway 网关在启动时会记录更新提示(检查当前渠道标签)。通过update.checkOnStart: false禁用。 然后:
openclaw doctor openclaw gateway restart openclaw health
说明:
openclaw gateway restart优于杀死 PID。openclaw update)对于源码安装(git checkout),首选:
它运行一个相对安全的更新流程:
openclaw doctor。--no-restart跳过)。如果你通过npm/pnpm安装(没有 git 元数据),openclaw update将尝试通过你的包管理器更新。如果无法检测到安装,请改用”更新(全局安装)“。
控制 UI 有更新并重启(RPC:update.run)。它:
openclaw update相同的源码更新流程(仅限 git checkout)。如果 rebase 失败,Gateway 网关会中止并在不应用更新的情况下重启。
从仓库 checkout: 首选:
手动(大致等效):
git pull pnpm install pnpm build pnpm ui:build # 首次运行时自动安装 UI 依赖 openclaw doctor openclaw health
说明:
openclaw二进制文件(openclaw.mjs)或使用 Node 运行dist/时,pnpm build很重要。pnpm openclaw ...。pnpm openclaw ...),通常不需要重新构建,但配置迁移仍然适用→ 运行 doctor。openclaw doctor以便将 Gateway 网关服务入口点重写为当前安装。openclaw doctorDoctor 是”安全更新”命令。它故意很无聊:修复 + 迁移 + 警告。 注意:如果你是源码安装(git checkout),openclaw doctor会提供先运行openclaw update。 它通常做的事情:
详情:Doctor
CLI(无论操作系统都适用):
openclaw gateway status openclaw gateway stop openclaw gateway restart openclaw gateway --port 18789 openclaw logs --follow
如果你使用受管理服务:
launchctl kickstart -k gui/$UID/bot.molt.gateway(使用bot.molt.<profile;旧版com.openclaw.*仍然有效)systemctl --user restart openclaw-gateway[-<profile].servicesystemctl --user restart openclaw-gateway[-<profile].servicelaunchctl/systemctl仅在服务已安装时有效;否则运行openclaw gateway install。运行手册 + 确切的服务标签:Gateway 网关运行手册
安装已知良好的版本(将<version替换为最后可用的版本):
npm i -g openclaw@<version
pnpm add -g openclaw@<version
提示:要查看当前发布的版本,运行npm view openclaw version。 然后重启 + 重新运行 doctor:
openclaw doctor openclaw gateway restart
选择某个日期的提交(示例:“2026-01-01 时 main 的状态”):
git fetch origin git checkout "$(git rev-list -n 1 --before=\"2026-01-01\" origin/main)"
然后重新安装依赖 + 重启:
pnpm install pnpm build openclaw gateway restart
如果你之后想回到最新版本:
git checkout main git pull
openclaw doctor并仔细阅读输出(它通常会告诉你修复方法)。