openclaw的一些常用命令汇总
快速入门
初始化与配置
| 命令 | 说明 |
|---|
openclaw setup | 初始化配置和工作空间 |
openclaw configure | 交互式配置向导(模型、频道、技能、网关) |
openclaw onboard | 完整入门向导(网关 + 工作空间 + 技能) |
openclaw doctor | 健康检查 + 自动修复配置问题 |
openclaw status | 查看会话状态、频道健康、最近联系人 |
openclaw dashboard | 打开 Control UI 控制面板 |
setup 选项
1 2 3 4 5 6 7
| openclaw setup --workspace <目录> openclaw setup --wizard openclaw setup --non-interactive openclaw setup --mode local|remote openclaw setup --remote-url <URL> openclaw setup --remote-token <令牌>
|
onboard 选项
1 2 3 4 5 6
| openclaw onboard --reset openclaw onboard --flow quickstart openclaw onboard --flow advanced openclaw onboard --gateway-port 18789 openclaw onboard --install-daemon
|
Gateway 网关服务
基本命令
| 命令 | 说明 |
|---|
openclaw gateway | 启动 WebSocket 网关(前台运行) |
openclaw gateway status | 查看网关状态(默认探测 RPC) |
openclaw gateway start | 启动网关服务(后台) |
openclaw gateway stop | 停止网关服务 |
openclaw gateway restart | 重启网关服务 |
openclaw gateway install | 安装为系统服务 |
openclaw gateway uninstall | 卸载系统服务 |
启动参数
1 2 3 4 5 6 7 8 9 10
| openclaw gateway --port 18789 openclaw gateway --bind lan openclaw gateway --token <令牌> openclaw gateway --auth token|password openclaw gateway --password <密码> openclaw gateway --force openclaw gateway --dev openclaw gateway --verbose openclaw gateway --tailscale serve|funnel
|
日志查看
1 2 3 4 5 6
| openclaw logs openclaw logs --follow openclaw logs --limit 500 openclaw logs --json openclaw logs --plain
|
RPC 调用
1 2 3 4 5
| openclaw gateway call <方法> [--params '<JSON>'] openclaw gateway health openclaw gateway probe openclaw gateway discover
|
消息与会话
发送消息
1 2 3 4 5 6 7 8 9 10 11
| openclaw message send --target <目标> --message "内容"
openclaw message send --channel whatsapp --target +8613800138000 --message "你好" openclaw message send --channel telegram --target @mychat --message "Hi" openclaw message send --channel discord --target channel:123456 --message "Hello"
openclaw message send --target +8613800138000 --message "看这个" --media /path/to/image.jpg
|
消息子命令
| 命令 | 说明 |
|---|
openclaw message send | 发送消息 |
openclaw message poll | 发送投票 |
openclaw message react | 添加反应表情 |
openclaw message read | 标记已读 |
openclaw message edit | 编辑消息 |
openclaw message delete | 删除消息 |
openclaw message pin | 置顶消息 |
openclaw message search | 搜索消息 |
openclaw message thread create | 创建话题 |
openclaw message thread list | 列出话题 |
会话管理
1 2 3 4
| openclaw sessions openclaw sessions --active 60 openclaw sessions --json
|
Agent 对话
1 2 3 4 5 6 7 8 9 10 11 12
| openclaw agent --message "帮我总结今天的新闻"
openclaw agent --message "继续" --to +8613800138000
openclaw agent --message "你好" --local
openclaw agent --message "总结" --to +8613800138000 --deliver
|
频道管理
基本命令
| 命令 | 说明 |
|---|
openclaw channels list | 列出已配置的频道和账号 |
openclaw channels status | 检查频道连接状态 |
openclaw channels logs | 查看频道日志 |
openclaw channels add | 添加频道账号 |
openclaw channels remove | 移除频道账号 |
openclaw channels login | 登录频道(扫码) |
openclaw channels logout | 登出频道 |
支持的频道
whatsapp - WhatsApp
telegram - Telegram
discord - Discord
slack - Slack
signal - Signal
imessage - iMessage
googlechat - Google Chat
msteams - Microsoft Teams
mattermost - Mattermost(插件)
添加频道示例
1 2 3 4 5 6 7 8 9 10 11 12
| openclaw channels add --channel telegram --token $TELEGRAM_BOT_TOKEN
openclaw channels add --channel discord --account work --name "Work Bot" --token $DISCORD_BOT_TOKEN
openclaw channels login --channel whatsapp
openclaw channels add --channel telegram --account alerts --name "Alerts Bot" --token $TOKEN
|
频道状态检查
1 2 3 4
| openclaw channels status openclaw channels status --probe openclaw channels list --json
|
模型配置
查看与设置
| 命令 | 说明 |
|---|
openclaw models list | 列出可用模型 |
openclaw models status | 查看模型配置和认证状态 |
openclaw models set <模型ID> | 设置默认主模型 |
openclaw models set-image <模型ID> | 设置图像模型 |
openclaw models scan | 扫描并推荐最佳模型 |
模型别名
1 2 3 4
| openclaw models aliases list openclaw models aliases add <别名> <模型ID> openclaw models aliases remove <别名>
|
回退模型
1 2 3 4 5
| openclaw models fallbacks list openclaw models fallbacks add <模型ID> openclaw models fallbacks remove <模型ID> openclaw models fallbacks clear
|
认证管理
1 2 3 4
| openclaw models auth add openclaw models auth setup-token openclaw models auth paste-token
|
查看使用量
1 2 3
| openclaw status --usage openclaw models status --probe
|
定时任务
任务管理
| 命令 | 说明 |
|---|
openclaw cron status | 查看调度器状态 |
openclaw cron list | 列出所有定时任务 |
openclaw cron add | 添加定时任务 |
openclaw cron edit <ID> | 编辑任务 |
openclaw cron rm <ID> | 删除任务 |
openclaw cron enable <ID> | 启用任务 |
openclaw cron disable <ID> | 禁用任务 |
openclaw cron run <ID> | 立即执行任务 |
openclaw cron runs --id <ID> | 查看执行历史 |
添加任务示例
1 2 3 4 5 6 7 8 9 10 11 12
| openclaw cron add --name "每小时提醒" --every 1h --system-event "该休息一下了"
openclaw cron add --name "早间提醒" --at "2026-03-10T09:00:00" --system-event "早安!新的一天开始了"
openclaw cron add --name "工作日早间" --cron "0 9 * * 1-5" --system-event "开始工作"
openclaw cron add --name "日报提醒" --cron "0 18 * * *" --message "记得写日报"
|
记忆系统
命令
| 命令 | 说明 |
|---|
openclaw memory status | 查看记忆索引状态 |
openclaw memory index | 重建记忆索引 |
openclaw memory search "<查询>" | 语义搜索记忆 |
示例
1 2 3 4 5 6 7 8 9
| openclaw memory search "上次讨论的项目"
openclaw memory index
openclaw memory status --json
|
记忆文件结构
1 2 3 4 5 6 7
| ~/.openclaw/workspace/ ├── MEMORY.md # 长期记忆(手动维护) ├── memory/ │ ├── 2026-03-10.md # 每日记录 │ └── 2026-03-09.md └── HEARTBEAT.md # 心跳任务
|
配置管理
基本命令
| 命令 | 说明 |
|---|
openclaw config | 启动配置向导(无子命令时) |
openclaw config get <路径> | 获取配置值 |
openclaw config set <路径> <值> | 设置配置值 |
openclaw config unset <路径> | 删除配置值 |
openclaw config file | 显示配置文件路径 |
openclaw config validate | 验证配置 |
示例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| openclaw config get agents.defaults.model.primary openclaw config get gateway.port openclaw config get channels.telegram.accounts.default.token
openclaw config set agents.defaults.model.primary "claude-3-opus" openclaw config set gateway.port 18789
openclaw config unset agents.defaults.thinking
openclaw config validate
|
配置路径示例
1 2 3 4 5 6 7
| agents.defaults.model.primary # 主模型 agents.defaults.thinking # 思考模式 agents.defaults.timeoutSeconds # 超时时间 gateway.port # 网关端口 gateway.auth.token # 网关令牌 channels.telegram.enabled # Telegram 启用状态
|
技能系统
命令
| 命令 | 说明 |
|---|
openclaw skills list | 列出可用技能 |
openclaw skills info <名称> | 查看技能详情 |
openclaw skills check | 检查技能依赖状态 |
示例
1 2 3 4 5 6 7 8 9 10 11 12
| openclaw skills list
openclaw skills list --eligible
openclaw skills info weather
openclaw skills check --verbose
|
安装技能
安全与诊断
安全审计
1 2 3 4
| openclaw security audit openclaw security audit --deep openclaw security audit --fix
|
健康检查
1 2 3 4 5 6
| openclaw health openclaw health --json openclaw doctor openclaw doctor --deep openclaw doctor --yes
|
密钥管理
1 2 3
| openclaw secrets reload openclaw secrets audit
|
浏览器控制
管理命令
| 命令 | 说明 |
|---|
openclaw browser status | 浏览器状态 |
openclaw browser start | 启动浏览器 |
openclaw browser stop | 停止浏览器 |
openclaw browser tabs | 列出标签页 |
openclaw browser open <URL> | 打开网页 |
openclaw browser close [ID] | 关闭标签页 |
openclaw browser profiles | 列出配置文件 |
检查命令
| 命令 | 说明 |
|---|
openclaw browser screenshot | 截图 |
openclaw browser snapshot | 获取页面结构(ARIA/AI 格式) |
操作命令
| 命令 | 说明 |
|---|
openclaw browser navigate <URL> | 导航到 URL |
openclaw browser click <ref> | 点击元素 |
openclaw browser type <ref> <文本> | 输入文本 |
openclaw browser press <键> | 按键 |
openclaw browser hover <ref> | 悬停 |
openclaw browser drag <start> <end> | 拖拽 |
openclaw browser select <ref> <值> | 选择 |
openclaw browser upload <文件> | 上传文件 |
openclaw browser fill --fields '<JSON>' | 填充表单 |
openclaw browser wait --time <ms> | 等待 |
openclaw browser evaluate --fn '<代码>' | 执行 JavaScript |
示例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| openclaw browser open https://example.com
openclaw browser screenshot --full-page
openclaw browser snapshot --format aria
openclaw browser click e123
openclaw browser type e456 "Hello World" --submit
|
节点管理
设备配对
1 2 3 4 5
| openclaw devices list openclaw devices approve <请求ID> openclaw devices reject <请求ID> openclaw devices remove <设备ID>
|
节点操作
1 2 3 4 5 6 7 8 9 10 11 12 13
| openclaw nodes status openclaw nodes list openclaw nodes describe --node <ID>
openclaw nodes run --node <ID> ls -la
openclaw nodes notify --node <ID> --title "提醒" --body "内容"
openclaw nodes location get --node <ID>
|
相机操作
1 2 3 4
| openclaw nodes camera list --node <ID> openclaw nodes camera snap --node <ID> --facing front openclaw nodes camera clip --node <ID> --duration 10s
|
屏幕录制
1 2
| openclaw nodes screen record --node <ID> --duration 30s --fps 30
|
Canvas 操作
1 2 3 4
| openclaw nodes canvas snapshot --node <ID> openclaw nodes canvas present --node <ID> --target https://example.com openclaw nodes canvas hide --node <ID>
|
更新与维护
更新
1 2 3
| openclaw update openclaw update --check
|
备份
1 2 3
| openclaw backup create openclaw backup verify <文件>
|
重置
1 2 3 4 5
| openclaw reset openclaw reset --scope config openclaw reset --scope config+creds+sessions openclaw reset --scope full
|
卸载
1 2 3
| openclaw uninstall openclaw uninstall --all
|
全局参数
| 参数 | 说明 |
|---|
--dev | 开发模式(状态隔离到 ~/.openclaw-dev) |
--profile <名称> | 使用命名配置文件 |
--no-color | 禁用彩色输出 |
--log-level <级别> | 日志级别:silent |
-V, --version | 显示版本号 |
-h, --help | 显示帮助 |
输出格式
| 参数 | 说明 |
|---|
--json | JSON 格式输出 |
--plain | 纯文本输出 |
常用场景示例
场景1:首次安装
1 2 3 4 5 6 7 8 9 10 11 12
| openclaw setup --wizard
openclaw configure
openclaw gateway install
openclaw gateway start
|
场景2:连接 Telegram
1 2 3 4 5 6 7 8 9
| openclaw channels add --channel telegram --token $TELEGRAM_BOT_TOKEN
openclaw channels status --probe
openclaw message send --channel telegram --target @mychat --message "测试"
|
场景3:连接 WhatsApp
1 2 3 4 5 6 7 8 9
| openclaw channels login --channel whatsapp
openclaw channels status
openclaw message send --target +8613800138000 --message "你好"
|
场景4:设置定时提醒
1 2 3 4 5 6 7 8 9
| openclaw cron add --name "早间提醒" --cron "0 9 * * *" --system-event "早安!新的一天开始了"
openclaw cron add --name "下班提醒" --cron "0 18 * * 1-5" --system-event "该下班了,记得写日报"
openclaw cron list
|
场景5:切换模型
1 2 3 4 5 6 7 8 9
| openclaw models list
openclaw models set claude-3-opus
openclaw models status
|
场景6:远程节点控制
1 2 3 4 5 6 7 8 9
| openclaw nodes list
openclaw nodes run --node my-mac -- open -a "Safari"
openclaw nodes location get --node my-iphone
|
场景7:浏览器自动化
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| openclaw browser start
openclaw browser open https://github.com
openclaw browser snapshot --format aria
openclaw browser screenshot --full-page
openclaw browser stop
|
评论区(共34条)
2楼 - suguojian
学习了。谢谢佬
3楼 - handsome
感谢大佬
4楼 - Briden
学习学习,感谢大佬
5楼 - kkzdq
标记一下
6楼 - Huluma
很有用,谢谢佬
7楼 - Awaken
谢谢大佬分享
8楼 - zhangdong
感谢佬友分享
9楼 - wuxiaoyuan
佬友厉害了~
10楼 - cheviChan
真详细,先收藏,看不看另说
11楼 - ljm777
前排学习
12楼 - lgq139
感谢佬,收藏了
13楼 - youxiaohanpian
Uninstall 哦豁w
14楼 - linzee
mark一下,到时候ai帮我学
15楼 - nerokim
感谢分享
16楼 - yuki_z
感谢分享
17楼 - icbc
你是不是让 ai 总结的
18楼 - ibro
OpenClaw

