1. 诊断问题
openclaw doctor
2. 配置 API keys(替换为真实 key)
openclaw config set providers.kimi-coding.api_key "sk-your-key"
openclaw config set providers.moonshot.api_key "sk-your-key"
3. 强制重启 gateway
openclaw gateway --force
4. 检查状态
openclaw status
停止 gateway
openclaw gateway stop
或强制重启(杀死占用端口的进程)
openclaw gateway --force
启动 gateway
openclaw gateway
查看 agents 列表
openclaw agents list
为 main agent 配置认证
openclaw agents auth main
或
openclaw agents configure main
运行 agent(本地模式)
openclaw agent --local
或通过 gateway 运行
openclaw agent --to +15555550123 --message "测试消息"
1. 停止现有 gateway(如果还在运行)
openclaw gateway stop
2. 强制启动 gateway(清除任何残留状态)
openclaw gateway --force
3. 检查状态
openclaw status
4. 测试运行
openclaw agent --message "Hello, OpenClaw is working!"
以下是 OpenClaw 2026.2.3-1 版本命令行工具的帮助信息翻译:
🦞 OpenClaw 2026.2.3-1 (d84eb46) — 配置热重载,部署冷汗直流
用法: openclaw [选项] [命令]
选项:
-V, --version 输出版本号
--dev 开发配置文件: 在 ~/.openclaw-dev 下隔离状态,默认网关端口 19001,并偏移派生端口(浏览器/画布)
--profile <名称> 使用命名配置文件(在 ~/.openclaw-<名称> 下隔离 OPENCLAW_STATE_DIR/OPENCLAW_CONFIG_PATH)
--no-color 禁用 ANSI 颜色
-h, --help 显示命令帮助
命令:
核心设置
setup 初始化 ~/.openclaw/openclaw.json 和代理工作区
onboard 交互式向导设置网关、工作区和技能
configure 交互式提示设置凭证、设备和代理默认值
config 配置助手(get/set/unset)。无子命令运行时进入向导模式
健康检查与诊断
doctor 网关和通道的健康检查+快速修复
dashboard 使用当前令牌打开控制界面
health 从正在运行的网关获取健康状态
重置与卸载
reset 重置本地配置/状态(保留 CLI 安装)
uninstall 卸载网关服务+本地数据(CLI 仍保留)
消息与通信
message 发送消息和通道操作
memory 内存搜索工具
status 显示通道健康状况和最近会话接收者
sessions 列出存储的对话会话
代理管理
agent 通过网关运行代理回合(使用 --local 为嵌入模式)
agents 管理隔离代理(工作区+认证+路由)
acp 代理控制协议工具
网关控制
gateway 网关控制
daemon 网关服务(遗留别名)
logs 网关日志
system 系统事件、心跳和在线状态
AI 模型与执行
models 模型配置
approvals 执行审批
nodes 节点命令
node 节点控制
sandbox 沙盒工具
设备与连接
devices 设备配对+令牌管理
browser 管理 OpenClaw 专用浏览器(Chrome/Chromium)
pairing 配对助手
channels 通道管理
webhooks Webhook 助手
dns DNS 助手
开发工具
tui 终端界面
cron Cron 调度器
docs 文档助手
hooks 钩子工具
plugins 插件管理
directory 目录命令
security 安全助手
skills 技能管理
update CLI 更新助手
completion 生成 shell 补全脚本
帮助
help 显示命令帮助
示例:
openclaw channels login --verbose
链接个人 WhatsApp Web 并显示二维码+连接日志。
openclaw message send --target +15555550123 --message "Hi" --json
通过您的网页会话发送并打印 JSON 结果。
openclaw gateway --port 18789
在本地运行 WebSocket 网关。
openclaw --dev gateway
运行开发网关(隔离状态/配置)在 ws://127.0.0.1:19001。
openclaw gateway --force
杀死任何绑定到默认网关端口的进程,然后启动它。
openclaw agent --to +15555550123 --message "Run summary" --deliver
直接与代理交谈使用网关;可选择发送 WhatsApp 回复。
openclaw message send --channel telegram --target @mychat --message "Hi"
通过您的 Telegram 机器人发送。
文档: docs.openclaw.ai/cli