openclaw 是主 CLI 入口点。

命令分组

分组命令
设置与引导setup · onboard · configure · config · completion · doctor · dashboard
重置与卸载backup · reset · uninstall · update
消息与 Agentmessage · agent · agents · acp · mcp
健康与会话status · health · sessions
Gateway 与日志gateway · logs · system
模型与推理models · infer · memory · commitments · wiki
网络与节点directory · nodes · devices · node
运行时与沙箱approvals · sandbox · tui · browser
自动化cron · tasks · hooks · webhooks
发现与文档dns · docs
配对与 Channelpairing · qr · channels
安全与插件security · secrets · skills · plugins · proxy

全局标志

标志用途
--dev隔离状态到 ~/.openclaw-dev,移动默认端口
--profile <name>隔离状态到 ~/.openclaw-<name>
--no-color禁用 ANSI 颜色
--json机器可读 JSON 输出
-V/--version打印版本并退出

关键命令参考

openclaw status

openclaw status          # 快速诊断
openclaw status --all    # 完整报告(可分享)
openclaw status --deep   # 实时探测
openclaw status --usage  # 提供商用量

openclaw health

openclaw health          # Gateway 健康快照
openclaw health --json   # JSON 输出
openclaw health --verbose  # 详细输出(强制实时探测)

openclaw gateway

openclaw gateway         # 启动 Gateway
openclaw gateway run     # 前台运行
openclaw gateway status  # 服务状态
openclaw gateway stop    # 停止 Gateway
openclaw gateway restart # 重启 Gateway
openclaw gateway install # 安装为系统服务
openclaw gateway probe   # 探测可达性

openclaw models

openclaw models status          # 认证状态 + 默认模型
openclaw models list            # 列出所有模型
openclaw models list --provider anthropic  # 按提供商过滤
openclaw models set anthropic/claude-opus-4-6  # 设置默认模型
openclaw models scan            # 扫描可用模型
openclaw models status --probe  # 实时认证探测

openclaw config

openclaw config file                    # 显示配置文件路径
openclaw config get agents.defaults.workspace
openclaw config set agents.defaults.heartbeat.every "2h"
openclaw config unset plugins.entries.brave.config.webSearch.apiKey
openclaw config schema                  # 打印 JSON Schema
openclaw config validate                # 验证配置
openclaw config patch --file ./patch.json5 --dry-run

openclaw logs

openclaw logs            # 查看日志
openclaw logs --follow   # 实时跟踪
openclaw logs --tail 100 # 最后 100 行

openclaw doctor

openclaw doctor          # 诊断并修复
openclaw doctor --fix    # 自动修复
openclaw doctor --non-interactive  # 非交互模式

openclaw channels

openclaw channels status         # Channel 状态
openclaw channels status --probe # 实时探测
openclaw channels login          # 登录 Channel(WhatsApp QR 等)
openclaw channels add --channel telegram  # 添加 Channel

openclaw pairing

openclaw pairing list telegram
openclaw pairing approve telegram <CODE>
openclaw pairing reject telegram <CODE>

openclaw secrets

openclaw secrets configure  # 配置 SecretRef
openclaw secrets apply      # 应用 SecretRef
openclaw secrets audit      # 审计凭证
openclaw secrets reload     # 重载密钥快照

openclaw update

openclaw update                  # 更新到最新版
openclaw update --channel beta   # 切换到 beta
openclaw update --channel dev    # 切换到 git checkout
openclaw update --dry-run        # 预览

openclaw infer

openclaw infer model run --model anthropic/claude-opus-4-6 -m "Hello"
openclaw infer model run --stream-raw  # 原始流输出

相关

  • concepts/cli-agent — openclaw agent
  • concepts/cli-agents — openclaw agents
  • concepts/cli-cron — openclaw cron
  • concepts/cli-hooks — openclaw hooks
  • concepts/cli-mcp — openclaw mcp
  • concepts/cli-memory — openclaw memory
  • concepts/cli-plugins — openclaw plugins
  • concepts/cli-sessions — openclaw sessions
  • concepts/cli-skills — openclaw skills
  • concepts/cli-tasks — openclaw tasks