📚 OpenClaw 怎么更新?
三种方式 + 更新渠道完整指南
OpenClaw 提供三种更新方式,支持 stable/beta/dev 三个发布渠道。
---
<## id="section-0">🔧 方式 1:内置 openclaw update 命令(推荐)</##>
OpenClaw CLI 内置了 `update` 子命令,可自动检测并安装指定渠道的最新版本。
<### id="section-1">基础更新流程</###>
# Step 1: 停止 Gateway(避免更新过程中文件被占用)
openclaw gateway stopStep 2: 执行更新(更新到 stable 最新版)
openclaw update --channel stableStep 3: 重启 Gateway
openclaw gateway startStep 4: 验证更新结果
openclaw --version
openclaw doctor
<### id="section-2">三个发布渠道</###>
切换到 beta 渠道:
openclaw update --channel beta
切换回 stable 渠道:
openclaw update --channel stable
⚠️ 注意:从 beta/dev 降回 stable 实际上是版本降级,`openclaw update --channel stable` 会自动处理,但建议先备份 `~/.openclaw/` 目录。
---
<## id="section-3">📦 方式 2:npm 手动更新(可指定版本)</##>
通过npm 直接管理版本,适合需要锁定特定版本或回滚的场景。
<### id="section-4">更新到最新 stable 版</###>
openclaw gateway stop
npm install -g openclaw@latest
openclaw gateway start
openclaw --version
<### id="section-5">更新到指定版本</###>
# 查看所有可用版本(显示最近 20 个)
npm view openclaw versions --json | python3 -c "import sys,json; v=json.load(sys.stdin); print('\n'.join(v[-20:]))"安装指定版本(以 2026.3.13 为例)
openclaw gateway stop
npm install -g openclaw@2026.3.13
openclaw gateway start
openclaw --version
<### id="section-6">安装 beta 版本</###>
npm install -g openclaw@beta
<### id="section-7">⚠️ 已知问题</###>
---
<## id="section-8">🌿 方式 3:Git 源码更新(开发者)</##>
从源码构建的用户通过 `git pull` 获取最新代码。
# 进入源码目录
cd ~/openclaw # 替换为实际克隆路径停止 Gateway
openclaw gateway stop拉取最新代码(stable 分支)
git fetch origin
git checkout main
git pull origin main安装/更新依赖
npm install重新构建
npm run build重启 Gateway
openclaw gateway start验证
openclaw --version
---
<## id="section-9">📋 更新建议</##>
| 用户类型 | 推荐方式 | 推荐渠道 |
|----------|---------|---------|
| 普通用户 | openclaw update | stable |
| 高级用户 | npm 安装 | stable |
| 开发者 | Git 源码 | main/beta |
| 测试人员 | npm 安装 | beta/dev |
---
📅 2026-03-31 整理
来源:博客园
OCnote 每日新闻 - 追踪 OpenClaw 和 AI 助手领域最新动态