OpenClaw CLI 命令速查手册(中文注释+示例版)
发布时间:2026-03-26 10:26:38 作者:小空霸kongba007
我要评论
本文档提供了OpenClaw CLI命令的速查手册,包含初始化配置、诊断维护和网关管理三大类命令,文中介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
下面我把它整理成更适合查阅的 Markdown 表格版命令参考。
我按这几个字段来列:
- 命令
- 子命令
- 常用参数
- 中文备注
- 例子
- 详细用途
这份表是基于你贴出来的 OpenClaw zsh completion 命令树整理的,所以它适合作为一份 CLI 使用速查表。
1. 初始化 / 配置 / 诊断
| 命令 | 子命令 | 常用参数 | 中文备注 | 例子 | 详细用途 |
|---|---|---|---|---|---|
| openclaw setup | - | --workspace --wizard --non-interactive | 初始化本地 OpenClaw 目录和默认工作区 | openclaw setup --workspace ~/.openclaw/workspace | 创建 ~/.openclaw/openclaw.json 和默认 workspace,适合第一次手动初始化 |
| openclaw onboard | - | --workspace --flow --mode --gateway-port --install-daemon --skip-channels | 首次引导向导 | openclaw onboard --flow quickstart --mode local | 一站式完成网关、模型、工作区、技能、渠道的初始配置 |
| openclaw configure | - | --section | 分区配置向导 | openclaw configure --section gateway --section channels | 只修改某一部分配置,而不是全量重跑 onboarding |
| openclaw config | get | --json | 读取配置项 | openclaw config get channels.feishu.enabled | 按点路径读取配置值 |
| openclaw config | set | --json | 设置配置项 | openclaw config set channels.feishu.enabled true --json | 修改某个配置字段,通常直接写入 openclaw.json |
| openclaw config | unset | - | 删除配置项 | openclaw config unset channels.feishu.allowFrom | 删除某个字段,让配置回退默认行为 |
| openclaw doctor | - | --repair --fix --force --deep | 健康检查与修复 | openclaw doctor --repair | 检查网关、配置、渠道、服务是否异常,并尝试修复 |
| openclaw dashboard | - | --no-open | 打开控制台 | openclaw dashboard | 打开控制 UI,用浏览器查看运行状态 |
| openclaw reset | - | --scope --yes --dry-run | 重置本地状态 | openclaw reset --scope config+creds+sessions --yes | 清空配置、凭据、会话,适合重新初始化 |
| openclaw uninstall | - | --service --state --workspace --all | 卸载 OpenClaw 本地环境 | openclaw uninstall --all --yes | 删除服务、状态、工作区,但 CLI 本体可能仍保留 |
2. Gateway / Daemon / 日志
| 命令 | 子命令 | 常用参数 | 中文备注 | 例子 | 详细用途 |
|---|---|---|---|---|---|
| openclaw gateway | run | --port --bind --token --auth --verbose --dev | 前台运行 Gateway | openclaw gateway run --port 18789 --verbose | 启动 WebSocket Gateway,负责 sessions、routing、channels |
| openclaw gateway | status | --json --deep --timeout | 查看网关状态 | openclaw gateway status --json | 查看 Gateway 是否运行、是否可探测 |
| openclaw gateway | install | --port --runtime --token | 安装后台服务 | openclaw gateway install --port 18789 | 把 Gateway 安装成 launchd/systemd/schtasks 服务 |
| openclaw gateway | start | --json | 启动后台服务 | openclaw gateway start | 启动已安装的 Gateway 服务 |
| openclaw gateway | stop | --json | 停止后台服务 | openclaw gateway stop | 停止 Gateway 服务 |
| openclaw gateway | restart | --json | 重启后台服务 | openclaw gateway restart | 修改配置后常用来重启服务 |
| openclaw gateway | call | --params --json | 调用 Gateway RPC | openclaw gateway call some.method --params '{"foo":"bar"}' --json | 直接调用内部 RPC,适合调试 |
| openclaw gateway | health | --json | 获取健康信息 | openclaw gateway health --json | 查看运行健康状态 |
| openclaw gateway | probe | --url --token --json | 探测本地/远程 Gateway | openclaw gateway probe --json | 综合检查网关可达性、探测能力 |
| openclaw gateway | discover | --json | 发现 Gateway | openclaw gateway discover --json | 通过 Bonjour 等方式发现可连接网关 |
| openclaw daemon | status | --json | 查看后台服务状态 | openclaw daemon status | 关注系统服务安装/运行情况 |
| openclaw daemon | install | --port --runtime | 安装后台服务 | openclaw daemon install --port 18789 | 与 gateway install 类似,更偏服务管理 |
| openclaw daemon | start | --json | 启动服务 | openclaw daemon start | 启动后台 Gateway |
| openclaw daemon | stop | --json | 停止服务 | openclaw daemon stop | 停止后台 Gateway |
| openclaw daemon | restart | --json | 重启服务 | openclaw daemon restart | 配置更新后重启 |
| openclaw logs | - | --follow --limit --json --plain | 查看日志 | openclaw logs --follow | 实时查看 Gateway 文件日志,是排障核心命令 |
3. 渠道 / 飞书 / 配对
| 命令 | 子命令 | 常用参数 | 中文备注 | 例子 | 详细用途 |
|---|---|---|---|---|---|
| openclaw channels | list | --json | 列出已配置渠道 | openclaw channels list --json | 查看 Telegram、Feishu、Slack 等账号是否已配置 |
| openclaw channels | status | --probe --json | 查看渠道状态 | openclaw channels status --probe --json | 检查凭据、连接状态是否正常 |
| openclaw channels | capabilities | --channel --account --json | 查看渠道能力 | openclaw channels capabilities --channel feishu --json | 查看该渠道支持哪些消息能力 |
| openclaw channels | resolve | --channel --account --kind --json | 名称解析为 ID | openclaw channels resolve --channel feishu --kind user "张三" | 把用户/群名称解析成内部目标 ID |
| openclaw channels | logs | --channel --lines --json | 查看渠道日志 | openclaw channels logs --channel feishu --lines 200 | 专门看某个渠道的日志片段 |
| openclaw channels | add | --channel --account --name --token --bot-token --app-token | 添加或更新渠道 | openclaw channels add --channel feishu --account main | 为某渠道写入账号配置,飞书、Telegram、Slack 都走这里 |
| openclaw channels | remove | --channel --account --delete | 移除渠道 | openclaw channels remove --channel feishu --account main --delete | 停用或删除某个渠道账号 |
| openclaw channels | login | --channel --account | 渠道登录 | openclaw channels login --channel whatsapp | 某些渠道需要登录链接 |
| openclaw channels | logout | --channel --account | 渠道登出 | openclaw channels logout --channel whatsapp | 断开登录会话 |
| openclaw pairing | list | --channel --json | 查看待审批配对 | openclaw pairing list --channel feishu --json | 对 dmPolicy=pairing 的渠道,列出待审批用户 |
| openclaw pairing | approve | --channel --notify | 批准配对 | openclaw pairing approve ABC123 --channel feishu --notify | 批准某个飞书用户,让其后续消息进入正常 Agent 链路 |
4. 消息操作
| 命令 | 子命令 | 常用参数 | 中文备注 | 例子 | 详细用途 |
|---|---|---|---|---|---|
| openclaw message | send | --message/-m --target/-t --channel --account --media --reply-to | 发送消息 | openclaw message send -m "hello" -t user_xxx --channel feishu | 向某个渠道目标发送消息 |
| openclaw message | broadcast | --targets --message --channel | 批量广播 | openclaw message broadcast --channel feishu --targets u1,u2 --message "通知" | 向多个目标一次性发消息 |
| openclaw message | poll | --poll-question --poll-option | 发起投票 | openclaw message poll --channel discord --target 123 --poll-question "吃什么" --poll-option 火锅 --poll-option 烧烤 | 某些渠道支持原生投票 |
| openclaw message | read | --target --channel --limit --before --after | 读最近消息 | openclaw message read --channel feishu --target user_xxx --limit 20 | 拉取目标最近消息记录 |
| openclaw message | edit | --message-id --message | 编辑消息 | openclaw message edit --channel discord --message-id 123 --message "修正版" | 修改已发送消息 |
| openclaw message | delete | --message-id | 删除消息 | openclaw message delete --channel discord --message-id 123 | 删除指定消息 |
| openclaw message | react | --message-id --emoji --remove | 添加/移除反应 | openclaw message react --channel slack --message-id 123 --emoji 👍 | 对消息加 emoji reaction |
| openclaw message | reactions | --message-id --limit | 查看反应 | openclaw message reactions --channel slack --message-id 123 | 列出某条消息的反应详情 |
| openclaw message | pin | --message-id | 置顶消息 | openclaw message pin --channel discord --target chan_xxx --message-id 123 | 把消息置顶 |
| openclaw message | unpin | --message-id | 取消置顶 | openclaw message unpin --channel discord --target chan_xxx --message-id 123 | 取消置顶 |
| openclaw message | pins | --limit | 查看置顶列表 | openclaw message pins --channel discord --target chan_xxx | 列出当前频道置顶 |
| openclaw message | search | --query --channel-id --author-id | 搜索消息 | openclaw message search --channel discord --query "error" | 按关键字检索消息 |
| openclaw message | permissions | --target --channel | 查看权限 | openclaw message permissions --channel discord --target channel:123 | 查看机器人在该目标上的权限 |
| openclaw message | thread create | --thread-name --message | 新建线程 | openclaw message thread create --channel discord --target chan_xxx --thread-name "讨论" | 创建讨论线程 |
| openclaw message | thread list | --channel-id --limit | 列线程 | openclaw message thread list --channel discord --channel-id 123 | 查看频道线程 |
| openclaw message | thread reply | --message --reply-to | 在线程中回复 | openclaw message thread reply --channel discord --target thread_xxx --message "收到" | 往线程里发送消息 |
| openclaw message | emoji list | --guild-id | 列表情 | openclaw message emoji list --channel discord --guild-id 123 | 查看服务器表情 |
| openclaw message | emoji upload | --emoji-name --media | 上传表情 | openclaw message emoji upload --channel discord --guild-id 123 --emoji-name ok --media ./ok.png | 上传自定义表情 |
| openclaw message | sticker send | --sticker-id | 发贴纸 | openclaw message sticker send --channel discord --target chan_xxx --sticker-id 123 | 发送贴纸 |
| openclaw message | sticker upload | --sticker-name --media | 上传贴纸 | openclaw message sticker upload --channel discord --guild-id 123 --sticker-name wow --media ./wow.png | 上传贴纸资源 |
| openclaw message | channel info | --target | 频道信息 | openclaw message channel info --channel discord --target chan_xxx | 查看频道详情 |
| openclaw message | channel list | --guild-id | 列频道 | openclaw message channel list --channel discord --guild-id 123 | 列出服务器频道 |
| openclaw message | member info | --user-id --guild-id | 成员信息 | openclaw message member info --channel discord --guild-id 123 --user-id 456 | 查看成员信息 |
| openclaw message | voice status | --guild-id --user-id | 语音状态 | openclaw message voice status --channel discord --guild-id 123 --user-id 456 | 查看某成员语音状态 |
| openclaw message | event list | --guild-id | 列活动 | openclaw message event list --channel discord --guild-id 123 | 查看计划活动 |
| openclaw message | event create | --event-name --start-time | 建活动 | openclaw message event create --channel discord --guild-id 123 --event-name "周会" --start-time 2026-03-12T10:00:00 | 创建活动事件 |
| openclaw message | timeout | --guild-id --user-id --duration-min | 禁言成员 | openclaw message timeout --channel discord --guild-id 123 --user-id 456 --duration-min 10 | 对成员进行超时禁言 |
| openclaw message | kick | --guild-id --user-id | 移出成员 | openclaw message kick --channel discord --guild-id 123 --user-id 456 | 踢出成员 |
| openclaw message | ban | --guild-id --user-id | 封禁成员 | openclaw message ban --channel discord --guild-id 123 --user-id 456 | 封禁成员 |
5. Agent / Agents / Sessions
| 命令 | 子命令 | 常用参数 | 中文备注 | 例子 | 详细用途 |
|---|---|---|---|---|---|
| openclaw agent | - | --message/-m --to/-t --agent --channel --deliver --local --thinking --json | 手动跑一轮 agent | openclaw agent -m "hello" --agent main --channel feishu --deliver | 不依赖外部入站消息,直接触发一个 agent turn |
| openclaw agents | list | --json --bindings | 列出 agent | openclaw agents list --bindings --json | 查看有哪些 agent,以及它们的路由绑定 |
| openclaw agents | add | --workspace --model --agent-dir --bind | 新增 agent | openclaw agents add helper --workspace ~/helper-ws --model openai/gpt-4.1 | 新增隔离 agent,可指定独立 workspace |
| openclaw agents | set-identity | --agent --name --theme --emoji --avatar | 设置 agent 身份 | openclaw agents set-identity --agent main --name "Lobster" --emoji "🦞" | 更新 agent 的名称、形象、主题 |
| openclaw agents | delete | --force --json | 删除 agent | openclaw agents delete helper --force | 删除某个 agent 及其状态 |
| openclaw sessions | - | --json --store --active | 查看会话 | openclaw sessions --json --active 60 | 查看最近活跃 session,研究路由和会话落盘很有用 |
6. Memory / Models / System
| 命令 | 子命令 | 常用参数 | 中文备注 | 例子 | 详细用途 |
|---|---|---|---|---|---|
| openclaw memory | status | --agent --json --deep | 查看记忆索引状态 | openclaw memory status --agent main --json | 看 memory 是否已建立索引 |
| openclaw memory | index | --agent --force | 重建记忆索引 | openclaw memory index --agent main --force | 强制重建记忆库索引 |
| openclaw memory | search | --agent --max-results --min-score --json | 搜索记忆 | openclaw memory search "飞书配置" --agent main --json | 在记忆文件中检索相关内容 |
| openclaw models | list | --all --local --provider --json | 列模型 | openclaw models list --provider openai --json | 查看当前模型目录 |
| openclaw models | status | --json --probe --agent | 查看模型状态 | openclaw models status --probe --json | 检查 provider 认证、默认模型、可用性 |
| openclaw models | set | - | 设置默认模型 | openclaw models set openai/gpt-4.1 | 把默认对话模型切换成指定模型 |
| openclaw models | set-image | - | 设置图片模型 | openclaw models set-image openai/gpt-image-1 | 配置默认图像模型 |
| openclaw models | aliases list | --json | 查看别名 | openclaw models aliases list --json | 查看模型别名表 |
| openclaw models | fallbacks list | --json | 查看回退模型 | openclaw models fallbacks list --json | 查看主模型失败时的回退链 |
| openclaw models | scan | --provider --set-default --json | 扫描候选模型 | openclaw models scan --provider openrouter --set-default --json | 自动发现可用模型并设置默认值 |
| openclaw models | auth add | - | 增加认证 | openclaw models auth add | 交互式添加 provider 认证 |
| openclaw models | auth login | --provider --method | 登录 provider | openclaw models auth login --provider google-gemini-cli | 跑 provider 自带登录流程 |
| openclaw models | auth setup-token | --provider | 初始化 token | openclaw models auth setup-token --provider anthropic | 用 CLI 协助建立 token |
| openclaw models | auth paste-token | --provider --profile-id | 粘贴 token | openclaw models auth paste-token --provider openai | 手动把 token 写入认证配置 |
| openclaw system | event | --text --mode --json | 注入系统事件 | openclaw system event --text "重新加载人格" --mode now | 向主 session 注入一条系统事件 |
| openclaw system | heartbeat last | --json | 查看最后心跳 | openclaw system heartbeat last --json | 查看最近一次心跳事件 |
| openclaw system | heartbeat enable | --json | 开启心跳 | openclaw system heartbeat enable | 打开系统心跳机制 |
| openclaw system | heartbeat disable | --json | 关闭心跳 | openclaw system heartbeat disable | 关闭系统心跳 |
| openclaw system | presence | --json | 查看 presence | openclaw system presence --json | 查看系统 presence 条目 |
7. Cron / Hooks / Plugins / Skills
| 命令 | 子命令 | 常用参数 | 中文备注 | 例子 | 详细用途 |
|---|---|---|---|---|---|
| openclaw cron | status | --json | 查看调度器状态 | openclaw cron status --json | 查看 cron 子系统是否运行 |
| openclaw cron | list | --all --json | 列任务 | openclaw cron list --all --json | 查看当前定时任务 |
| openclaw cron | add | --name --message --every --cron --agent --announce | 添加任务 | openclaw cron add --name morning --every 1d --message "早报" --agent main | 周期性触发 agent 或系统事件 |
| openclaw cron | rm | --json | 删除任务 | openclaw cron rm <job-id> | 删除定时任务 |
| openclaw cron | enable | - | 启用任务 | openclaw cron enable <job-id> | 启用某个已禁用任务 |
| openclaw cron | disable | - | 禁用任务 | openclaw cron disable <job-id> | 暂停某个任务 |
| openclaw cron | runs | --id --limit | 查看运行历史 | openclaw cron runs --id <job-id> --limit 20 | 查看任务执行记录 |
| openclaw cron | run | --due | 立即执行 | openclaw cron run --id <job-id> | 手动调试执行某任务 |
| openclaw cron | edit | --name --message --every --enable | 编辑任务 | openclaw cron edit <job-id> --every 2h --enable | 修改任务计划、消息、目标 |
| openclaw hooks | list | --eligible --json --verbose | 列 hooks | openclaw hooks list --verbose | 查看可用和已安装 hooks |
| openclaw hooks | info | --json | hook 详情 | openclaw hooks info my-hook --json | 查看某个 hook 详细信息 |
| openclaw hooks | check | --json | 检查 hook | openclaw hooks check --json | 看是否满足依赖和启用条件 |
| openclaw hooks | enable | - | 启用 hook | openclaw hooks enable my-hook | 让 hook 进入运行状态 |
| openclaw hooks | disable | - | 禁用 hook | openclaw hooks disable my-hook | 停止 hook 生效 |
| openclaw hooks | install | --link | 安装 hook | openclaw hooks install ./my-hook-pack --link | 安装本地 hook 包 |
| openclaw hooks | update | --all --dry-run | 更新 hooks | openclaw hooks update --all | 更新已安装 hooks |
| openclaw plugins | list | --json --enabled --verbose | 列插件 | openclaw plugins list --enabled | 查看插件目录及启用情况 |
| openclaw plugins | info | --json | 插件详情 | openclaw plugins info feishu --json | 查看某插件元信息 |
| openclaw plugins | enable | - | 启用插件 | openclaw plugins enable feishu | 在配置中启用插件 |
| openclaw plugins | disable | - | 禁用插件 | openclaw plugins disable feishu | 在配置中禁用插件 |
| openclaw plugins | install | --link | 安装插件 | openclaw plugins install ./plugin-dir --link | 安装本地或 npm 插件 |
| openclaw plugins | uninstall | --force --dry-run | 卸载插件 | openclaw plugins uninstall feishu --force | 卸载某插件 |
| openclaw plugins | update | --all --dry-run | 更新插件 | openclaw plugins update --all | 更新已安装插件 |
| openclaw plugins | doctor | - | 检查插件问题 | openclaw plugins doctor | 诊断插件加载异常 |
| openclaw skills | list | --json --eligible --verbose | 列技能 | openclaw skills list --eligible | 查看可用 skills |
| openclaw skills | info | --json | 技能详情 | openclaw skills info browser --json | 查看某个 skill 的元信息 |
| openclaw skills | check | --json | 检查技能 | openclaw skills check --json | 看哪些 skills 缺依赖、哪些可直接用 |
8. Browser / Nodes / Devices / Node / Sandbox / TUI
这一组命令非常多,我给你列最常用、最有代表性的。
| 命令 | 子命令 | 常用参数 | 中文备注 | 例子 | 详细用途 |
|---|---|---|---|---|---|
| openclaw browser | status | --json | 浏览器状态 | openclaw browser status --json | 查看 OpenClaw 专用浏览器是否运行 |
| openclaw browser | start | - | 启动浏览器 | openclaw browser start | 启动专用浏览器环境 |
| openclaw browser | stop | - | 停止浏览器 | openclaw browser stop | 停掉浏览器进程 |
| openclaw browser | tabs | - | 列出标签页 | openclaw browser tabs | 查看当前所有打开页面 |
| openclaw browser | open | - | 打开网址 | openclaw browser open https://example.com | 新开一个标签页 |
| openclaw browser | navigate | --target-id | 跳转页面 | openclaw browser navigate https://openai.com | 当前标签页跳转 |
| openclaw browser | screenshot | --full-page --type | 截图 | openclaw browser screenshot --full-page | 获取当前页面截图 |
| openclaw browser | snapshot | --format --limit | 页面结构快照 | openclaw browser snapshot --format ai | 读取页面结构,适合自动化 |
| openclaw browser | click | --target-id | 点击元素 | openclaw browser click REF_12 | 根据快照 ref 点击页面元素 |
| openclaw browser | type | --submit --slowly | 输入文字 | openclaw browser type REF_8 "hello" --submit | 给输入框填内容 |
| openclaw browser | --target-id | 导出 PDF | openclaw browser pdf | 保存页面为 PDF | |
| openclaw browser | console | --level | 控制台日志 | openclaw browser console --level error | 查看页面 JS 错路径读取配置值 |
| openclaw config | set | --json | 设置配置项 | openclaw config set channels.feishu.enabled true --json | 修改某个配置字段,通常直接写入 openclaw.json |
| openclaw config | unset | - | 删除配置项 | openclaw config unset channels.feishu.allowFrom | 删除某个字段,让配置回退默认行为 |
| openclaw doctor | - | --repair --fix --force --deep | 健康检查与修复 | openclaw doctor --repair | 检查网关、配置、渠道、服务是否异常,并尝试修复 |
| openclaw dashboard | - | --no-open | 打开控制台 | openclaw dashboard | 打开控制 UI,用浏览器查看运行状态 |
| openclaw reset | - | --scope --yes --dry-run | 重置本地状态 | openclaw reset --scope config+creds+sessions --yes | 清空配置、凭据、会话,适合重新初始化 |
| openclaw uninstall | - | --service --state --workspace --all | 卸载 OpenClaw 本地环境 | openclaw uninstall --all --yes | 删除服务、状态、工作区,但 CLI 本体可能仍保留 |
2. Gateway / Daemon / 日志
| 命令 | 子命令 | 常用参数 | 中文备注 | 例子 | 详细用途 |
|---|---|---|---|---|---|
| openclaw gateway | run | --port --bind --token --auth --verbose --dev | 前台运行 Gateway | openclaw gateway run --port 18789 --verbose | 启动 WebSocket Gateway,负责 sessions、routing、channels |
| openclaw gateway | status | --json --deep --timeout | 查看网关状态 | openclaw gateway status --json | 查看 Gateway 是否运行、是否可探测 |
| openclaw gateway | install | --port --runtime --token | 安装后台服务 | openclaw gateway install --port 18789 | 把 Gateway 安装成 launchd/systemd/schtasks 服务 |
| openclaw gateway | start | --json | 启动后台服务 | openclaw gateway start | 启动已安装的 Gateway 服务 |
| openclaw gateway | stop | --json | 停止后台服务 | openclaw gateway stop | 停止 Gateway 服务 |
| openclaw gateway | restart | --json | 重启后台服务 | openclaw gateway restart | 修改配置后常用来重启服务 |
| openclaw gateway | call | --params --json | 调用 Gateway RPC | openclaw gateway call some.method --params '{"foo":"bar"}' --json | 直接调用内部 RPC,适合调试 |
| openclaw gateway | health | --json | 获取健康信息 | openclaw gateway health --json | 查看运行健康状态 |
| openclaw gateway | probe | --url --token --json | 探测本地/远程 Gateway | openclaw gateway probe --json | 综合检查网关可达性、探测能力 |
| openclaw gateway | discover | --json | 发现 Gateway | openclaw gateway discover --json | 通过 Bonjour 等方式发现可连接网关 |
| openclaw daemon | status | --json | 查看后台服务状态 | openclaw daemon status | 关注系统服务安装/运行情况 |
| openclaw daemon | install | --port --runtime | 安装后台服务 | openclaw daemon install --port 18789 | 与 gateway install 类似,更偏服务管理 |
| openclaw daemon | start | --json | 启动服务 | openclaw daemon start | 启动后台 Gateway |
| openclaw daemon | stop | --json | 停止服务 | openclaw daemon stop | 停止后台 Gateway |
| openclaw daemon | restart | --json | 重启服务 | openclaw daemon restart | 配置更新后重启 |
| openclaw logs | - | --follow --limit --json --plain | 查看日志 | openclaw logs --follow | 实时查看 Gateway 文件日志,是排障核心命令 |
3. 渠道 / 飞书 / 配对
| 命令 | 子命令 | 常用参数 | 中文备注 | 例子 | 详细用途 |
|---|---|---|---|---|---|
| openclaw channels | list | --json | 列出已配置渠道 | openclaw channels list --json | 查看 Telegram、Feishu、Slack 等账号是否已配置 |
| openclaw channels | status | --probe --json | 查看渠道状态 | openclaw channels status --probe --json | 检查凭据、连接状态是否正常 |
| openclaw channels | capabilities | --channel --account --json | 查看渠道能力 | openclaw channels capabilities --channel feishu --json | 查看该渠道支持哪些消息能力 |
| openclaw channels | resolve | --channel --account --kind --json | 名称解析为 ID | openclaw channels resolve --channel feishu --kind user "张三" | 把用户/群名称解析成内部目标 ID |
| openclaw channels | logs | --channel --lines --json | 查看渠道日志 | openclaw channels logs --channel feishu --lines 200 | 专门看某个渠道的日志片段 |
| openclaw channels | add | --channel --account --name --token --bot-token --app-token | 添加或更新渠道 | openclaw channels add --channel feishu --account main | 为某渠道写入账号配置,飞书、Telegram、Slack 都走这里 |
| openclaw channels | remove | --channel --account --delete | 移除渠道 | openclaw channels remove --channel feishu --account main --delete | 停用或删除某个渠道账号 |
| openclaw channels | login | --channel --account | 渠道登录 | openclaw channels login --channel whatsapp | 某些渠道需要登录链接 |
| openclaw channels | logout | --channel --account | 渠道登出 | openclaw channels logout --channel whatsapp | 断开登录会话 |
| openclaw pairing | list | --channel --json | 查看待审批配对 | openclaw pairing list --channel feishu --json | 对 dmPolicy=pairing 的渠道,列出待审批用户 |
| openclaw pairing | approve | --channel --notify | 批准配对 | openclaw pairing approve ABC123 --channel feishu --notify | 批准某个飞书用户,让其后续消息进入正常 Agent 链路 |
4. 消息操作
| 命令 | 子命令 | 常用参数 | 中文备注 | 例子 | 详细用途 |
|---|---|---|---|---|---|
| openclaw message | send | --message/-m --target/-t --channel --account --media --reply-to | 发送消息 | openclaw message send -m "hello" -t user_xxx --channel feishu | 向某个渠道目标发送消息 |
| openclaw message | broadcast | --targets --message --channel | 批量广播 | openclaw message broadcast --channel feishu --targets u1,u2 --message "通知" | 向多个目标一次性发消息 |
| openclaw message | poll | --poll-question --poll-option | 发起投票 | openclaw message poll --channel discord --target 123 --poll-question "吃什么" --poll-option 火锅 --poll-option 烧烤 | 某些渠道支持原生投票 |
| openclaw message | read | --target --channel --limit --before --after | 读最近消息 | openclaw message read --channel feishu --target user_xxx --limit 20 | 拉取目标最近消息记录 |
| openclaw message | edit | --message-id --message | 编辑消息 | openclaw message edit --channel discord --message-id 123 --message "修正版" | 修改已发送消息 |
| openclaw message | delete | --message-id | 删除消息 | openclaw message delete --channel discord --message-id 123 | 删除指定消息 |
| openclaw message | react | --message-id --emoji --remove | 添加/移除反应 | openclaw message react --channel slack --message-id 123 --emoji 👍 | 对消息加 emoji reaction |
| openclaw message | reactions | --message-id --limit | 查看反应 | openclaw message reactions --channel slack --message-id 123 | 列出某条消息的反应详情 |
| openclaw message | pin | --message-id | 置顶消息 | openclaw message pin --channel discord --target chan_xxx --message-id 123 | 把消息置顶 |
| openclaw message | unpin | --message-id | 取消置顶 | openclaw message unpin --channel discord --target chan_xxx --message-id 123 | 取消置顶 |
| openclaw message | pins | --limit | 查看置顶列表 | openclaw message pins --channel discord --target chan_xxx | 列出当前频道置顶 |
| openclaw message | search | --query --channel-id --author-id | 搜索消息 | openclaw message search --channel discord --query "error" | 按关键字检索消息 |
| openclaw message | permissions | --target --channel | 查看权限 | openclaw message permissions --channel discord --target channel:123 | 查看机器人在该目标上的权限 |
| openclaw message | thread create | --thread-name --message | 新建线程 | openclaw message thread create --channel discord --target chan_xxx --thread-name "讨论" | 创建讨论线程 |
| openclaw message | thread list | --channel-id --limit | 列线程 | openclaw message thread list --channel discord --channel-id 123 | 查看频道线程 |
| openclaw message | thread reply | --message --reply-to | 在线程中回复 | openclaw message thread reply --channel discord --target thread_xxx --message "收到" | 往线程里发送消息 |
| openclaw message | emoji list | --guild-id | 列表情 | openclaw message emoji list --channel discord --guild-id 123 | 查看服务器表情 |
| openclaw message | emoji upload | --emoji-name --media | 上传表情 | openclaw message emoji upload --channel discord --guild-id 123 --emoji-name ok --media ./ok.png | 上传自定义表情 |
| openclaw message | sticker send | --sticker-id | 发贴纸 | openclaw message sticker send --channel discord --target chan_xxx --sticker-id 123 | 发送贴纸 |
| openclaw message | sticker upload | --sticker-name --media | 上传贴纸 | openclaw message sticker upload --channel discord --guild-id 123 --sticker-name wow --media ./wow.png | 上传贴纸资源 |
| openclaw message | channel info | --target | 频道信息 | openclaw message channel info --channel discord --target chan_xxx | 查看频道详情 |
| openclaw message | channel list | --guild-id | 列频道 | openclaw message channel list --channel discord --guild-id 123 | 列出服务器频道 |
| openclaw message | member info | --user-id --guild-id | 成员信息 | openclaw message member info --channel discord --guild-id 123 --user-id 456 | 查看成员信息 |
| openclaw message | voice status | --guild-id --user-id | 语音状态 | openclaw message voice status --channel discord --guild-id 123 --user-id 456 | 查看某成员语音状态 |
| openclaw message | event list | --guild-id | 列活动 | openclaw message event list --channel discord --guild-id 123 | 查看计划活动 |
| openclaw message | event create | --event-name --start-time | 建活动 | openclaw message event create --channel discord --guild-id 123 --event-name "周会" --start-time 2026-03-12T10:00:00 | 创建活动事件 |
| openclaw message | timeout | --guild-id --user-id --duration-min | 禁言成员 | openclaw message timeout --channel discord --guild-id 123 --user-id 456 --duration-min 10 | 对成员进行超时禁言 |
| openclaw message | kick | --guild-id --user-id | 移出成员 | openclaw message kick --channel discord --guild-id 123 --user-id 456 | 踢出成员 |
| openclaw message | ban | --guild-id --user-id | 封禁成员 | openclaw message ban --channel discord --guild-id 123 --user-id 456 | 封禁成员 |
5. Agent / Agents / Sessions
| 命令 | 子命令 | 常用参数 | 中文备注 | 例子 | 详细用途 |
|---|---|---|---|---|---|
| openclaw agent | - | --message/-m --to/-t --agent --channel --deliver --local --thinking --json | 手动跑一轮 agent | openclaw agent -m "hello" --agent main --channel feishu --deliver | 不依赖外部入站消息,直接触发一个 agent turn |
| openclaw agents | list | --json --bindings | 列出 agent | openclaw agents list --bindings --json | 查看有哪些 agent,以及它们的路由绑定 |
| openclaw agents | add | --workspace --model --agent-dir --bind | 新增 agent | openclaw agents add helper --workspace ~/helper-ws --model openai/gpt-4.1 | 新增隔离 agent,可指定独立 workspace |
| openclaw agents | set-identity | --agent --name --theme --emoji --avatar | 设置 agent 身份 | openclaw agents set-identity --agent main --name "Lobster" --emoji "🦞" | 更新 agent 的名称、形象、主题 |
| openclaw agents | delete | --force --json | 删除 agent | openclaw agents delete helper --force | 删除某个 agent 及其状态 |
| openclaw sessions | - | --json --store --active | 查看会话 | openclaw sessions --json --active 60 | 查看最近活跃 session,研究路由和会话落盘很有用 |
6. Memory / Models / System
| 命令 | 子命令 | 常用参数 | 中文备注 | 例子 | 详细用途 |
|---|---|---|---|---|---|
| openclaw memory | status | --agent --json --deep | 查看记忆索引状态 | openclaw memory status --agent main --json | 看 memory 是否已建立索引 |
| openclaw memory | index | --agent --force | 重建记忆索引 | openclaw memory index --agent main --force | 强制重建记忆库索引 |
| openclaw memory | search | --agent --max-results --min-score --json | 搜索记忆 | openclaw memory search "飞书配置" --agent main --json | 在记忆文件中检索相关内容 |
| openclaw models | list | --all --local --provider --json | 列模型 | openclaw models list --provider openai --json | 查看当前模型目录 |
| openclaw models | status | --json --probe --agent | 查看模型状态 | openclaw models status --probe --json | 检查 provider 认证、默认模型、可用性 |
| openclaw models | set | - | 设置默认模型 | openclaw models set openai/gpt-4.1 | 把默认对话模型切换成指定模型 |
| openclaw models | set-image | - | 设置图片模型 | openclaw models set-image openai/gpt-image-1 | 配置默认图像模型 |
| openclaw models | aliases list | --json | 查看别名 | openclaw models aliases list --json | 查看模型别名表 |
| openclaw models | fallbacks list | --json | 查看回退模型 | openclaw models fallbacks list --json | 查看主模型失败时的回退链 |
| openclaw models | scan | --provider --set-default --json | 扫描候选模型 | openclaw models scan --provider openrouter --set-default --json | 自动发现可用模型并设置默认值 |
| openclaw models | auth add | - | 增加认证 | openclaw models auth add | 交互式添加 provider 认证 |
| openclaw models | auth login | --provider --method | 登录 provider | openclaw models auth login --provider google-gemini-cli | 跑 provider 自带登录流程 |
| openclaw models | auth setup-token | --provider | 初始化 token | openclaw models auth setup-token --provider anthropic | 用 CLI 协助建立 token |
| openclaw models | auth paste-token | --provider --profile-id | 粘贴 token | openclaw models auth paste-token --provider openai | 手动把 token 写入认证配置 |
| openclaw system | event | --text --mode --json | 注入系统事件 | openclaw system event --text "重新加载人格" --mode now | 向主 session 注入一条系统事件 |
| openclaw system | heartbeat last | --json | 查看最后心跳 | openclaw system heartbeat last --json | 查看最近一次心跳事件 |
| openclaw system | heartbeat enable | --json | 开启心跳 | openclaw system heartbeat enable | 打开系统心跳机制 |
| openclaw system | heartbeat disable | --json | 关闭心跳 | openclaw system heartbeat disable | 关闭系统心跳 |
| openclaw system | presence | --json | 查看 presence | openclaw system presence --json | 查看系统 presence 条目 |
7. Cron / Hooks / Plugins / Skills
| 命令 | 子命令 | 常用参数 | 中文备注 | 例子 | 详细用途 |
|---|---|---|---|---|---|
| openclaw cron | status | --json | 查看调度器状态 | openclaw cron status --json | 查看 cron 子系统是否运行 |
| openclaw cron | list | --all --json | 列任务 | openclaw cron list --all --json | 查看当前定时任务 |
| openclaw cron | add | --name --message --every --cron --agent --announce | 添加任务 | openclaw cron add --name morning --every 1d --message "早报" --agent main | 周期性触发 agent 或系统事件 |
| openclaw cron | rm | --json | 删除任务 | openclaw cron rm <job-id> | 删除定时任务 |
| openclaw cron | enable | - | 启用任务 | openclaw cron enable <job-id> | 启用某个已禁用任务 |
| openclaw cron | disable | - | 禁用任务 | openclaw cron disable <job-id> | 暂停某个任务 |
| openclaw cron | runs | --id --limit | 查看运行历史 | openclaw cron runs --id <job-id> --limit 20 | 查看任务执行记录 |
| openclaw cron | run | --due | 立即执行 | openclaw cron run --id <job-id> | 手动调试执行某任务 |
| openclaw cron | edit | --name --message --every --enable | 编辑任务 | openclaw cron edit <job-id> --every 2h --enable | 修改任务计划、消息、目标 |
| openclaw hooks | list | --eligible --json --verbose | 列 hooks | openclaw hooks list --verbose | 查看可用和已安装 hooks |
| openclaw hooks | info | --json | hook 详情 | openclaw hooks info my-hook --json | 查看某个 hook 详细信息 |
| openclaw hooks | check | --json | 检查 hook | openclaw hooks check --json | 看是否满足依赖和启用条件 |
| openclaw hooks | enable | - | 启用 hook | openclaw hooks enable my-hook | 让 hook 进入运行状态 |
| openclaw hooks | disable | - | 禁用 hook | openclaw hooks disable my-hook | 停止 hook 生效 |
| openclaw hooks | install | --link | 安装 hook | openclaw hooks install ./my-hook-pack --link | 安装本地 hook 包 |
| openclaw hooks | update | --all --dry-run | 更新 hooks | openclaw hooks update --all | 更新已安装 hooks |
| openclaw plugins | list | --json --enabled --verbose | 列插件 | openclaw plugins list --enabled | 查看插件目录及启用情况 |
| openclaw plugins | info | --json | 插件详情 | openclaw plugins info feishu --json | 查看某插件元信息 |
| openclaw plugins | enable | - | 启用插件 | openclaw plugins enable feishu | 在配置中启用插件 |
| openclaw plugins | disable | - | 禁用插件 | openclaw plugins disable feishu | 在配置中禁用插件 |
| openclaw plugins | install | --link | 安装插件 | openclaw plugins install ./plugin-dir --link | 安装本地或 npm 插件 |
| openclaw plugins | uninstall | --force --dry-run | 卸载插件 | openclaw plugins uninstall feishu --force | 卸载某插件 |
| openclaw plugins | update | --all --dry-run | 更新插件 | openclaw plugins update --all | 更新已安装插件 |
| openclaw plugins | doctor | - | 检查插件问题 | openclaw plugins doctor | 诊断插件加载异常 |
| openclaw skills | list | --json --eligible --verbose | 列技能 | openclaw skills list --eligible | 查看可用 skills |
| openclaw skills | info | --json | 技能详情 | openclaw skills info browser --json | 查看某个 skill 的元信息 |
| openclaw skills | check | --json | 检查技能 | openclaw skills check --json | 看哪些 skills 缺依赖、哪些可直接用 |
8. Browser / Nodes / Devices / Node / Sandbox / TUI
这一组命令非常多,我给你列最常用、最有代表性的。
| 命令 | 子命令 | 常用参数 | 中文备注 | 例子 | 详细用途 |
|---|---|---|---|---|---|
| openclaw browser | status | --json | 浏览器状态 | openclaw browser status --json | 查看 OpenClaw 专用浏览器是否运行 |
| openclaw browser | start | - | 启动浏览器 | openclaw browser start | 启动专用浏览器环境 |
| openclaw browser | stop | - | 停止浏览器 | openclaw browser stop | 停掉浏览器进程 |
| openclaw browser | tabs | - | 列出标签页 | openclaw browser tabs | 查看当前所有打开页面 |
| openclaw browser | open | - | 打开网址 | openclaw browser open https://example.com | 新开一个标签页 |
| openclaw browser | navigate | --target-id | 跳转页面 | openclaw browser navigate https://openai.com | 当前标签页跳转 |
| openclaw browser | screenshot | --full-page --type | 截图 | openclaw browser screenshot --full-page | 获取当前页面截图 |
| openclaw browser | snapshot | --format --limit | 页面结构快照 | openclaw browser snapshot --format ai | 读取页面结构,适合自动化 |
| openclaw browser | click | --target-id | 点击元素 | openclaw browser click REF_12 | 根据快照 ref 点击页面元素 |
| openclaw browser | type | --submit --slowly | 输入文字 | openclaw browser type REF_8 "hello" --submit | 给输入框填内容 |
| openclaw browser | --target-id | 导出 PDF | openclaw browser pdf | 保存页面为 PDF | |
| openclaw browser | console | --level | 控制台日志 | openclaw browser console --level error | 查看页面 JS 错误 |
| openclaw nodes | status | --json | 节点状态 | openclaw nodes status --json | 查看已知节点连接情况 |
| openclaw nodes | pending | --json | 待审批节点 | openclaw nodes pending --json | 查看待配对节点 |
| openclaw nodes | approve | --json | 批准节点 | openclaw nodes approve <node-id> | 批准一个新节点接入 |
| openclaw nodes | run | --node --raw --agent | 在节点上执行命令 | openclaw nodes run --node mac-mini --raw "ls -la" | 在远端节点执行 shell 命令 |
| openclaw nodes | notify | --node --title --body | 本地通知 | openclaw nodes notify --node mac-mini --title "提醒" --body "任务完成" | 给节点机器发本地通知 |
| openclaw nodes | canvas snapshot | --node | 画布快照 | openclaw nodes canvas snapshot --node mac-mini | 获取节点上的 canvas 快照 |
| openclaw nodes | camera snap | --node | 拍照 | openclaw nodes camera snap --node iphone | 调用节点摄像头拍照 |
| openclaw nodes | screen record | --node --duration | 录屏 | openclaw nodes screen record --node mac-mini --duration 10s | 远程录屏 |
| openclaw devices | list | --json | 查看设备 | openclaw devices list --json | 查看待配对和已配对设备 |
| openclaw devices | approve | --json | 批准设备 | openclaw devices approve <device-id> | 允许设备接入 |
| openclaw devices | reject | --json | 拒绝设备 | openclaw devices reject <device-id> | 拒绝设备接入 |
| openclaw devices | rotate | --device --role | 轮换 token | openclaw devices rotate --device ipad --role viewer | 更新设备 token |
| openclaw devices | revoke | --device --role | 撤销 token | openclaw devices revoke --device ipad --role viewer | 撤销设备访问权 |
| openclaw node | run | --host --port | 运行 headless node | openclaw node run --host 127.0.0.1 --port 18789 | 启动 headless node host |
| openclaw node | status | --json | 查看 node 状态 | openclaw node status --json | 查看本机 node host 状态 |
| openclaw sandbox | list | --json --browser | 列沙箱 | openclaw sandbox list --json | 查看 agent/browser 的容器沙箱 |
| openclaw sandbox | recreate | --all --agent --session | 重建沙箱 | openclaw sandbox recreate --all --force | 删除旧容器并重建 |
| openclaw sandbox | explain | --session --agent --json | 解释策略 | openclaw sandbox explain --agent main --json | 看当前 session/agent 生效的沙箱与工具策略 |
| openclaw tui | - | --url --token --session --deliver --message | 打开终端 UI | openclaw tui --session main --message "hello" | 在终端里连接 Gateway 进行对话 |
9. DNS / Docs / Webhooks / Directory / Security / Update
| 命令 | 子命令 | 常用参数 | 中文备注 | 例子 | 详细用途 |
|---|---|---|---|---|---|
| openclaw dns | setup | --domain --apply | 配置 DNS 发现 | openclaw dns setup --domain openclaw.internal --apply | 配置 CoreDNS / 宽域服务发现 |
| openclaw docs | - | - | 搜索官方文档 | openclaw docs | 直接查 OpenClaw 在线文档 |
| openclaw webhooks | gmail setup | --account --project --topic --hook-url | 配置 Gmail webhook | openclaw webhooks gmail setup --account me@gmail.com --project my-gcp-proj | 配置 Gmail Pub/Sub 与 OpenClaw hook |
| openclaw webhooks | gmail run | --account --topic --hook-url | 运行 Gmail watch | openclaw webhooks gmail run --account me@gmail.com --topic projects/x/topics/y | 启动 Gmail 监听与推送循环 |
| openclaw directory | self | --channel --account --json | 查看当前账号 | openclaw directory self --channel feishu --json | 查询机器人/当前账号自身信息 |
| openclaw directory | peers list | --query --limit | 列联系人 | openclaw directory peers list --channel feishu --query 张 --limit 10 | 搜索联系人/同事 |
| openclaw directory | groups list | --query --limit | 列群组 | openclaw directory groups list --channel feishu --query 产品 | 搜索群组 |
| openclaw directory | groups members | --group-id --limit | 列群成员 | openclaw directory groups members --channel feishu --group-id grp_xxx | 查看群成员 |
| openclaw security | audit | --deep --fix --json | 安全审计 | openclaw security audit --deep --json | 审计配置、权限和常见安全风险 |
| openclaw update | wizard | --timeout | 交互式更新 | openclaw update wizard | 通过向导更新 OpenClaw |
| openclaw update | status | --json --timeout | 查看更新状态 | openclaw update status --json | 查看当前版本与更新通道 |
10. 你现在最值得先记住的“飞书工作流命令组”
如果你现在的重点是 研究 OpenClaw + 飞书 的运行链路,建议优先记下面这组:
| 命令 | 子命令 | 例子 | 用途 |
|---|---|---|---|
| openclaw gateway | status | openclaw gateway status | 先确认 Gateway 是否活着 |
| openclaw logs | - | openclaw logs --follow | 实时看飞书消息有没有打进来 |
| openclaw channels | list | openclaw channels list --json | 确认飞书渠道已配置 |
| openclaw channels | status | openclaw channels status --probe --json | 检查飞书连接状态 |
| openclaw pairing | list | openclaw pairing list --channel feishu | 看第一次私聊是否进了 pairing |
| openclaw pairing | approve | openclaw pairing approve ABC123 --channel feishu --notify | 批准用户后才会进入正常会话 |
| openclaw sessions | - | openclaw sessions --json | 看有没有生成 session |
| openclaw agent | - | openclaw agent -m "hello" --agent main --channel feishu --deliver | 手工触发一次 agent 运行 |
| openclaw message | send | openclaw message send -m "测试" -t user_xxx --channel feishu | 直接往飞书发消息,排除 agent 问题 |
| openclaw channels | logs | openclaw channels logs --channel feishu --lines 200 | 看飞书插件日志 |
11. 一份最实用的排障顺序
你可以直接按这个顺序排查:
openclaw gateway status openclaw channels list --json openclaw channels status --probe --json openclaw pairing list --channel feishu openclaw sessions --json openclaw logs --follow
这 6 条命令基本能把:
- 网关是否运行
- 飞书是否接通
- 用户是否卡在 pairing
- 是否落到了 session
- 日志里是否报错
全部串起来。
到此这篇关于OpenClaw CLI 命令速查手册(中文注释+示例版)的文章就介绍到这了,更多相关OpenClaw CLI 命令内容请搜索脚本之家以前的文章或继续浏览下面的相关文章,希望大家以后多多支持脚本之家!
相关文章

OpenClaw常用操作命令完整速查手册:从入门到精通的终端 CLI & 聊
作为 OpenClaw 生态(包括 PicoClaw、ZeroClaw、losterAI、EasyClaw 等系列开源应用)的核心用户,我根据开源资料和个人使用体验整理了这份全网最全的命令速查手册2026-03-09



最新评论