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 configget--json读取配置项openclaw config get channels.feishu.enabled按点路径读取配置值
openclaw configset--json设置配置项openclaw config set channels.feishu.enabled true --json修改某个配置字段,通常直接写入 openclaw.json
openclaw configunset-删除配置项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 gatewayrun--port --bind --token --auth --verbose --dev前台运行 Gatewayopenclaw gateway run --port 18789 --verbose启动 WebSocket Gateway,负责 sessions、routing、channels
openclaw gatewaystatus--json --deep --timeout查看网关状态openclaw gateway status --json查看 Gateway 是否运行、是否可探测
openclaw gatewayinstall--port --runtime --token安装后台服务openclaw gateway install --port 18789把 Gateway 安装成 launchd/systemd/schtasks 服务
openclaw gatewaystart--json启动后台服务openclaw gateway start启动已安装的 Gateway 服务
openclaw gatewaystop--json停止后台服务openclaw gateway stop停止 Gateway 服务
openclaw gatewayrestart--json重启后台服务openclaw gateway restart修改配置后常用来重启服务
openclaw gatewaycall--params --json调用 Gateway RPCopenclaw gateway call some.method --params '{"foo":"bar"}' --json直接调用内部 RPC,适合调试
openclaw gatewayhealth--json获取健康信息openclaw gateway health --json查看运行健康状态
openclaw gatewayprobe--url --token --json探测本地/远程 Gatewayopenclaw gateway probe --json综合检查网关可达性、探测能力
openclaw gatewaydiscover--json发现 Gatewayopenclaw gateway discover --json通过 Bonjour 等方式发现可连接网关
openclaw daemonstatus--json查看后台服务状态openclaw daemon status关注系统服务安装/运行情况
openclaw daemoninstall--port --runtime安装后台服务openclaw daemon install --port 18789与 gateway install 类似,更偏服务管理
openclaw daemonstart--json启动服务openclaw daemon start启动后台 Gateway
openclaw daemonstop--json停止服务openclaw daemon stop停止后台 Gateway
openclaw daemonrestart--json重启服务openclaw daemon restart配置更新后重启
openclaw logs---follow --limit --json --plain查看日志openclaw logs --follow实时查看 Gateway 文件日志,是排障核心命令

3. 渠道 / 飞书 / 配对

命令子命令常用参数中文备注例子详细用途
openclaw channelslist--json列出已配置渠道openclaw channels list --json查看 Telegram、Feishu、Slack 等账号是否已配置
openclaw channelsstatus--probe --json查看渠道状态openclaw channels status --probe --json检查凭据、连接状态是否正常
openclaw channelscapabilities--channel --account --json查看渠道能力openclaw channels capabilities --channel feishu --json查看该渠道支持哪些消息能力
openclaw channelsresolve--channel --account --kind --json名称解析为 IDopenclaw channels resolve --channel feishu --kind user "张三"把用户/群名称解析成内部目标 ID
openclaw channelslogs--channel --lines --json查看渠道日志openclaw channels logs --channel feishu --lines 200专门看某个渠道的日志片段
openclaw channelsadd--channel --account --name --token --bot-token --app-token添加或更新渠道openclaw channels add --channel feishu --account main为某渠道写入账号配置,飞书、Telegram、Slack 都走这里
openclaw channelsremove--channel --account --delete移除渠道openclaw channels remove --channel feishu --account main --delete停用或删除某个渠道账号
openclaw channelslogin--channel --account渠道登录openclaw channels login --channel whatsapp某些渠道需要登录链接
openclaw channelslogout--channel --account渠道登出openclaw channels logout --channel whatsapp断开登录会话
openclaw pairinglist--channel --json查看待审批配对openclaw pairing list --channel feishu --json对 dmPolicy=pairing 的渠道,列出待审批用户
openclaw pairingapprove--channel --notify批准配对openclaw pairing approve ABC123 --channel feishu --notify批准某个飞书用户,让其后续消息进入正常 Agent 链路

4. 消息操作

