更新你的小龙虾 openclaw update —— 官方文档
如需更新诊断信息,请使用 --dry-run 预览计划操作,使用 --json 获取结构化结果,或运行 openclaw update status --json 检查通道和可用性状态。安装程序有独立的 --verbose 标志,但该标志不属于 openclaw update 命令。--channel beta 会优先选择测试版,但当测试版标签缺失或比最新稳定版更旧时,运行时会回退到稳定版/最新版
Keep OpenClaw up to date.
https://docs.openclaw.ai/install/updating#recommended-openclaw-update
Recommended: openclaw
updateThe fastest way to update. It detects your install type (npm or git), fetches the latest version, runs openclaw doctor, and restarts the gateway.
推荐:openclaw更新
最快的更新方式。它会检测您的安装类型(npm或git),获取最新版本,运行openclaw doctor,并重启网关。
openclaw update
To switch channels or target a specific version:
openclaw update --channel beta
openclaw update --channel dev
openclaw update --tag main
openclaw update --dry-run # preview without applying
openclaw update does not accept --verbose. For update diagnostics, use --dry-run to preview the planned actions, --json for structured results, or openclaw update status --json to inspect channel and availability state. The installer has its own --verbose flag, but that flag is not part of openclaw update.--channel beta prefers beta, but the runtime falls back to stable/latest when the beta tag is missing or older than the latest stable release. Use --tag beta if you want the raw npm beta dist-tag for a one-off package update.See Development channels for channel semantics.
openclaw update 不接受 --verbose 参数。如需更新诊断信息,请使用 --dry-run 预览计划操作,使用 --json 获取结构化结果,或运行 openclaw update status --json 检查通道和可用性状态。安装程序有独立的 --verbose 标志,但该标志不属于 openclaw update 命令。
--channel beta 会优先选择测试版,但当测试版标签缺失或比最新稳定版更旧时,运行时会回退到稳定版/最新版。如需使用原始的 npm beta 分发标签进行一次性包更新,请改用 --tag beta。
通道语义详见《开发通道》说明。
Switch between npm and git installsUse channels when you want to change the install type. The updater keeps your state, config, credentials, and workspace in ~/.openclaw; it only changes which OpenClaw code install the CLI and gateway use.
# npm package install -> editable git checkout
openclaw update --channel dev
# git checkout -> npm package install
openclaw update --channel stable
Run with --dry-run first to preview the exact install-mode switch:
openclaw update --channel dev --dry-run
openclaw update --channel stable --dry-run
The dev channel ensures a git checkout, builds it, and installs the global CLI from that checkout. The stable and beta channels use package installs. If the gateway is already installed, openclaw update refreshes the service metadata and restarts it unless you pass --no-restart.
开发频道确保进行git检出,从中构建,并从该检出安装全局CLI。稳定版和测试版频道使用软件包安装。如果网关已经安装,openclaw update将刷新服务元数据并重新启动它,除非您传递--no-restart参数。
Alternative: re-run the installer
curl -fsSL https://openclaw.ai/install.sh | bash
Add --no-onboard to skip onboarding. To force a specific install type through the installer, pass --install-method git --no-onboard or --install-method npm --no-onboard.If openclaw update fails after the npm package install phase, re-run the installer. The installer does not call the old updater; it runs the global package install directly and can recover a partially updated npm install.
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --install-method npm
To pin the recovery to a specific version or dist-tag, add --version:
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --install-method npm --version <version-or-dist-tag>
Alternative: manual npm, pnpm, or bun
npm i -g openclaw@latest
Prefer openclaw update for supervised installs because it can coordinate the package swap with the running Gateway service. If you update manually while a managed Gateway is running, restart the Gateway immediately after the package manager finishes so the old process does not keep serving from replaced package files.When openclaw update manages a global npm install, it installs the target into a temporary npm prefix first, verifies the packaged dist inventory, then swaps the clean package tree into the real global prefix. That avoids npm overlaying a new package onto stale files from the old package. If the install command fails, OpenClaw retries once with --omit=optional. That retry helps hosts where native optional dependencies cannot compile, while keeping the original failure visible if the fallback also fails.
pnpm add -g openclaw@latest
bun add -g openclaw@latest
Advanced npm install topics
Read-only package tree
Hardened systemd units
Disk-space preflight
Auto-updaterThe auto-updater is off by default. Enable it in ~/.openclaw/openclaw.json:
{
update: {
channel: "stable",
auto: {
enabled: true,
stableDelayHours: 6,
stableJitterHours: 12,
betaCheckIntervalHours: 1,
},
},
}
| Channel | Behavior |
|---|---|
stable |
Waits stableDelayHours, then applies with deterministic jitter across stableJitterHours (spread rollout). |
beta |
Checks every betaCheckIntervalHours (default: hourly) and applies immediately. |
dev |
No automatic apply. Use openclaw update manually. |
The gateway also logs an update hint on startup (disable with update.checkOnStart: false). For downgrade or incident recovery, set OPENCLAW_NO_AUTO_UPDATE=1 in the gateway environment to block automatic applies even when update.auto.enabled is configured. Startup update hints can still run unless update.checkOnStart is also disabled.Package-manager updates requested through the live Gateway control-plane handler force a non-deferred, no-cooldown update restart after the package swap. That avoids leaving an old in-memory process around long enough to lazy-load chunks from a package tree that has already been replaced. Shell openclaw update remains the preferred path for supervised installs because it can stop and restart the service around the update.
After updating
1
Run doctor
2
openclaw doctor
3
Migrates config, audits DM policies, and checks gateway health. Details: Doctor
4
Restart the gateway
5
openclaw gateway restart
6
Verify
7
openclaw health
Rollback
Pin a version (npm)
npm i -g openclaw@<version>
openclaw doctor
openclaw gateway restart
npm view openclaw version shows the current published version.
Pin a commit (source)
git fetch origin
git checkout "$(git rev-list -n 1 --before=\"2026-01-01\" origin/main)"
pnpm install && pnpm build
openclaw gateway restart
To return to latest: git checkout main && git pull.
If you are stuck
- Run
openclaw doctoragain and read the output carefully. - For
openclaw update --channel devon source checkouts, the updater auto-bootstrapspnpmwhen needed. If you see a pnpm/corepack bootstrap error, installpnpmmanually (or re-enablecorepack) and rerun the update. - Check: Troubleshooting
- Ask in Discord: https://discord.gg/clawd
Related
- Install overview: all installation methods.
- Doctor: health checks after updates.
- Migrating: major version migration guides.
---
更多推荐




所有评论(0)