一、基础信息
查看版本信息:
openclaw --version
查看帮助:
openclaw --help
openclaw <命令> --help
查看状态:
openclaw status
二、Gateway 管理
启动 Gateway:
openclaw gateway
停止 Gateway:
openclaw gateway stop
重启 Gateway:
openclaw gateway restart
强制重启(杀掉占用端口进程):
openclaw gateway --force
查看 Gateway 状态:
openclaw gateway status
查看 Gateway 日志:
openclaw logs
openclaw gateway logs
检查健康状态:
openclaw health
三、配置管理
查看配置文件路径:
openclaw config file
查看配置值:
openclaw config get <路径>
例如:openclaw config get tools
设置配置值:
openclaw config set <路径> <值>
例如:openclaw config set tools.profile full
删除配置值:
openclaw config unset <路径>
验证配置:
openclaw config validate
打开配置向导:
openclaw configure
四、权限管理(Exec Approvals)
查看权限配置:
openclaw approvals get
添加允许的命令:
openclaw approvals allowlist add <命令>
例如:openclaw approvals allowlist add "New-Item"
移除允许的命令:
openclaw approvals allowlist remove <命令>
为所有 agent 添加权限:
openclaw approvals allowlist add --agent "*" <命令>
查看权限帮助:
openclaw approvals allowlist --help
五、通道管理
登录通道:
openclaw channels login <通道>
例如:openclaw channels login telegram
发送消息:
openclaw message send --target <目标> --message "消息内容"
查看通道状态:
openclaw status
openclaw channels list
六、Agent 与会话管理
运行 Agent:
openclaw agent --message "问题"
列出会话:
openclaw sessions list
查看会话历史:
openclaw sessions history <sessionKey>
发送消息到会话:
openclaw sessions send <sessionKey> --message "消息"
列出可用 Agent:
openclaw agents list
七、定时任务(Cron)
列出定时任务:
openclaw cron list
查看定时任务详情:
openclaw cron runs <jobId>
运行定时任务:
openclaw cron run <jobId>
发送提醒(一次性):
openclaw cron add --schedule '{"kind":"at","at":"2026-03-09T09:00:00"}' \
--payload '{"kind":"systemEvent","text":"提醒:9点开会"}' \
--sessionTarget main
八、技能(Skills)
列出可用技能:
openclaw skills list
查看技能信息:
openclaw skills inspect <技能名>
查看技能帮助:
openclaw <技能名> --help
九、模型管理
列出可用模型:
openclaw models list
搜索模型:
openclaw models scan
设置默认模型:
openclaw config set agents.defaults.model.primary "zai/glm-5"
十、浏览器控制
启动浏览器:
openclaw browser start
停止浏览器:
openclaw browser stop
打开网页:
openclaw browser open https://example.com
截屏:
openclaw browser screenshot
查看标签页:
openclaw browser tabs
十一、系统维护
更新 OpenClaw:
openclaw update
npm update -g openclaw
检查更新:
openclaw update status
诊断问题:
openclaw doctor
重置配置:
openclaw reset
⚠️ 警告:会删除本地数据,CLI 保留
卸载 Gateway:
openclaw uninstall
十二、快捷命令
打开控制 UI:
openclaw dashboard
打开终端 UI:
openclaw tui
生成 Shell 补全脚本:
openclaw completion
搜索文档:
openclaw docs <关键词>
例如:openclaw docs gateway
十三、常见问题
Q: Gateway 端口被占用怎么办?
A: openclaw gateway --force
Q: 命令报错 "Unrecognized key"?
A: 检查配置格式是否正确,或查看 openclaw config validate
Q: 找不到命令或工具?
A: 检查 tools.profile 设置,可能需要设置为 "full"
openclaw config set tools.profile full
Q: 如何启用 exec 工具?
A: 1. 配置 allowlist:openclaw approvals allowlist add <命令>
-
设置 profile:openclaw config set tools.profile full
-
重启 Gateway:openclaw gateway restart
Q: 如何设置自动提醒?
A: 使用 cron 命令,例如每天9点提醒:
openclaw cron add --schedule '{"kind":"cron","expr":"0 9 * * *"}' \
--payload '{"kind":"systemEvent","text":"9点提醒"}' \
--sessionTarget main
十四、工作文件夹配置
我的工作文件夹:D:\xxxx
记住这个路径,以后所有工作文件都保存在这里。
十五、联系方式
-
ClawHub(技能市场):https://clawhub.com
💡 提示:遇到问题时,先运行 openclaw doctor 诊断,或查看官方文档。