命令子命令常用参数中文备注例子详细用途
openclaw messagesend--message/-m --target/-t --channel --account --media --reply-to发送消息openclaw message send -m "hello" -t user_xxx --channel feishu向某个渠道目标发送消息
openclaw messagebroadcast--targets --message --channel批量广播openclaw message broadcast --channel feishu --targets u1,u2 --message "通知"向多个目标一次性发消息
openclaw messagepoll--poll-question --poll-option发起投票openclaw message poll --channel discord --target 123 --poll-question "吃什么" --poll-option 火锅 --poll-option 烧烤某些渠道支持原生投票
openclaw messageread--target --channel --limit --before --after读最近消息openclaw message read --channel feishu --target user_xxx --limit 20拉取目标最近消息记录
openclaw messageedit--message-id --message编辑消息openclaw message edit --channel discord --message-id 123 --message "修正版"修改已发送消息
openclaw messagedelete--message-id删除消息openclaw message delete --channel discord --message-id 123删除指定消息
openclaw messagereact--message-id --emoji --remove添加/移除反应openclaw message react --channel slack --message-id 123 --emoji 👍对消息加 emoji reaction
openclaw messagereactions--message-id --limit查看反应openclaw message reactions --channel slack --message-id 123列出某条消息的反应详情
openclaw messagepin--message-id置顶消息openclaw message pin --channel discord --target chan_xxx --message-id 123把消息置顶
openclaw messageunpin--message-id取消置顶openclaw message unpin --channel discord --target chan_xxx --message-id 123取消置顶
openclaw messagepins--limit查看置顶列表openclaw message pins --channel discord --target chan_xxx列出当前频道置顶
openclaw messagesearch--query --channel-id --author-id搜索消息openclaw message search --channel discord --query "error"按关键字检索消息
openclaw messagepermissions--target --channel查看权限openclaw message permissions --channel discord --target channel:123查看机器人在该目标上的权限
openclaw messagethread create--thread-name --message新建线程openclaw message thread create --channel discord --target chan_xxx --thread-name "讨论"创建讨论线程
openclaw messagethread list--channel-id --limit列线程openclaw message thread list --channel discord --channel-id 123查看频道线程
openclaw messagethread reply--message --reply-to在线程中回复openclaw message thread reply --channel discord --target thread_xxx --message "收到"往线程里发送消息
openclaw messageemoji list--guild-id列表情openclaw message emoji list --channel discord --guild-id 123查看服务器表情
openclaw messageemoji upload--emoji-name --media上传表情openclaw message emoji upload --channel discord --guild-id 123 --emoji-name ok --media ./ok.png上传自定义表情
openclaw messagesticker send--sticker-id发贴纸openclaw message sticker send --channel discord --target chan_xxx --sticker-id 123发送贴纸
openclaw messagesticker upload--sticker-name --media上传贴纸openclaw message sticker upload --channel discord --guild-id 123 --sticker-name wow --media ./wow.png上传贴纸资源
openclaw messagechannel info--target频道信息openclaw message channel info --channel discord --target chan_xxx查看频道详情
openclaw messagechannel list--guild-id列频道openclaw message channel list --channel discord --guild-id 123列出服务器频道
openclaw messagemember info--user-id --guild-id成员信息openclaw message member info --channel discord --guild-id 123 --user-id 456查看成员信息
openclaw messagevoice status--guild-id --user-id语音状态openclaw message voice status --channel discord --guild-id 123 --user-id 456查看某成员语音状态
openclaw messageevent list--guild-id列活动openclaw message event list --channel discord --guild-id 123查看计划活动
openclaw messageevent create--event-name --start-time建活动openclaw message event create --channel discord --guild-id 123 --event-name "周会" --start-time 2026-03-12T10:00:00创建活动事件
openclaw messagetimeout--guild-id --user-id --duration-min禁言成员openclaw message timeout --channel discord --guild-id 123 --user-id 456 --duration-min 10对成员进行超时禁言
openclaw messagekick--guild-id --user-id移出成员openclaw message kick --channel discord --guild-id 123 --user-id 456踢出成员
openclaw messageban--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手动跑一轮 agentopenclaw agent -m "hello" --agent main --channel feishu --deliver不依赖外部入站消息,直接触发一个 agent turn
openclaw agentslist--json --bindings列出 agentopenclaw agents list --bindings --json查看有哪些 agent,以及它们的路由绑定
openclaw agentsadd--workspace --model --agent-dir --bind新增 agentopenclaw agents add helper --workspace ~/helper-ws --model openai/gpt-4.1新增隔离 agent,可指定独立 workspace
openclaw agentsset-identity--agent --name --theme --emoji --avatar设置 agent 身份openclaw agents set-identity --agent main --name "Lobster" --emoji "🦞"更新 agent 的名称、形象、主题
openclaw agentsdelete--force --json删除 agentopenclaw agents delete helper --force删除某个 agent 及其状态
openclaw sessions---json --store --active查看会话openclaw sessions --json --active 60查看最近活跃 session,研究路由和会话落盘很有用

6. Memory / Models / System