🔗 https://docs.openclaw.ai/cli
官方文档有哇
19楼 - 578382239
感谢佬友整理
20楼 - longaotian88
感谢分享 有用
22楼 - Katoyu
感谢佬友分享
23楼 - beaconx
openclaw onboard这个命令是在做配置吧,安装为系统服务如何理解?
24楼 - Casper
重点在于后半部分 –install-daemon 这个配置,作用就是把openclaw网关注册成系统后台服务,实现开机自启、后台常驻、重启后自动恢复等等
25楼 - magnet
可能很少去仔细看官方文档,这么多还是第一次看
26楼 - beaconx
感谢佬友解答!
我说怎么openclaw gateway start报错呢,估计就是没加这个参数的原因。
有两个问题请教下
1、我之前没加这个参数,现在有办法(不重新配置的情况)加上吗?
2、你的这个解答是哪里知道的,我看官方文档的这个命令参数解释里没讲呢。 一般AI的知识还不知道openclaw。
27楼 - Bee
这个指令单纯安装服务,不进行设置引导
假设你改变了安装方式(例如改用 fnm/bun),导致路径不同,这个就很好用了
1 2 3 4
| systemctl --user enable --now openclaw-gateway && \ systemctl --user restart openclaw-gateway && \ systemctl --user status openclaw-gateway
|
其他还有配对指令例如
1 2
| openclaw pairing approve discord <PAIRING_CODE> --notify
|
28楼 - iceuy
谢谢大佬总结
29楼 - rui_zhao1
特别详细!
30楼 - Vincent.liu
学习了 感谢分享!
31楼 - Magic_Conch
感谢大佬
32楼 - agcl
感谢,但我都用了怎么还去记命令呢,直接对话让来操作捏。
33楼 - Rickykiko
skills 好像被替换成了 plugins
34楼 - luoyang
怎么切换会话来着
35楼 - zemu
学习到了,感谢
36楼 - vwvw
太全面了,给ai搞个速查