OpenClaw常用命令

最近安装了小龙虾OpenClaw,由于工作比较忙,而且公司也不允许部署在公司内部的设备上,也就没怎么用,就平时在上下班的路上聊聊天,问问股票,校对文字内容,总结一下内容等。

OpenClaw很火,所以更新也比较快,那么我们也要掌握一些常用的命令,让我们能用上更新更好的OpenClaw

命令 说明
openclaw --version 查看版本
npm view openclaw version 查看Npm中的版本
pnpm update -g openclaw 升级 OpenClaw
openclaw gateway restart 重启服务
clawhub list 列出技能
clawhub update --all 升级所有技能
clawhub search <query> 搜索技能
clawhub install <skill> 安装技能
clawhub uninstall <skill> 卸载技能
openclaw doctor 系统诊断
openclaw configure 配置向导
openclaw config 操作(增删改)配置
openclaw plugins list 插件列表
openclaw plugins update 插件更新
openclaw cron list 查看定时任务
openclaw agent -m 给智能体发送消息
openclaw message send 给IM发送消息
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
openclaw@ecm-dbc4:~$ pnpm update -g openclaw
Downloading openclaw@2026.3.11: 36.24 MB/36.24 MB, done
 WARN  9 deprecated subdependencies found: are-we-there-yet@2.0.0, gauge@3.0.2, glob@10.5.0, glob@7.2.3, inflight@1.0.6, node-domexception@1.0.0, npmlog@5.0.1, rimraf@3.0.2, tar@6.2.1
Packages: +39 -13
+++++++++++++++++++++++++++++++++++++++-------------
Progress: resolved 779, reused 667, downloaded 35, added 39, done
 WARN  Issues with peer dependencies found
.
└─┬ openclaw 2026.3.11
└─┬ @buape/carbon 0.0.0-beta-20260216184201
└─┬ @discordjs/voice 0.19.0
└─┬ prism-media 1.3.5
└── ✕ unmet peer opusscript@^0.0.8: found 0.1.1

/home/openclaw/.local/share/pnpm/global/5:
- openclaw 2026.3.8
+ openclaw 2026.3.11

╭ Warning ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Ignored build scripts: @discordjs/opus@0.10.0, @whiskeysockets/baileys@7.0.0-rc.9, koffi@2.15.1, node-llama-cpp@3.16.2, protobufjs@6.8.8, │
│ protobufjs@7.5.4, sharp@0.34.5. │
│ Run "pnpm approve-builds -g" to pick which dependencies should be allowed to run scripts. │
│ │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Done in 22.5s using pnpm v10.30.3

升级完之后,我们需要重启服务openclaw gateway restart或者systemctl --user restart openclaw-gateway.service,有的时候,会起不起来,那是新版本有些配置有调整,这时候就需要openclaw doctor来进行迁移和修复,它会自动检查你的环境,修复不一致的状态,并执行必要的配置迁移,确保新版本程序能正确读取你的旧配置

我在OpenClaw 2026.3.2版本升级到2026.3.8版本时就没启动起来,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
openclaw@ecm-dbc4:~$ openclaw doctor

🦞 OpenClaw 2026.3.8 (3caab92) — I've survived more breaking changes than your last three relationships.

▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██░▄▄▄░██░▄▄░██░▄▄▄██░▀██░██░▄▄▀██░████░▄▄▀██░███░██
██░███░██░▀▀░██░▄▄▄██░█░█░██░█████░████░▀▀░██░█░█░██
██░▀▀▀░██░█████░▀▀▀██░██▄░██░▀▀▄██░▀▀░█░██░██▄▀▄▀▄██
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
🦞 OPENCLAW 🦞

┌ OpenClaw doctor

◇ Update ──────────────────────────────────────────────────────────────────────────────────╮
│ │
│ This install is not a git checkout. │
│ Run `openclaw update` to update via your package manager (npm/pnpm), then rerun doctor. │
│ │
├───────────────────────────────────────────────────────────────────────────────────────────╯

◇ Archive 6 orphan transcript file(s) in ~/.openclaw/agents/main/sessions?
│ Yes

