安装完第一步,启动 Gateway 才能用。
| 场景 | 命令 |
|---|---|
| 启动 Gateway | openclaw gateway start |
| 停止 Gateway | openclaw gateway stop |
| 重启 Gateway | openclaw gateway restart |
| 查看运行状态 | openclaw gateway status |
| 前台运行(调试) | openclaw gateway run |
| 强制前台运行 | openclaw gateway run --force |
| 指定端口启动 | openclaw gateway --port 18789 |
| 安装开机自启 | openclaw gateway install |
| 卸载开机自启 | openclaw gateway uninstall |
| 打开控制面板 | openclaw dashboard |
| 终端交互模式 | openclaw tui |
💡 装完没反应?先跑 openclaw gateway run,看日志报什么错。
第一次装完,跑一遍配置向导最省事。
| 场景 | 命令 |
|---|---|
| 交互式配置向导 | openclaw configure |
| 交互式引导(首次) | openclaw onboard |
| 强制重新初始化 | openclaw onboard --force |
| 完整启动流程 | openclaw setup && openclaw gateway install && openclaw gateway start |
手动改配置用 config set:
openclaw config set gateway.port 18789openclaw config set agents.main.model "minimax/MiniMax-M2.7"
查看配置:
openclaw config get all # 全部配置openclaw config get gateway # 网关配置openclaw config get agents # 智能体配置openclaw config file # 查看配置文件路径openclaw config validate # 验证配置是否合法
重置配置:
openclaw config unset gateway.port # 取消单个配置openclaw config reset # 重置所有配置
| 场景 | 命令 |
|---|---|
| 查看已配置模型 | openclaw models list |
| 查看模型运行状态 | openclaw models status |
| 扫描可关联的模型 | openclaw models scan |
| 探测模型可用性 | openclaw models probe |
| 设置默认模型 | openclaw models set default "minimax/MiniMax-M2.7" |
| 设置默认图像模型 | openclaw models set-image "doubao-seedream-4-0-250828" |
| 管理模型别名 | openclaw models aliases |
| 管理认证信息 | openclaw models auth |
| 管理备用模型列表 | openclaw models fallbacks |
💡 接入新模型后,先跑 openclaw models probe 确认连通性再实际使用。
| 场景 | 命令 |
|---|---|
| 查看已配置频道 | openclaw channels list |
| 查看频道状态 | openclaw channels status |
| 探测频道连接 | openclaw channels status --probe |
| 查看频道日志 | openclaw channels logs |
| 登录 Telegram | openclaw channels login telegram |
| 登录 WhatsApp | openclaw channels login whatsapp |
| 登录 Discord | openclaw channels login discord |
| 退出登录 | openclaw channels logout telegram |
| 退出所有 | openclaw channels logout all |
| 添加频道账户 | openclaw channels add --channel feishu --token xxx |
| 解析用户/群组 ID | openclaw channels resolve --channel feishu --name 张三 |
| 场景 | 命令 |
|---|---|
| 查看所有插件 | openclaw plugins list |
| 安装插件 | openclaw plugins install <包名或路径> |
| 卸载插件 | openclaw plugins uninstall <插件名> |
| 启用插件 | openclaw plugins enable <插件名> |
| 禁用插件 | openclaw plugins disable <插件名> |
| 诊断插件问题 | openclaw plugins doctor |
| 查看插件详情 | openclaw plugins info <插件名> |
| 更新插件 | openclaw plugins update |
Skills(技能,OpenClaw 的扩展模块):
| 场景 | 命令 |
|---|---|
| 查看所有 Skills | openclaw skills list |
| 查看 Skill 详情 | openclaw skills info <技能名> |
| 检查 Skill 可用性 | openclaw skills check |
| 场景 | 命令 |
|---|---|
| 查看所有定时任务 | openclaw cron list |
| 添加定时任务 | openclaw cron add --name "每日推送" --cron "0 8 *" --message "早" --channel feishu |
| 运行定时任务(立即) | openclaw cron run <任务名> |
| 查看任务执行历史 | openclaw cron runs |
| 查看调度器状态 | openclaw cron status |
| 禁用任务 | openclaw cron disable <任务ID> |
| 启用任务 | openclaw cron enable <任务ID> |
| 编辑任务 | openclaw cron edit <任务ID> |
| 删除任务 | openclaw cron rm <任务ID> |
💡 定时任务通过 Gateway 触发,支持飞书、企微等 IM 渠道推送。
| 场景 | 命令 |
|---|---|
| 发送文本消息 | openclaw message send --target @用户名 --message "内容" |
| 指定频道发送 | openclaw message send --channel feishu --target @张三 --message "内容" |
| 发送图片 | openclaw message send --target @张三 --media image.png |
| 发送投票 | openclaw message poll --channel discord --target channel:123 --poll-question "吃什么?" --poll-option Pizza --poll-option Sushi |
| 查看最近消息 | openclaw message read --channel feishu --limit 20 |
| 搜索消息 | openclaw message search --channel feishu --query "关键词" |
| 给消息加反应 | openclaw message react --channel feishu --message-id --emoji "👍" |
| 置顶/取消置顶 | openclaw message pin/unpin --channel feishu --message-id |
| 撤回消息 | openclaw message delete --channel feishu --message-id |
群组成员管理:
| 场景 | 命令 |
|---|---|
| 禁言用户 | openclaw message timeout --channel feishu --target @张三 --minutes 10 |
| 踢出群 | openclaw message kick --channel feishu --target @张三 |
| 禁止用户 | openclaw message ban --channel feishu --target @张三 |
| 场景 | 命令 |
|---|---|
| 查看最近日志 | openclaw logs |
| 实时跟踪日志 | openclaw logs --follow |
| 只看错误日志 | openclaw logs --error |
| 指定条数 | openclaw logs --limit 100 |
| 纯文本输出 | openclaw logs --plain |
| 输出 JSON | openclaw logs --json |
| 本地时间戳 | openclaw logs --local-time |
💡 Gateway 跑不起来?先 openclaw logs --follow,看实时报错信息。
| 场景 | 命令 |
|---|---|
| 执行健康检查 | openclaw doctor |
| 自动修复问题 | openclaw doctor --fix |
| 强制修复(慎用) | openclaw doctor --force |
| 生成网关 Token | openclaw doctor --generate-gateway-token |
| 扫描系统服务 | openclaw doctor --scan |
💡 遇到问题先跑 doctor,它能自动修复大部分常见异常。
| 场景 | 命令 |
|---|---|
| 启动浏览器 | openclaw browser start |
| 停止浏览器 | openclaw browser stop |
| 打开网页 | openclaw browser navigate https://example.com |
| 截图 | openclaw browser screenshot |
| 输入文本 | openclaw browser type 12 "内容" |
| 点击元素 | openclaw browser click 12 |
| 提交表单 | openclaw browser click 12 --submit |
| 键盘回车 | openclaw browser press Enter |
| 等待元素 | openclaw browser wait --text "完成" |
| 等待对话框 | openclaw browser dialog --accept |
| 调整窗口大小 | openclaw browser resize 1280 720 |
| 输出 PDF | openclaw browser pdf |
| 查看控制台错误 | openclaw browser console --level error |
| 执行 JS | openclaw browser evaluate --fn '(el) => el.textContent' --ref 7 |
| 场景 | 命令 |
|---|---|
| 查看所有智能体 | openclaw agents list |
| 创建新智能体 | openclaw agents add <智能体名> |
| 删除智能体 | openclaw agents delete <智能体名> |
| 设置身份主题 | openclaw agents set-identity --name 虾哥 --emoji 🦐 |
| 绑定路由 | openclaw agents bind <智能体名> --channel feishu |
| 查看路由规则 | openclaw agents bindings |
| 解绑路由 | openclaw agents unbind <智能体名> --channel feishu |
| 场景 | 命令 |
|---|---|
| 查看所有会话 | openclaw sessions |
| 查看指定智能体会话 | openclaw sessions --agent main |
| 只看最近两小时 | openclaw sessions --active 120 |
| 聚合所有智能体 | openclaw sessions --all-agents |
| 输出 JSON | openclaw sessions --json |
| 清理过期会话 | openclaw sessions cleanup |
新机器完整安装流程:
openclaw setup # 初始化配置和 workspaceopenclaw onboard # 引导式配置模型和频道openclaw models probe # 确认模型连通openclaw gateway install # 安装开机自启openclaw gateway start # 启动 Gatewayopenclaw logs --follow # 跟踪日志确认运行正常
排查 Gateway 无法启动:
openclaw gateway run --verbose # 前台运行看报错openclaw logs --error # 查看错误日志openclaw doctor --fix # 自动修复
:
openclaw channels login feishu # 扫码登录openclaw channels status # 确认连接状态openclaw message send --channel feishu --target @张三 --message "连接成功"
命令太多记不住怎么办?
用 openclaw <命令> --help,比如
openclaw gateway --help openclaw models --help openclaw channels --help
官方文档:https://docs.openclaw.ai/cli
来源:https://zhuanlan.zhihu.com/p/2024449513138525306