下载百度AI搭子DuMate,处理电脑各种问题和文档等常用办公事项,注册并下载链接:https://www.dumate.cn/?track=yqyl,在邀请码对换填写:FDP85KU,即可领取2000积分

OpenClaw命令合集

AIGC   2026-08-01 14:06   16   0  

1. 快速启动:Gateway 和 TUI

安装完第一步,启动 Gateway 才能用。

场景命令
启动 Gatewayopenclaw gateway start
停止 Gatewayopenclaw gateway stop
重启 Gatewayopenclaw 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,看日志报什么错。

2. 首次配置:向导和手动设置

第一次装完,跑一遍配置向导最省事。

场景命令
交互式配置向导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              # 重置所有配置

3. 模型管理:接入和切换

场景命令
查看已配置模型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 确认连通性再实际使用。

4. 频道登录:飞书/企微/微信/Telegram

场景命令
查看已配置频道openclaw channels list
查看频道状态openclaw channels status
探测频道连接openclaw channels status --probe
查看频道日志openclaw channels logs
登录 Telegramopenclaw channels login telegram
登录 WhatsAppopenclaw channels login whatsapp
登录 Discordopenclaw channels login discord
退出登录openclaw channels logout telegram
退出所有openclaw channels logout all
添加频道账户openclaw channels add --channel feishu --token xxx
解析用户/群组 IDopenclaw channels resolve --channel feishu --name 张三

5. 插件和扩展

场景命令
查看所有插件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 的扩展模块):

场景命令
查看所有 Skillsopenclaw skills list
查看 Skill 详情openclaw skills info <技能名>
检查 Skill 可用性openclaw skills check

6. 定时任务和自动化

场景命令
查看所有定时任务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 渠道推送。

7. 消息收发

场景命令
发送文本消息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 @张三

8. 日志和调试

场景命令
查看最近日志openclaw logs
实时跟踪日志openclaw logs --follow
只看错误日志openclaw logs --error
指定条数openclaw logs --limit 100
纯文本输出openclaw logs --plain
输出 JSONopenclaw logs --json
本地时间戳openclaw logs --local-time
💡 Gateway 跑不起来?先 openclaw logs --follow,看实时报错信息。

9. 健康检查和修复

场景命令
执行健康检查openclaw doctor
自动修复问题openclaw doctor --fix
强制修复(慎用)openclaw doctor --force
生成网关 Tokenopenclaw doctor --generate-gateway-token
扫描系统服务openclaw doctor --scan
💡 遇到问题先跑 doctor,它能自动修复大部分常见异常。

10. 浏览器自动化

场景命令
启动浏览器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
输出 PDFopenclaw browser pdf
查看控制台错误openclaw browser console --level error
执行 JSopenclaw browser evaluate --fn '(el) => el.textContent' --ref 7

11. 智能体管理

场景命令
查看所有智能体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

12. 会话管理

场景命令
查看所有会话openclaw sessions
查看指定智能体会话openclaw sessions --agent main
只看最近两小时openclaw sessions --active 120
聚合所有智能体openclaw sessions --all-agents
输出 JSONopenclaw sessions --json
清理过期会话openclaw sessions cleanup

13. 常用组合命令

新机器完整安装流程:

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

博客评论
还没有人评论,赶紧抢个沙发~
发表评论
说明:请文明发言,共建和谐网络,您的个人信息不会被公开显示。