◇ State integrity ───────────────────────────────────────────────────────────────────────╮
│ │
│ - OAuth dir not present (~/.openclaw/credentials). Skipping create because no │
│ WhatsApp/pairing channel config is active. │
│ - Found 6 orphan transcript file(s) in ~/.openclaw/agents/main/sessions. They are not │
│ referenced by sessions.json and can consume disk over time. │
│ │
├─────────────────────────────────────────────────────────────────────────────────────────╯

◇ Doctor changes ─────────────────────────────────────────────────────────────╮
│ │
│ - Archived 6 orphan transcript file(s) in ~/.openclaw/agents/main/sessions │
│ │
├──────────────────────────────────────────────────────────────────────────────╯

◇ Gateway runtime ───────────────────────────────────────────────────────────────────────╮
│ │
│ System Node 22+ not found. Install via Homebrew/apt/choco and rerun doctor to migrate │
│ off Bun/version managers. │
│ │
├─────────────────────────────────────────────────────────────────────────────────────────╯

◇ Gateway service config ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

│ - Gateway service embeds OPENCLAW_GATEWAY_TOKEN and should be reinstalled. (Run
│ `openclaw gateway install --force` to remove embedded service token.)
│ - Gateway service uses Node from a version manager; it can break after upgrades.
│ (/home/openclaw/.nvm/versions/node/v24.14.0/bin/node)
│ - System Node 22+ not found; install it before migrating away from version managers.
│ - Gateway service entrypoint does not match the current install.
│ (/home/openclaw/.local/share/pnpm/global/5/.pnpm/openclaw@2026.3.2_@napi-rs+canvas@0.1.95_@types+express@5.0.6_hono@4.12.5_node-llama-cpp@3.16.2/n
│ y.js
│ ->
│ /home/openclaw/.local/share/pnpm/global/5/.pnpm/openclaw@2026.3.8_@discordjs+opus@0.10.0_@napi-rs+canvas@0.1.95_@types+express@5.0.6_hono@4.12.5_n
│ les/openclaw/dist/index.js)

├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

◇ Update gateway service config to the recommended defaults now?
│ Yes

Installed systemd service: /home/openclaw/.config/systemd/user/openclaw-gateway.service
Previous unit backed up to: /home/openclaw/.config/systemd/user/openclaw-gateway.service.bak

◇ Security ───────────────────────────────────────────────────────────────────────────╮
│ │
│ - WARNING: Gateway bound to "lan" (0.0.0.0) (network-accessible). │
│ Ensure your auth credentials are strong and not exposed. │
│ Safer remote access: keep bind loopback and use Tailscale Serve/Funnel or an SSH │
│ tunnel. │
│ Example tunnel: ssh -N -L 18789:127.0.0.1:18789 user@gateway-host │
│ Docs: https://docs.openclaw.ai/gateway/remote │
│ - Run: openclaw security audit --deep │
│ │
├──────────────────────────────────────────────────────────────────────────────────────╯

◇ Skills status ────────────╮
│ │
│ Eligible: 17 │
│ Missing requirements: 48 │
│ Blocked by allowlist: 0 │
│ │
├────────────────────────────╯

◇ Plugins ──────╮
│ │
│ Loaded: 5 │
│ Disabled: 34 │
│ Errors: 0 │
│ │
├────────────────╯



◇ Gateway ──────────────╮
│ │
│ Gateway not running. │
│ │
├────────────────────────╯

◇ Gateway connection ─────────────────────────────╮
│ │
│ Gateway target: ws://127.0.0.1:18789 │
│ Source: local loopback │
│ Config: /home/openclaw/.openclaw/openclaw.json │
│ Bind: lan │
│ │
├──────────────────────────────────────────────────╯

◇ Memory search ───────────────────────────────────────────────────────────────────────────╮
│ │
│ Memory search is enabled but no embedding provider is configured. │
│ Semantic recall will not work without an embedding provider. │
│ │
│ │
│ Fix (pick one): │
│ - Set OPENAI_API_KEY, GEMINI_API_KEY, VOYAGE_API_KEY, or MISTRAL_API_KEY in your │
│ environment │
│ - Configure credentials: openclaw configure --section model │
│ - For local embeddings: configure agents.defaults.memorySearch.provider and local model │
│ path │
│ - To disable: openclaw config set agents.defaults.memorySearch.enabled false │
│ │
│ Verify: openclaw memory status --deep │
│ │
├───────────────────────────────────────────────────────────────────────────────────────────╯