命令子命令常用参数中文备注例子详细用途
openclaw memorystatus--agent --json --deep查看记忆索引状态openclaw memory status --agent main --json看 memory 是否已建立索引
openclaw memoryindex--agent --force重建记忆索引openclaw memory index --agent main --force强制重建记忆库索引
openclaw memorysearch--agent --max-results --min-score --json搜索记忆openclaw memory search "飞书配置" --agent main --json在记忆文件中检索相关内容
openclaw modelslist--all --local --provider --json列模型openclaw models list --provider openai --json查看当前模型目录
openclaw modelsstatus--json --probe --agent查看模型状态openclaw models status --probe --json检查 provider 认证、默认模型、可用性
openclaw modelsset-设置默认模型openclaw models set openai/gpt-4.1把默认对话模型切换成指定模型
openclaw modelsset-image-设置图片模型openclaw models set-image openai/gpt-image-1配置默认图像模型
openclaw modelsaliases list--json查看别名openclaw models aliases list --json查看模型别名表
openclaw modelsfallbacks list--json查看回退模型openclaw models fallbacks list --json查看主模型失败时的回退链
openclaw modelsscan--provider --set-default --json扫描候选模型openclaw models scan --provider openrouter --set-default --json自动发现可用模型并设置默认值
openclaw modelsauth add-增加认证openclaw models auth add交互式添加 provider 认证
openclaw modelsauth login--provider --method登录 provideropenclaw models auth login --provider google-gemini-cli跑 provider 自带登录流程
openclaw modelsauth setup-token--provider初始化 tokenopenclaw models auth setup-token --provider anthropic用 CLI 协助建立 token
openclaw modelsauth paste-token--provider --profile-id粘贴 tokenopenclaw models auth paste-token --provider openai手动把 token 写入认证配置
openclaw systemevent--text --mode --json注入系统事件openclaw system event --text "重新加载人格" --mode now向主 session 注入一条系统事件
openclaw systemheartbeat last--json查看最后心跳openclaw system heartbeat last --json查看最近一次心跳事件
openclaw systemheartbeat enable--json开启心跳openclaw system heartbeat enable打开系统心跳机制
openclaw systemheartbeat disable--json关闭心跳openclaw system heartbeat disable关闭系统心跳
openclaw systempresence--json查看 presenceopenclaw system presence --json查看系统 presence 条目

7. Cron / Hooks / Plugins / Skills

命令子命令常用参数中文备注例子详细用途
openclaw cronstatus--json查看调度器状态openclaw cron status --json查看 cron 子系统是否运行
openclaw cronlist--all --json列任务openclaw cron list --all --json查看当前定时任务
openclaw cronadd--name --message --every --cron --agent --announce添加任务openclaw cron add --name morning --every 1d --message "早报" --agent main周期性触发 agent 或系统事件
openclaw cronrm--json删除任务openclaw cron rm <job-id>删除定时任务
openclaw cronenable-启用任务openclaw cron enable <job-id>启用某个已禁用任务
openclaw crondisable-禁用任务openclaw cron disable <job-id>暂停某个任务
openclaw cronruns--id --limit查看运行历史openclaw cron runs --id <job-id> --limit 20查看任务执行记录
openclaw cronrun--due立即执行openclaw cron run --id <job-id>手动调试执行某任务
openclaw cronedit--name --message --every --enable编辑任务openclaw cron edit <job-id> --every 2h --enable修改任务计划、消息、目标
openclaw hookslist--eligible --json --verbose列 hooksopenclaw hooks list --verbose查看可用和已安装 hooks
openclaw hooksinfo--jsonhook 详情openclaw hooks info my-hook --json查看某个 hook 详细信息
openclaw hookscheck--json检查 hookopenclaw hooks check --json看是否满足依赖和启用条件
openclaw hooksenable-启用 hookopenclaw hooks enable my-hook让 hook 进入运行状态
openclaw hooksdisable-禁用 hookopenclaw hooks disable my-hook停止 hook 生效
openclaw hooksinstall--link安装 hookopenclaw hooks install ./my-hook-pack --link安装本地 hook 包
openclaw hooksupdate--all --dry-run更新 hooksopenclaw hooks update --all更新已安装 hooks
openclaw pluginslist--json --enabled --verbose列插件openclaw plugins list --enabled查看插件目录及启用情况
openclaw pluginsinfo--json插件详情openclaw plugins info feishu --json查看某插件元信息
openclaw pluginsenable-启用插件openclaw plugins enable feishu在配置中启用插件
openclaw pluginsdisable-禁用插件openclaw plugins disable feishu在配置中禁用插件
openclaw pluginsinstall--link安装插件openclaw plugins install ./plugin-dir --link安装本地或 npm 插件
openclaw pluginsuninstall--force --dry-run卸载插件openclaw plugins uninstall feishu --force卸载某插件
openclaw pluginsupdate--all --dry-run更新插件openclaw plugins update --all更新已安装插件
openclaw pluginsdoctor-检查插件问题openclaw plugins doctor诊断插件加载异常
openclaw skillslist--json --eligible --verbose列技能openclaw skills list --eligible查看可用 skills
openclaw skillsinfo--json技能详情openclaw skills info browser --json查看某个 skill 的元信息
openclaw skillscheck--json检查技能openclaw skills check --json看哪些 skills 缺依赖、哪些可直接用

