Skip to content

更新

保持 OpenClaw 版本最新。

推荐方式:openclaw update

最快捷的更新方式。它会自动检测安装类型(npm 或 git),拉取最新版本,运行 openclaw doctor,并重启 gateway。

bash
openclaw update

切换发布渠道或指定版本:

bash
openclaw update --channel beta
openclaw update --tag main
openclaw update --dry-run   # 预览变更但不实际应用

关于渠道语义,参见开发渠道

备用方式:重新运行安装脚本

bash
curl -fsSL https://openclaw.ai/install.sh | bash

添加 --no-onboard 可跳过引导向导。源码安装时,追加 --install-method git --no-onboard

备用方式:手动 npm 或 pnpm

bash
npm i -g openclaw@latest
bash
pnpm add -g openclaw@latest

自动更新

自动更新默认关闭。在 ~/.openclaw/openclaw.json 中启用:

json5
{
  update: {
    channel: "stable",
    auto: {
      enabled: true,
      stableDelayHours: 6,
      stableJitterHours: 12,
      betaCheckIntervalHours: 1,
    },
  },
}
渠道行为
stable等待 stableDelayHours,然后在 stableJitterHours 范围内以确定性抖动应用(分散推送)。
betabetaCheckIntervalHours(默认每小时)检查一次,立即应用。
dev不自动应用,使用 openclaw update 手动更新。

Gateway 在启动时也会记录更新提示(用 update.checkOnStart: false 禁用)。

更新后的操作

运行 doctor 检查:

bash
openclaw doctor

迁移配置、审查 DM 策略并检查 gateway 健康状态。详情:Doctor

重启 gateway:

bash
openclaw gateway restart

验证:

bash
openclaw health

版本回滚

固定版本(npm)

bash
npm i -g openclaw@<version>
openclaw doctor
openclaw gateway restart

提示:npm view openclaw version 可查看当前已发布的版本。

固定到某个 commit(源码安装)

bash
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

如果卡住了