360 Secure SkillHub
360 安全技能中心

OpenClaw Self-Update

用于更新 npm 安装的 OpenClaw:比较当前与最新版本,执行全局安装,重启网关,并显示版本/变更摘要;附带自动化脚本与手动排查步骤。

jchen0824
jchen0824
热度 72.40
最近更新 2026-05-17 13:13:43
分类:自动化依赖:代码执行应用场景:DevOps / 自动化脚本 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add openclaw-self-update
Metadata
name
openclaw-self-update
description
Update OpenClaw to the latest version. Use when asked to "update yourself", "upgrade openclaw", "check for updates", or "update to latest version". Handles npm-installed OpenClaw instances.

OpenClaw Self-Update

Update OpenClaw to the latest version via npm.

Quick Update

# Check versions
openclaw --version                    # Current
npm show openclaw version             # Latest

# Update
npm install -g openclaw@latest

# Restart gateway
openclaw gateway restart

# Verify
openclaw --version

Script

For automated updates with version checking:

bash {baseDir}/scripts/update.sh

The script will:

  1. Check if update is available
  2. Install latest version via npm
  3. Restart the gateway
  4. Show changelog summary

Manual Steps

If the script fails:

# 1. Stop gateway
openclaw gateway stop

# 2. Update npm package
npm install -g openclaw@latest

# 3. Start gateway
openclaw gateway start

# 4. Verify
openclaw --version

Troubleshooting

Issue Solution
Permission denied Use sudo npm install -g openclaw@latest
Gateway won't restart Run openclaw gateway stop then openclaw gateway start
npm not found Ensure Node.js is installed and in PATH

Notes

  • openclaw update only works for git installs
  • npm installs require npm install -g openclaw@latest
  • Always restart gateway after update for changes to take effect