8. Browser / Nodes / Devices / Node / Sandbox / TUI

这一组命令非常多,我给你列最常用、最有代表性的。

命令子命令常用参数中文备注例子详细用途
openclaw browserstatus--json浏览器状态openclaw browser status --json查看 OpenClaw 专用浏览器是否运行
openclaw browserstart-启动浏览器openclaw browser start启动专用浏览器环境
openclaw browserstop-停止浏览器openclaw browser stop停掉浏览器进程
openclaw browsertabs-列出标签页openclaw browser tabs查看当前所有打开页面
openclaw browseropen-打开网址openclaw browser open https://example.com新开一个标签页
openclaw browsernavigate--target-id跳转页面openclaw browser navigate https://openai.com当前标签页跳转
openclaw browserscreenshot--full-page --type截图openclaw browser screenshot --full-page获取当前页面截图
openclaw browsersnapshot--format --limit页面结构快照openclaw browser snapshot --format ai读取页面结构,适合自动化
openclaw browserclick--target-id点击元素openclaw browser click REF_12根据快照 ref 点击页面元素
openclaw browsertype--submit --slowly输入文字openclaw browser type REF_8 "hello" --submit给输入框填内容
openclaw browserpdf--target-id导出 PDFopenclaw browser pdf保存页面为 PDF
openclaw browserconsole--level控制台日志openclaw browser console --level error查看页面 JS 错路径读取配置值
openclaw configset--json设置配置项openclaw config set channels.feishu.enabled true --json修改某个配置字段,通常直接写入 openclaw.json
openclaw configunset-删除配置项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 gatewayrun--port --bind --token --auth --verbose --dev前台运行 Gatewayopenclaw gateway run --port 18789 --verbose启动 WebSocket Gateway,负责 sessions、routing、channels
openclaw gatewaystatus--json --deep --timeout查看网关状态openclaw gateway status --json查看 Gateway 是否运行、是否可探测
openclaw gatewayinstall--port --runtime --token安装后台服务openclaw gateway install --port 18789把 Gateway 安装成 launchd/systemd/schtasks 服务
openclaw gatewaystart--json启动后台服务openclaw gateway start启动已安装的 Gateway 服务
openclaw gatewaystop--json停止后台服务openclaw gateway stop停止 Gateway 服务
openclaw gatewayrestart--json重启后台服务openclaw gateway restart修改配置后常用来重启服务
openclaw gatewaycall--params --json调用 Gateway RPCopenclaw gateway call some.method --params '{"foo":"bar"}' --json直接调用内部 RPC,适合调试
openclaw gatewayhealth--json获取健康信息openclaw gateway health --json查看运行健康状态
openclaw gatewayprobe--url --token --json探测本地/远程 Gatewayopenclaw gateway probe --json综合检查网关可达性、探测能力
openclaw gatewaydiscover--json发现 Gatewayopenclaw gateway discover --json通过 Bonjour 等方式发现可连接网关
openclaw daemonstatus--json查看后台服务状态openclaw daemon status关注系统服务安装/运行情况
openclaw daemoninstall--port --runtime安装后台服务openclaw daemon install --port 18789与 gateway install 类似,更偏服务管理
openclaw daemonstart--json启动服务openclaw daemon start启动后台 Gateway
openclaw daemonstop--json停止服务openclaw daemon stop停止后台 Gateway
openclaw daemonrestart--json重启服务openclaw daemon restart配置更新后重启
openclaw logs---follow --limit --json --plain查看日志openclaw logs --follow实时查看 Gateway 文件日志,是排障核心命令

3. 渠道 / 飞书 / 配对