◇ Gateway ──────────────────────────────────────────────────────────────────────────╮
│ │
│ Runtime: running (pid 2547779, state active, sub running, last exit 0, reason 0) │
│ │
├────────────────────────────────────────────────────────────────────────────────────╯

◇ Restart gateway service now?
│ Yes
Restarted systemd service: openclaw-gateway.service



◇ Gateway ──────────────╮
│ │
│ Gateway not running. │
│ │
├────────────────────────╯

◇ Gateway connection ─────────────────────────────╮
│ │
│ Gateway target: ws://127.0.0.1:18789 │
│ Source: local loopback │
│ Config: /home/openclaw/.openclaw/openclaw.json │
│ Bind: lan │
│ │
├──────────────────────────────────────────────────╯
Run "openclaw doctor --fix" to apply changes.

└ Doctor complete.

如果,要还原的话,就用pnpm add -g openclaw@<previous-version>。我今天就从2026.3.2版本升级到2026.3.8,最后到2026.3.11
alt text
alt text
alt text
还有Skill升级和删除,clawhub update --all有时候

有些Skill可能已经在仓库下架了,这时候,会报错就需要手动一个个更新了,或者把那个 Skill删除掉clawhub uninstall tavily-search

1
2
3
4
5
6
openclaw@ecm-dbc4:~$ clawhub uninstall tavily-search

◇ Uninstall tavily-search?
│ Yes
✔ Uninstalled tavily-search

然后安装新版本

1
2
3
4
5
6
7
8
9
10
11
openclaw@ecm-dbc4:~$ clawhub install tavily

⚠️ Warning: "tavily" is flagged as suspicious by VirusTotal Code Insight.
This skill may contain risky patterns (crypto keys, external APIs, eval, etc.)
Review the skill code before use.


◇ Install anyway?
│ Yes
✔ OK. Installed tavily -> /home/openclaw/.openclaw/workspace/skills/tavily

有时候,有些新插件更新了,那么我们也可以根据需求来更新新的插件openclaw plugins update qqbot

1
2
3
4
5
6
7
8
9
10
11
openclaw@ecm-dbc4:~$ openclaw plugins update qqbot
16:50:27 [plugins] plugins.allow is empty; discovered non-bundled plugins may auto-load: qqbot (/home/openclaw/.openclaw/extensions/qqbot/index.ts). Set plugins.allow to explicit trusted ids.
Downloading @sliverp/qqbot@latest…
Extracting /tmp/openclaw-npm-pack-pi5DJm/sliverp-qqbot-1.5.4.tgz…
WARNING: Plugin "qqbot" contains dangerous code patterns: Environment variable access combined with network send — possible credential harvesting (/tmp/openclaw-plugin-7mOoR1/extract/package/src/gateway.ts:140); Shell command execution detected (child_process) (/tmp/openclaw-plugin-7mOoR1/extract/package/src/utils/audio-convert.ts:565); Shell command execution detected (child_process) (/tmp/openclaw-plugin-7mOoR1/extract/package/src/utils/platform.ts:274); Shell command execution detected (child_process) (/tmp/openclaw-plugin-7mOoR1/extract/package/bin/qqbot-cli.js:109)
Installing to /home/openclaw/.openclaw/extensions/qqbot…
Installing plugin dependencies…
Updated qqbot: 1.5.3 -> 1.5.4.
Config overwrite: /home/openclaw/.openclaw/openclaw.json (sha256 c825eeeac9d4745e518d98f5e9defa50fb63636c21ec9c30318325f7e2636f0c -> 051b43bbe581279aca2ad912ebb69c61ff3d0c608f5beac67108f36b0708d151, backup=/home/openclaw/.openclaw/openclaw.json.bak)
Restart the gateway to load plugins.

