返回教程中心
CLI 命令参考

OpenClaw CLI 使用教程,常用命令入门和操作指南

O
OpenClaw AI
2026-03-25

OpenClaw 的 CLI 很强,但新手一开始不需要把所有命令都背下来。先掌握最常用的那一组,就足够覆盖安装、启动、状态检查和排障。

1. openclaw onboard

用途:

  • 安装后的第一次引导
  • 配置模型认证
  • 安装 Gateway 服务

最常见命令:

bash
openclaw onboard --install-daemon

适合:

  • 第一次安装
  • 想按官方路径把服务一起装好

2. openclaw channels

用途:

  • 登录消息渠道
  • 查看渠道状态

常见命令:

bash
openclaw channels login
openclaw channels status --probe

适合:

  • WhatsApp 扫码登录
  • 检查 Telegram / Google Chat 等渠道状态

3. openclaw gateway

用途:

  • 启动 Gateway
  • 安装 Gateway 服务
  • 查看 Gateway 状态

常见命令:

bash
openclaw gateway
openclaw gateway run
openclaw gateway install
openclaw gateway status
openclaw gateway probe

官方说明里还特别提醒:

  • 未配置 gateway.mode=local 时,Gateway 不会随便启动
  • 无认证时,绑定到 loopback 之外会被安全护栏阻止

4. openclaw dashboard

用途:

  • 快速打开带 token 的 Dashboard 链接

命令:

bash
openclaw dashboard

适合:

  • 处理 unauthorized
  • 重新打开管理界面
  • 在 SSH 场景里拿到正确链接

5. openclaw doctor

用途:

  • 做环境和安装诊断
  • 修复或迁移某些服务问题

命令:

bash
openclaw doctor

6. openclaw status

用途:

  • 查看系统概览
  • 做更深的健康检查

常见命令:

bash
openclaw status
openclaw status --all
openclaw status --deep

7. openclaw logs

用途:

  • 实时查看日志

命令:

bash
openclaw logs --follow

这通常是最快的排障入口之一。

8. openclaw node

用途:

  • 启动无头节点主机
  • 把 system.run / system.which 能力接到其他机器上

适合:

  • 远程 Linux / Windows 执行
  • 浏览器代理放在单独节点

一套最值得记住的命令组合

如果你只打算先记住一组,我建议记这几个:

bash
openclaw onboard --install-daemon
openclaw channels login
openclaw gateway --port 18789
openclaw dashboard
openclaw status --deep
openclaw logs --follow
openclaw doctor

这一组基本覆盖了安装、登录、启动、打开控制台、状态检查和排障。

继续阅读

相关阅读与站内入口

准备好开始了吗?

继续探索更多教程,或者去技能市场看看有哪些现成的插件。