openclaw update
安全地更?OpenClaw 并在 stable/beta/dev 频道之间切换?
如果你通过 npm/pnpm 安装(全局安装,无 git 元数据),更新将通过 Updating 中的包管理器流程进行?
用法
openclaw update
openclaw update status
openclaw update wizard
openclaw update --channel beta
openclaw update --channel dev
openclaw update --tag beta
openclaw update --dry-run
openclaw update --no-restart
openclaw update --json
openclaw --update
选项
--no-restart:成功更新后跳过重启网关服务?--channel <stable|beta|dev>:设置更新频道(git + npm;持久化在配置中)?--tag <dist-tag|version>:覆盖此次更新的 npm dist-tag 或版本?--dry-run:预览计划更新操作(频道/标签/目标/重启流程)而不写入配置、安装、同步插件或重启?--json:打印机器可读的UpdateRunResultJSON?--timeout <seconds>:每步超时(默认 1200s)?
注意:降级需要确认,因为旧版本可能破坏配置?
update status
显示活动的更新频?+ git 标签/分支/SHA(用于源代码检出),以及更新可用性?
openclaw update status
openclaw update status --json
openclaw update status --timeout 10
选项?
--json:打印机器可读的状?JSON?--timeout <seconds>:检查超时(默认 3s)?
update wizard
交互式流程以选择更新频道并确认更新后是否重启网关(默认是重启)。如果你在没?git 检出的情况下选择 dev,它会提供创建一个?
它的工作原理
当你明确切换频道时(--channel ...),OpenClaw 也保持安装方式对齐:
dev?确保 git 检出(默认:~/openclaw,用OPENCLAW_GIT_DIR覆盖),更新它,并从该检出安装全局 CLI?stable/beta?使用匹配?dist-tag ?npm 安装?
网关核心自动更新器(通过配置启用时)重用此相同的更新路径?
Git 检出流?
频道?
stable:检出最新的?beta 标签,然后构?+ doctor?beta:检出最新的-beta标签,然后构?+ doctor?dev:检?main,然后获?+ 变基?
高级流程?
- 需要干净的工作树(无未提交的更改)?
- 切换到选定的频道(标签或分支)?
- 获取上游(仅 dev)?
- ?dev:在临时工作树中预检 lint + TypeScript 构建;如果尖端失败,回退最?10 个提交以找到最新的干净构建?
- 变基到选定的提交(?dev)?
- 安装依赖(优?pnpm;npm 回退)?
- 构建 + 构建控制面板?
- 运行
openclaw doctor作为最终的”安全更新”检查? - 同步插件到活动频道(dev 使用捆绑扩展;stable/beta 使用 npm)并更新 npm 安装的插件?
--update 简?
openclaw --update 重写?openclaw update(对 shell 和启动器脚本很有用)?