OpenClaw Docs CN

基础使用 / 命令速查

常用命令速查表

OpenClaw 的 CLI 命令不少,但新手完全没必要一口气全背。真正高频、最能帮你排错和跑通日常使用的,也就十来条。下面这页我按使用场景整理成速查表,你遇到问题时直接回来翻就够了。

先记最重要的一点

命令不是越多越好,而是要知道现在该查什么。如果你平时只会打开控制台、查 Gateway、看状态、看日志、查渠道、跑 doctor,其实已经能处理大部分常见问题。

如果你只背 6 条,我建议先背这组

openclaw dashboard
openclaw gateway status
openclaw status --deep
openclaw channels status --probe
openclaw logs --follow
openclaw doctor

这 6 条组合起来,已经足够覆盖:打开控制台、看服务、看系统、看渠道、看日志、做自检。

最常见的使用顺序

  1. 先开 openclaw dashboard
  2. 有异常就看 openclaw gateway status
  3. 还不清楚就补 openclaw status --deep
  4. 怀疑渠道有问题就跑 openclaw channels status --probe
  5. 想看实时细节就 openclaw logs --follow
  6. 感觉环境本身坏了再上 openclaw doctor

按场景速查,最省时间

一、初始化和配置

openclaw setup
openclaw onboard
openclaw configure
  • setup:更偏初始准备和引导。
  • onboard:首次上手或重新补跑 onboarding 时常用。
  • configure:进入配置流程,适合补改某一块设置。

二、打开控制台

openclaw dashboard

这是最常用的一条。平时想看会话、看控制台、看设备授权、做第一次测试,先从它进。

三、Gateway 生命周期

openclaw gateway status
openclaw gateway restart
openclaw gateway stop
  • gateway status:先看服务是否健康,排障起点。
  • gateway restart:配置调整后常用。
  • gateway stop:明确要停服务时再用。

四、总体状态

openclaw status
openclaw status --all
openclaw status --deep
openclaw status --usage
  • status:看总览。
  • status --deep:查问题时更有价值。
  • status --usage:更偏资源和使用情况。

五、渠道相关

openclaw channels add
openclaw channels status --probe
openclaw channels logs --channel telegram
  • channels add:添加新渠道或新账号的标准入口。
  • status --probe:检查渠道连通性时非常实用。
  • channels logs --channel ...:看某一条渠道自己的日志。

六、日志

openclaw logs --follow

如果你只能记一条排障命令,我会优先推荐这一条。很多“机器人不回复”“模型没回”“渠道掉线”其实看一眼 live log 就明白了。

七、环境自检与修复

openclaw doctor
openclaw doctor --deep
openclaw doctor --repair
  • doctor:先跑基础自检。
  • doctor --deep:需要更详细诊断时再用。
  • doctor --repair:确认要让工具尝试修复时再跑。

八、配对与设备授权

openclaw pairing list <channel>
openclaw pairing approve <channel> <CODE>

openclaw devices list
openclaw devices approve <requestId>

这两组命令分别处理两种完全不同的事:一个是渠道 pairing,一个是浏览器或设备访问控制面时的设备授权,不要混用。

九、主动发消息

openclaw message send --channel <name> --target <dest> --message "hello"

这条命令很适合做出站验证。它不是每天都会用,但在排查“能收不能发”时特别有价值。

十、Skills、Hooks 和 Web 工具

openclaw skills list
openclaw skills list --eligible
openclaw hooks list
openclaw hooks check
openclaw configure --section web

clawhub search "calendar"
clawhub install <skill-slug>
  • skills list --eligible:很适合看当前会话或环境有哪些 Skill 有资格被触发。
  • hooks check:排查 hook 生效问题时会用到。
  • configure --section web:配置 web 工具。
  • clawhub search / install:搜索和安装第三方 Skill 的常用入口。

十一、聊天里的斜杠命令

/status
/new
/reset
/stop

这组命令不在系统终端里跑,而是在聊天会话里直接输入。它们很适合做“当前这段对话”的轻量控制。

什么时候该用哪一组

想确认系统是不是活着 先看 openclaw gateway statusopenclaw status --deep
想确认渠道是不是通的 先看 openclaw channels status --probe,再根据需要看单渠道日志。
想追实时细节 直接开 openclaw logs --follow,不要只盯着网页。
想确认环境本身有没有坏 先跑 openclaw doctor,更复杂再上 --deep--repair

官方参考