一句话定义
- 这一组命令负责把 OpenClaw 跑起来、看它是否健康、看日志、排查故障,以及打开控制界面。
解决的问题
- Gateway 有没有启动成功
- Gateway 只是“进程活着”,还是 RPC 真的可用
- 当前 channels / sessions / usage 状态如何
- 出问题时该先看哪里、先跑什么命令
核心机制
gateway是当前版本的服务管理主入口。status / health / logs / doctor是最常用的排错闭环。dashboard / tui / docs分别对应可视化控制台、终端交互界面、文档检索。tui 别名有 terminal 和 chat;tui 现在支持 --local、--message、--session、--thinking、--timeout-ms、--deliver、--url、--token、--password。daemon仍存在,但属于 legacy alias,文档与日常习惯上优先用gateway。
关键组成
1. Gateway 服务命令
openclaw gateway status
openclaw gateway start
openclaw gateway stop
openclaw gateway restart
openclaw gateway run --verbose
openclaw gateway probe
openclaw gateway discover
用途拆解:
gateway status:查看服务状态,并可附带 RPC 探测gateway start/stop/restart:服务启停控制gateway run:前台运行,适合调试gateway probe:排查“能否连接 / RPC 是否可用 / 是否 scope 受限”gateway discover:发现网络中的 gateway 广播
2. 综合状态与健康检查
openclaw status
openclaw status --deep
openclaw status --usage
openclaw health
openclaw doctor
用途拆解:
status:看整体运行概况status --deep:对 channels 做更深探测status --usage:看模型提供商使用量/额度快照health:从运行中的 gateway 获取健康状态doctor:做健康检查和常见修复
3. 日志与调试界面
openclaw logs
openclaw logs --follow
openclaw logs --json
openclaw tui|terminal|chat
openclaw tui --local
openclaw tui --message "hello" --session work
openclaw docs <query>
用途拆解:
logs --follow:实时跟日志,排错高频命令logs --json:脚本化或结构化分析日志dashboard:打开 Web 控制台tui|terminal|chat:进入终端 UI(三个别名等价)--local:本地嵌入 agent 运行时--message:连接后立即发送初始消息--session:指定会话 key--deliver:投递助手回复--thinking:覆盖思考级别--timeout-ms:agent 超时--url / --token / --password:远程 Gateway 连接
docs:快速搜索官方文档
生命周期 / 执行流程
日常巡检流程
openclaw status- 若异常不明显,执行
openclaw gateway status - 再看
openclaw health - 继续用
openclaw logs --follow追日志 - 若怀疑配置或环境问题,执行
openclaw doctor
Gateway 起不来时
openclaw gateway statusopenclaw gateway run --verbose- 同时关注端口占用、auth 配置、SecretRef 是否解析成功
- 若只是日常改完配置,通常
openclaw gateway restart即可
远程 / 多 gateway 排查时
openclaw gateway probe- 必要时
openclaw gateway discover - 如果要严格要求 RPC 可用,用
openclaw gateway status --require-rpc
高频命令组合
最小排错组合
openclaw status
openclaw gateway status
openclaw logs --follow
稍完整的诊断组合
openclaw status --deep
openclaw health
openclaw gateway probe
openclaw doctor
调试运行组合
openclaw gateway run --verbose
openclaw tui --local
openclaw gateway call health
openclaw gateway stability
边界与限制
gateway status看的是服务与探测结果,不等于应用层所有能力都正常。status --deep会做更多探测,适合排错,不一定适合高频无脑执行。logs依赖 gateway RPC;如果 RPC 本身不可用,就要优先解决 gateway 连通性。dashboard更适合可视化巡检,不替代命令行精确排错。
常见误区
- 误区 1:把
daemon当作唯一正确入口。实际上当前主入口是gateway。 - 误区 2:只看
gateway status就认为系统没问题。很多时候还要看status、health、logs。 - 误区 3:日志没报错就说明没问题。权限、认证、scope 不足也可能表现为“能连上但不能用”。
对比项
status:偏总览health:偏运行健康gateway status:偏服务与 RPC 探测logs:偏排错细节doctor:偏自动诊断与修复建议
OpenClaw Gateway 与诊断命令
https://blog.weihan.fun/archives/019e6d3f-a52c-713a-ae62-3d26b0035b0a
评论