命令子命令常用参数中文备注例子详细用途
openclaw channelslist--json列出已配置渠道openclaw channels list --json查看 Telegram、Feishu、Slack 等账号是否已配置
openclaw channelsstatus--probe --json查看渠道状态openclaw channels status --probe --json检查凭据、连接状态是否正常
openclaw channelscapabilities--channel --account --json查看渠道能力openclaw channels capabilities --channel feishu --json查看该渠道支持哪些消息能力
openclaw channelsresolve--channel --account --kind --json名称解析为 IDopenclaw channels resolve --channel feishu --kind user "张三"把用户/群名称解析成内部目标 ID
openclaw channelslogs--channel --lines --json查看渠道日志openclaw channels logs --channel feishu --lines 200专门看某个渠道的日志片段
openclaw channelsadd--channel --account --name --token --bot-token --app-token添加或更新渠道openclaw channels add --channel feishu --account main为某渠道写入账号配置,飞书、Telegram、Slack 都走这里
openclaw channelsremove--channel --account --delete移除渠道openclaw channels remove --channel feishu --account main --delete停用或删除某个渠道账号
openclaw channelslogin--channel --account渠道登录openclaw channels login --channel whatsapp某些渠道需要登录链接
openclaw channelslogout--channel --account渠道登出openclaw channels logout --channel whatsapp断开登录会话
openclaw pairinglist--channel --json查看待审批配对openclaw pairing list --channel feishu --json对 dmPolicy=pairing 的渠道,列出待审批用户
openclaw pairingapprove--channel --notify批准配对openclaw pairing approve ABC123 --channel feishu --notify批准某个飞书用户,让其后续消息进入正常 Agent 链路

4. 消息操作

命令子命令常用参数中文备注例子详细用途
openclaw messagesend--message/-m --target/-t --channel --account --media --reply-to发送消息openclaw message send -m "hello" -t user_xxx --channel feishu向某个渠道目标发送消息
openclaw messagebroadcast--targets --message --channel批量广播openclaw message broadcast --channel feishu --targets u1,u2 --message "通知"向多个目标一次性发消息
openclaw messagepoll--poll-question --poll-option发起投票openclaw message poll --channel discord --target 123 --poll-question "吃什么" --poll-option 火锅 --poll-option 烧烤某些渠道支持原生投票
openclaw messageread--target --channel --limit --before --after读最近消息openclaw message read --channel feishu --target user_xxx --limit 20拉取目标最近消息记录
openclaw messageedit--message-id --message编辑消息openclaw message edit --channel discord --message-id 123 --message "修正版"修改已发送消息
openclaw messagedelete--message-id删除消息openclaw message delete --channel discord --message-id 123删除指定消息
openclaw messagereact--message-id --emoji --remove添加/移除反应openclaw message react --channel slack --message-id 123 --emoji 👍对消息加 emoji reaction
openclaw messagereactions--message-id --limit查看反应openclaw message reactions --channel slack --message-id 123列出某条消息的反应详情
openclaw messagepin--message-id置顶消息openclaw message pin --channel discord --target chan_xxx --message-id 123把消息置顶
openclaw messageunpin--message-id取消置顶openclaw message unpin --channel discord --target chan_xxx --message-id 123取消置顶
openclaw messagepins--limit查看置顶列表openclaw message pins --channel discord --target chan_xxx列出当前频道置顶
openclaw messagesearch--query --channel-id --author-id搜索消息openclaw message search --channel discord --query "error"按关键字检索消息
openclaw messagepermissions--target --channel查看权限openclaw message permissions --channel discord --target channel:123查看机器人在该目标上的权限
openclaw messagethread create--thread-name --message新建线程openclaw message thread create --channel discord --target chan_xxx --thread-name "讨论"创建讨论线程
openclaw messagethread list--channel-id --limit列线程openclaw message thread list --channel discord --channel-id 123查看频道线程
openclaw messagethread reply--message --reply-to在线程中回复openclaw message thread reply --channel discord --target thread_xxx --message "收到"往线程里发送消息
openclaw messageemoji list--guild-id列表情openclaw message emoji list --channel discord --guild-id 123查看服务器表情
openclaw messageemoji upload--emoji-name --media上传表情openclaw message emoji upload --channel discord --guild-id 123 --emoji-name ok --media ./ok.png上传自定义表情
openclaw messagesticker send--sticker-id发贴纸openclaw message sticker send --channel discord --target chan_xxx --sticker-id 123发送贴纸
openclaw messagesticker upload--sticker-name --media上传贴纸openclaw message sticker upload --channel discord --guild-id 123 --sticker-name wow --media ./wow.png上传贴纸资源
openclaw messagechannel info--target频道信息openclaw message channel info --channel discord --target chan_xxx查看频道详情
openclaw messagechannel list--guild-id列频道openclaw message channel list --channel discord --guild-id 123列出服务器频道
openclaw messagemember info--user-id --guild-id成员信息openclaw message member info --channel discord --guild-id 123 --user-id 456查看成员信息
openclaw messagevoice status--guild-id --user-id语音状态openclaw message voice status --channel discord --guild-id 123 --user-id 456查看某成员语音状态
openclaw messageevent list--guild-id列活动openclaw message event list --channel discord --guild-id 123查看计划活动
openclaw messageevent create--event-name --start-time建活动openclaw message event create --channel discord --guild-id 123 --event-name "周会" --start-time 2026-03-12T10:00:00创建活动事件
openclaw messagetimeout--guild-id --user-id --duration-min禁言成员openclaw message timeout --channel discord --guild-id 123 --user-id 456 --duration-min 10对成员进行超时禁言
openclaw messagekick--guild-id --user-id移出成员openclaw message kick --channel discord --guild-id 123 --user-id 456踢出成员
openclaw messageban--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手动跑一轮 agentopenclaw agent -m "hello" --agent main --channel feishu --deliver不依赖外部入站消息,直接触发一个 agent turn
openclaw agentslist--json --bindings列出 agentopenclaw agents list --bindings --json查看有哪些 agent,以及它们的路由绑定
openclaw agentsadd--workspace --model --agent-dir --bind新增 agentopenclaw agents add helper --workspace ~/helper-ws --model openai/gpt-4.1新增隔离 agent,可指定独立 workspace
openclaw agentsset-identity--agent --name --theme --emoji --avatar设置 agent 身份openclaw agents set-identity --agent main --name "Lobster" --emoji "🦞"更新 agent 的名称、形象、主题
openclaw agentsdelete--force --json删除 agentopenclaw agents delete helper --force删除某个 agent 及其状态
openclaw sessions---json --store --active查看会话openclaw sessions --json --active 60查看最近活跃 session,研究路由和会话落盘很有用

