OpenClawSkills
GitHub
CLI 参考 • 5 分钟阅读

更新

“openclaw update”的 CLI 参考(安全源更新 + 网关自动重启)

安全更新 OpenClaw 并在稳定/测试版/开发频道之间切换。

如果您通过 ''npm/pnpm'' (全局安装,无 git 元数据)安装,更新将通过 ''更新'' 中的包管理器流程进行。

Tutorial.step

用法

Bash
openclaw update
openclaw update status
openclaw update wizard
openclaw update --channel beta
openclaw update --channel dev
openclaw update --tag beta
openclaw update --no-restart
openclaw update --json
openclaw --update
Tutorial.step

选项

- ''--no-restart'':成功更新后跳过重新启动网关服务。

- ''--channel <stable|beta|dev>'': Set update channel (git + npm; persisted in config).

- ''--tag <dist-tag|version>'': Override npm dist-tag or version for this update only.

- ''--json'':打印机器可读的 ''UpdateRunResult'' JSON。

- ''--timeout <seconds>'': Timeout per step (default 1200s).

注意:降级需要确认,因为旧版本可能会破坏配置。

Tutorial.step

`update status`

显示活动更新通道 + git tag/branch/SHA(用于源签出)以及更新可用性。

Bash
openclaw update status
openclaw update status --json
openclaw update status --timeout 10

选项:

- ''--json'':打印机器可读的状态 JSON。

- ''--timeout <seconds>'': Check timeout (default 3s).

Tutorial.step

`update wizard`

选择更新通道并确认是否重启网关的交互流程

更新后(默认是重新启动)。如果您在没有 git checkout 的情况下选择 ''dev'' ,那么它

提议创建一个。

Tutorial.step

它的作用

当您显式切换通道 (''--channel ...'') 时,OpenClaw 还会保留

安装方法对齐:

- ''dev'' → 确保 git checkout (默认值:''~/openclaw'',用 ''OPENCLAW_GIT_DIR'' 覆盖),

更新它,并从该结帐安装全局 CLI。

- ''stable''/''beta'' → 使用匹配的 dist-tag 从 npm 安装。

Tutorial.step

Git 签出流程

渠道:

- ''stable'':检查最新的非测试版标签,然后构建+医生。

- ''beta'':签出最新的''-beta''标签,然后构建+医生。

- ''dev'':签出''main'',然后获取+变基。

高级别:

1. 需要一个干净的工作树(没有未提交的更改)。

2. 切换到选定的通道(标签或分支)。

3. 获取上游(仅限开发)。

4. 仅限开发:在临时工作树中进行预检 lint + TypeScript 构建;如果提示失败,则返回最多 10 个提交以查找最新的干净构建。

5. 变基到选定的提交(仅限开发)。

6. 安装 deps(pnpm 首选;npm 后备)。

7. 构建 + 构建控制 UI。

8. 运行 ''openclaw doctor'' 作为最终"安全更新"检查。

9. 将插件同步到活动通道(开发版使用捆绑扩展;稳定/测试版使用 npm)并更新 npm 安装的插件。

Tutorial.step

`--update` 简写

''openclaw --update'' 重写为 ''openclaw update'' (对于 shell 和启动器脚本有用)。

Tutorial.step

另请参阅

- ''openclaw doctor'' (提供在 git checkouts 上首先运行更新)

- ''发展渠道''

- ''更新''

- ''CLI 参考''