然后重启一下,让插件生效openclaw gateway restart

1
2
3
4
5
openclaw@ecm-dbc4:~$ openclaw gateway restart

🦞 OpenClaw 2026.3.11 (29dc654) — I'm not AI-powered, I'm AI-possessed. Big difference.

Restarted systemd service: openclaw-gateway.service

给智能体发送消息openclaw agent -m "你说呢" --agent main,一般默然是main,如果有多个Agent的话,就要指定Agent的名字
有时候,可能自己做了定时脚本的任务,需要推送到自己的QQ上, 需要用到openclaw message send发送消息,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
openclaw@ecm-dbc4:~$ openclaw message send --channel qqbot --target qqbot:c2c:A40E6C4CB1C7EB69BB3256BC20DF1F61 --message "Hello from OpenClaw!"

🦞 OpenClaw 2026.3.11 (29dc654) — I can't fix your code taste, but I can fix your build and your backlog.

17:30:34 [plugins] plugins.allow is empty; discovered non-bundled plugins may auto-load: qqbot (/home/openclaw/.openclaw/extensions/qqbot/index.ts). Set plugins.allow to explicit trusted ids.

[qqbot:channel] listAccountIds: ["default"]
[qqbot:channel] resolveAccount: input=default → resolved=default, appId=102909167, enabled=true
[qqbot:channel] listAccountIds: ["default"]
[qqbot:channel] resolveAccount: input=default → resolved=default, appId=102909167, enabled=true
[qqbot] resolveAllowFrom: accountId=undefined, allowFrom=["*"]
[qqbot:channel] sendText called — accountId=undefined, to=qqbot:c2c:A40E6C4CB1C7EB69BB3256BC20DF1F61, replyToId=undefined, text.length=20
[qqbot:channel] sendText text preview: Hello from OpenClaw!
[qqbot:channel] sendText resolved account: id=default, appId=102909167, enabled=true
[qqbot] sendText ctx: {
"to": "qqbot:c2c:A40E6C4CB1C7EB69BB3256BC20DF1F61",
"text": "Hello from OpenClaw!",
"accountId": "default"
}
[qqbot] sendText: 发送主动消息到 qqbot:c2c:A40E6C4CB1C7EB69BB3256BC20DF1F61, 内容长度: 20
[qqbot-api:102909167] >>> POST https://bots.qq.com/app/getAppAccessToken
◒ Sending...[qqbot-api:102909167] <<< Status: 200 OK
[qqbot-api:102909167] <<< Body: {"access_token": "***","expires_in":"4330"}
[qqbot-api:102909167] Token cached, expires at: 2026-03-12T10:42:45.615Z
[2026-03-12T09:30:35.616Z] [qqbot] parseTarget: input=qqbot:c2c:A40E6C4CB1C7EB69BB3256BC20DF1F61
[2026-03-12T09:30:35.616Z] [qqbot] parseTarget: c2c target, user ID=A40E6C4CB1C7EB69BB3256BC20DF1F61
[qqbot] sendText target: {"type":"c2c","id":"A40E6C4CB1C7EB69BB3256BC20DF1F61"}
[qqbot-api] >>> POST https://api.sgroup.qq.com/v2/users/A40E6C4CB1C7EB69BB3256BC20DF1F61/messages (timeout: 30000ms)
◐ Sending....[qqbot-api] <<< Status: 200 OK
[qqbot:channel] sendText result: messageId=ROBOT1.0_XCo569Z7iZtzy0MhiVxFY1MYOk-.xfvIzonQr-jZEIwfGQuwz6TRSCw2T9z.15-1ObwKRx5DteBBgMeAZUHbpw!!, error=none

✅ Sent via QQ Bot. Message ID: ROBOT1.0_XCo569Z7iZtzy0MhiVxFY1MYOk-.xfvIzonQr-jZEIwfGQuwz6TRSCw2T9z.15-1ObwKRx5DteBBgMeAZUHbpw!!

现在QQ Bot支持配置多个机器了。接下来就创建多个Agent和配置多QQ机器人

作者

eyiadmin

发布于

2026-03-12

更新于

2026-03-12

许可协议

评论