6. Memory / Models / System

命令子命令常用参数中文备注例子详细用途
openclaw memorystatus--agent --json --deep查看记忆索引状态openclaw memory status --agent main --json看 memory 是否已建立索引
openclaw memoryindex--agent --force重建记忆索引openclaw memory index --agent main --force强制重建记忆库索引
openclaw memorysearch--agent --max-results --min-score --json搜索记忆openclaw memory search "飞书配置" --agent main --json在记忆文件中检索相关内容
openclaw modelslist--all --local --provider --json列模型openclaw models list --provider openai --json查看当前模型目录
openclaw modelsstatus--json --probe --agent查看模型状态openclaw models status --probe --json检查 provider 认证、默认模型、可用性
openclaw modelsset-设置默认模型openclaw models set openai/gpt-4.1把默认对话模型切换成指定模型
openclaw modelsset-image-设置图片模型openclaw models set-image openai/gpt-image-1配置默认图像模型
openclaw modelsaliases list--json查看别名openclaw models aliases list --json查看模型别名表
openclaw modelsfallbacks list--json查看回退模型openclaw models fallbacks list --json查看主模型失败时的回退链
openclaw modelsscan--provider --set-default --json扫描候选模型openclaw models scan --provider openrouter --set-default --json自动发现可用模型并设置默认值
openclaw modelsauth add-增加认证openclaw models auth add交互式添加 provider 认证
openclaw modelsauth login--provider --method登录 provideropenclaw models auth login --provider google-gemini-cli跑 provider 自带登录流程
openclaw modelsauth setup-token--provider初始化 tokenopenclaw models auth setup-token --provider anthropic用 CLI 协助建立 token
openclaw modelsauth paste-token--provider --profile-id粘贴 tokenopenclaw models auth paste-token --provider openai手动把 token 写入认证配置
openclaw systemevent--text --mode --json注入系统事件openclaw system event --text "重新加载人格" --mode now向主 session 注入一条系统事件
openclaw systemheartbeat last--json查看最后心跳openclaw system heartbeat last --json查看最近一次心跳事件
openclaw systemheartbeat enable--json开启心跳openclaw system heartbeat enable打开系统心跳机制
openclaw systemheartbeat disable--json关闭心跳openclaw system heartbeat disable关闭系统心跳
openclaw systempresence--json查看 presenceopenclaw system presence --json查看系统 presence 条目

7. Cron / Hooks / Plugins / Skills

命令子命令常用参数中文备注例子详细用途
openclaw cronstatus--json查看调度器状态openclaw cron status --json查看 cron 子系统是否运行
openclaw cronlist--all --json列任务openclaw cron list --all --json查看当前定时任务
openclaw cronadd--name --message --every --cron --agent --announce添加任务openclaw cron add --name morning --every 1d --message "早报" --agent main周期性触发 agent 或系统事件
openclaw cronrm--json删除任务openclaw cron rm <job-id>删除定时任务
openclaw cronenable-启用任务openclaw cron enable <job-id>启用某个已禁用任务
openclaw crondisable-禁用任务openclaw cron disable <job-id>暂停某个任务
openclaw cronruns--id --limit查看运行历史openclaw cron runs --id <job-id> --limit 20查看任务执行记录
openclaw cronrun--due立即执行openclaw cron run --id <job-id>手动调试执行某任务
openclaw cronedit--name --message --every --enable编辑任务openclaw cron edit <job-id> --every 2h --enable修改任务计划、消息、目标
openclaw hookslist--eligible --json --verbose列 hooksopenclaw hooks list --verbose查看可用和已安装 hooks
openclaw hooksinfo--jsonhook 详情openclaw hooks info my-hook --json查看某个 hook 详细信息
openclaw hookscheck--json检查 hookopenclaw hooks check --json看是否满足依赖和启用条件
openclaw hooksenable-启用 hookopenclaw hooks enable my-hook让 hook 进入运行状态
openclaw hooksdisable-禁用 hookopenclaw hooks disable my-hook停止 hook 生效
openclaw hooksinstall--link安装 hookopenclaw hooks install ./my-hook-pack --link安装本地 hook 包
openclaw hooksupdate--all --dry-run更新 hooksopenclaw hooks update --all更新已安装 hooks
openclaw pluginslist--json --enabled --verbose列插件openclaw plugins list --enabled查看插件目录及启用情况
openclaw pluginsinfo--json插件详情openclaw plugins info feishu --json查看某插件元信息
openclaw pluginsenable-启用插件openclaw plugins enable feishu在配置中启用插件
openclaw pluginsdisable-禁用插件openclaw plugins disable feishu在配置中禁用插件
openclaw pluginsinstall--link安装插件openclaw plugins install ./plugin-dir --link安装本地或 npm 插件
openclaw pluginsuninstall--force --dry-run卸载插件openclaw plugins uninstall feishu --force卸载某插件
openclaw pluginsupdate--all --dry-run更新插件openclaw plugins update --all更新已安装插件
openclaw pluginsdoctor-检查插件问题openclaw plugins doctor诊断插件加载异常
openclaw skillslist--json --eligible --verbose列技能openclaw skills list --eligible查看可用 skills
openclaw skillsinfo--json技能详情openclaw skills info browser --json查看某个 skill 的元信息
openclaw skillscheck--json检查技能openclaw skills check --json看哪些 skills 缺依赖、哪些可直接用

8. Browser / Nodes / Devices / Node / Sandbox / TUI

这一组命令非常多,我给你列最常用、最有代表性的。

命令子命令常用参数中文备注例子详细用途
openclaw browserstatus--json浏览器状态openclaw browser status --json查看 OpenClaw 专用浏览器是否运行
openclaw browserstart-启动浏览器openclaw browser start启动专用浏览器环境
openclaw browserstop-停止浏览器openclaw browser stop停掉浏览器进程
openclaw browsertabs-列出标签页openclaw browser tabs查看当前所有打开页面
openclaw browseropen-打开网址openclaw browser open https://example.com新开一个标签页
openclaw browsernavigate--target-id跳转页面openclaw browser navigate https://openai.com当前标签页跳转
openclaw browserscreenshot--full-page --type截图openclaw browser screenshot --full-page获取当前页面截图
openclaw browsersnapshot--format --limit页面结构快照openclaw browser snapshot --format ai读取页面结构,适合自动化
openclaw browserclick--target-id点击元素openclaw browser click REF_12根据快照 ref 点击页面元素
openclaw browsertype--submit --slowly输入文字openclaw browser type REF_8 "hello" --submit给输入框填内容
openclaw browserpdf--target-id导出 PDFopenclaw browser pdf保存页面为 PDF
openclaw browserconsole--level控制台日志openclaw browser console --level error查看页面 JS 错误
openclaw nodesstatus--json节点状态openclaw nodes status --json查看已知节点连接情况
openclaw nodespending--json待审批节点openclaw nodes pending --json查看待配对节点
openclaw nodesapprove--json批准节点openclaw nodes approve <node-id>批准一个新节点接入
openclaw nodesrun--node --raw --agent在节点上执行命令openclaw nodes run --node mac-mini --raw "ls -la"在远端节点执行 shell 命令
openclaw nodesnotify--node --title --body本地通知openclaw nodes notify --node mac-mini --title "提醒" --body "任务完成"给节点机器发本地通知
openclaw nodescanvas snapshot--node画布快照openclaw nodes canvas snapshot --node mac-mini获取节点上的 canvas 快照
openclaw nodescamera snap--node拍照openclaw nodes camera snap --node iphone调用节点摄像头拍照
openclaw nodesscreen record--node --duration录屏openclaw nodes screen record --node mac-mini --duration 10s远程录屏
openclaw deviceslist--json查看设备openclaw devices list --json查看待配对和已配对设备
openclaw devicesapprove--json批准设备openclaw devices approve <device-id>允许设备接入
openclaw devicesreject--json拒绝设备openclaw devices reject <device-id>拒绝设备接入
openclaw devicesrotate--device --role轮换 tokenopenclaw devices rotate --device ipad --role viewer更新设备 token
openclaw devicesrevoke--device --role撤销 tokenopenclaw devices revoke --device ipad --role viewer撤销设备访问权
openclaw noderun--host --port运行 headless nodeopenclaw node run --host 127.0.0.1 --port 18789启动 headless node host
openclaw nodestatus--json查看 node 状态openclaw node status --json查看本机 node host 状态
openclaw sandboxlist--json --browser列沙箱openclaw sandbox list --json查看 agent/browser 的容器沙箱
openclaw sandboxrecreate--all --agent --session重建沙箱openclaw sandbox recreate --all --force删除旧容器并重建
openclaw sandboxexplain--session --agent --json解释策略openclaw sandbox explain --agent main --json看当前 session/agent 生效的沙箱与工具策略
openclaw tui---url --token --session --deliver --message打开终端 UIopenclaw tui --session main --message "hello"在终端里连接 Gateway 进行对话

9. DNS / Docs / Webhooks / Directory / Security / Update

命令子命令常用参数中文备注例子详细用途
openclaw dnssetup--domain --apply配置 DNS 发现openclaw dns setup --domain openclaw.internal --apply配置 CoreDNS / 宽域服务发现
openclaw docs--搜索官方文档openclaw docs直接查 OpenClaw 在线文档
openclaw webhooksgmail setup--account --project --topic --hook-url配置 Gmail webhookopenclaw webhooks gmail setup --account me@gmail.com --project my-gcp-proj配置 Gmail Pub/Sub 与 OpenClaw hook
openclaw webhooksgmail run--account --topic --hook-url运行 Gmail watchopenclaw webhooks gmail run --account me@gmail.com --topic projects/x/topics/y启动 Gmail 监听与推送循环
openclaw directoryself--channel --account --json查看当前账号openclaw directory self --channel feishu --json查询机器人/当前账号自身信息
openclaw directorypeers list--query --limit列联系人openclaw directory peers list --channel feishu --query 张 --limit 10搜索联系人/同事
openclaw directorygroups list--query --limit列群组openclaw directory groups list --channel feishu --query 产品搜索群组
openclaw directorygroups members--group-id --limit列群成员openclaw directory groups members --channel feishu --group-id grp_xxx查看群成员
openclaw securityaudit--deep --fix --json安全审计openclaw security audit --deep --json审计配置、权限和常见安全风险
openclaw updatewizard--timeout交互式更新openclaw update wizard通过向导更新 OpenClaw
openclaw updatestatus--json --timeout查看更新状态openclaw update status --json查看当前版本与更新通道

10. 你现在最值得先记住的“飞书工作流命令组”

如果你现在的重点是 研究 OpenClaw + 飞书 的运行链路,建议优先记下面这组:

命令子命令例子用途
openclaw gatewaystatusopenclaw gateway status先确认 Gateway 是否活着
openclaw logs-openclaw logs --follow实时看飞书消息有没有打进来
openclaw channelslistopenclaw channels list --json确认飞书渠道已配置
openclaw channelsstatusopenclaw channels status --probe --json检查飞书连接状态
openclaw pairinglistopenclaw pairing list --channel feishu看第一次私聊是否进了 pairing
openclaw pairingapproveopenclaw 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 messagesendopenclaw message send -m "测试" -t user_xxx --channel feishu直接往飞书发消息,排除 agent 问题
openclaw channelslogsopenclaw 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 命令内容请搜索脚本之家以前的文章或继续浏览下面的相关文章,希望大家以后多多支持脚本之家!

相关文章

最新评论