OpenClaw CLI 速查指南:从入门到精通的命令大全
一份面向实战的 OpenClaw 命令行参考,覆盖安装、配置、Agent、会话、网关、浏览器与自动化

OpenClaw CLI 速查指南:从入门到精通的命令大全
OpenClaw 是一个跨平台的自托管 AI Agent 网关,一条命令就能管理 Gateway、会话、模型、技能、浏览器和自动化任务。本文基于官方最新 CLI reference,整理出一份可直接落地的命令速查,并修正了旧版速查表中已变更或过时的命令。

一、基础入门:先跑起来
在终端里输入以下命令,完成环境自检、安装、引导和启动控制台:
openclaw --version # 查看版本
openclaw --help # 全局帮助
openclaw doctor # 环境健康自检
openclaw dashboard # 打开 Web 控制台
openclaw logs --follow # 实时查看运行日志如果你是新用户,官方推荐从 openclaw onboard --install-daemon 开始,它会依次验证推理服务、安装 Gateway、配置工作区和技能。如果只想生成基线配置,不跑引导流程,可以直接使用:
openclaw setup --baseline
二、网关服务:OpenClaw 的心脏
Gateway 是 OpenClaw 的核心进程,负责会话、路由和通道连接。常用命令如下:
openclaw gateway start # 后台启动网关
openclaw gateway stop # 停止网关
openclaw gateway restart # 重启网关
openclaw gateway status # 网关运行状态
openclaw gateway health # 深度健康探测
openclaw gateway call # 调用网关 RPC
openclaw gateway usage-cost # 用量与成本查询
openclaw gateway stability # 稳定性检测
openclaw gateway diagnostics export # 导出诊断报告
openclaw gateway discover # 发现可用网关实例
openclaw gateway install # 安装 Gateway 服务
openclaw gateway uninstall # 卸载 Gateway 服务
openclaw gateway run # 运行 Gateway如果你使用 systemd 托管的 Gateway 服务,也可以直接操作 openclaw daemon:
openclaw daemon status
openclaw daemon start
openclaw daemon stop
openclaw daemon restart三、配置管理:读写与校验
配置文件的默认位置是 ~/.openclaw/openclaw.json。可以用以下命令管理:
openclaw config list # 列出全部配置
openclaw config get <键名> # 读取指定配置
openclaw config set <键名> <值> # 修改配置项
openclaw config unset <键名> # 删除配置项
openclaw config file # 打印配置文件路径
openclaw config schema # 输出配置 schema
openclaw config validate # 校验配置合法性如果你想针对特定场景做定向修改,也可以使用 openclaw configure,它会引导你完成模型鉴权、Gateway、通道、插件或技能的配置。
四、智能体与多 Agent 路由
OpenClaw 支持多 Agent 隔离会话。管理 Agent 的命令已经比旧版速查表丰富很多:
openclaw agents list # 查看所有智能体
openclaw agents add <代理名> # 新建智能体
openclaw agents delete <代理名> # 删除智能体
openclaw agents bindings # 查看绑定关系
openclaw agents bind <会话> <代理名> # 将会话绑定到代理
openclaw agents unbind <会话> # 解绑
openclaw agents set-identity <代理名> <身份> # 设置代理身份如果你需要直接运行某个 Agent,可以用 openclaw agent 或 openclaw run --agent <代理名> --command "任务"。

五、会话与状态诊断
openclaw sessions list # 列出所有会话
openclaw sessions cleanup # 清理无效/过期会话
openclaw status # 当前会话状态
openclaw status --all # 全局会话诊断
openclaw status --usage # 用量与配额概览
openclaw health # 健康探测
openclaw audit # 审计日志六、模型、推理与密钥
OpenClaw 对模型和推理的支持已经非常细化:
openclaw models list # 查看可用模型
openclaw models status # 模型状态
openclaw models set <模型> # 设置默认模型
openclaw models set-image <模型> # 设置图像模型
openclaw models aliases list # 查看模型别名
openclaw models aliases add <别名> <模型>
openclaw models aliases remove <别名>
openclaw models fallbacks list # 查看模型 fallback 链
openclaw models image-fallbacks list # 图像模型 fallback
openclaw models scan # 扫描本地模型服务
openclaw models auth list # 查看已配置的模型认证密钥与安全相关:
openclaw secrets reload # 重载 API 密钥
openclaw secrets audit # 审计密钥
openclaw secrets configure # 配置密钥
openclaw secrets apply # 应用密钥
openclaw security audit --fix # 安全审计 + 自动修复推理命令已经独立成组,除了文本,还覆盖图像、音频、TTS、视频、网页搜索和嵌入:
openclaw infer list # 列出可用推理能力
openclaw infer model run <模型> "提示词" # 直接跑模型
openclaw infer image generate # 文生图
openclaw infer audio transcribe # 语音转文字
openclaw infer tts convert # 文字转语音
openclaw infer video generate # 文生视频
openclaw infer web search # 联网搜索
openclaw infer embedding create # 生成嵌入向量七、技能与插件
技能(Skills)和插件(Plugins)是 OpenClaw 扩展能力的主要方式:
openclaw skills list # 已安装技能列表
openclaw skills search <关键词> # 搜索技能
openclaw skills install <技能名> # 安装技能
openclaw skills update <技能名> # 更新技能
openclaw skills verify # 校验技能完整性
openclaw skills info <技能名> # 查看技能详情
openclaw skills check # 检查技能依赖
openclaw skills workshop list # 查看技能工坊提案插件管理比旧版速查表丰富得多:
openclaw plugins list # 插件列表
openclaw plugins search <关键词> # 搜索插件
openclaw plugins inspect <插件名> # 查看插件详情
openclaw plugins install <插件名> # 安装插件
openclaw plugins uninstall <插件名> # 卸载插件
openclaw plugins update <插件名> # 更新插件
openclaw plugins enable <插件名> # 启用插件
openclaw plugins disable <插件名> # 禁用插件
openclaw plugins doctor # 插件健康检查
openclaw plugins build # 构建插件
openclaw plugins validate # 校验插件
openclaw plugins init # 初始化插件项目八、浏览器自动化
浏览器子命令已经非常细化,覆盖了从截图到表单填写的完整流程:
openclaw browser status # 浏览器状态
openclaw browser start # 启动浏览器
openclaw browser stop # 停止浏览器
openclaw browser reset-profile # 重置浏览器配置
openclaw browser tabs # 列出所有标签页
openclaw browser open <URL> # 打开网页
openclaw browser focus <索引> # 聚焦标签页
openclaw browser close <索引> # 关闭标签页
openclaw browser profiles # 列出浏览器配置
openclaw browser create-profile <名> # 新建配置
openclaw browser delete-profile <名> # 删除配置
openclaw browser screenshot # 截图
openclaw browser snapshot # 快照
openclaw browser navigate <URL> # 跳转
openclaw browser resize <宽> <高> # 调整窗口
openclaw browser click <元素> # 点击
openclaw browser type <文本> # 输入
openclaw browser press <按键> # 按键
openclaw browser hover <元素> # 悬停
openclaw browser drag <from> <to> # 拖拽
openclaw browser select <选项> # 选择
openclaw browser upload <文件路径> # 上传文件
openclaw browser fill <字段> <值> # 表单填充
openclaw browser dialog <accept|dismiss> # 对话框处理
openclaw browser wait <文本> # 等待文本
openclaw browser evaluate <脚本> # 执行 JS
openclaw browser console # 查看控制台
openclaw browser pdf # 导出 PDF
九、自动化与运维
定时任务、工作流和钩子:
openclaw cron status # 定时任务状态
openclaw cron list # 列出任务
openclaw cron get <任务ID> # 查看任务
openclaw cron add <cron表达式> <提示词> # 新建任务
openclaw cron edit <任务ID> # 编辑任务
openclaw cron rm <任务ID> # 删除任务
openclaw cron enable <任务ID> # 启用任务
openclaw cron disable <任务ID> # 禁用任务
openclaw cron runs <任务ID> # 查看运行历史
openclaw cron run <任务ID> # 立即运行一次
openclaw tasks list # 任务列表
openclaw tasks audit # 任务审计
openclaw tasks maintenance # 任务维护
openclaw tasks show <任务ID> # 查看详情
openclaw tasks notify <任务ID> # 发送通知
openclaw tasks cancel <任务ID> # 取消任务
openclaw tasks flow list|show|cancel # 工作流管理
openclaw hooks list # 列出钩子
openclaw hooks info <钩子名> # 查看钩子信息
openclaw hooks check # 检查钩子状态
openclaw hooks enable <钩子名> # 启用钩子
openclaw hooks disable <钩子名> # 禁用钩子
openclaw hooks install <钩子名> # 安装钩子
openclaw hooks update <钩子名> # 更新钩子
openclaw webhooks gmail setup|run # Gmail webhook系统维护命令:
openclaw backup create # 一键打包备份
openclaw backup verify # 校验备份
openclaw reset --scope config+creds # 重置配置与凭证
openclaw reset --scope all # 完全重置
openclaw uninstall # 卸载 OpenClaw
openclaw update # 更新 OpenClaw
openclaw update wizard # 交互式更新
openclaw update status # 更新状态
openclaw update repair # 修复更新问题
openclaw migrate list # 查看迁移计划
openclaw migrate plan <provider> # 生成迁移方案
openclaw migrate apply <provider> # 执行迁移十、网络、节点与远程访问
openclaw nodes status # 节点状态
openclaw nodes describe # 节点详情
openclaw nodes list # 列出节点
openclaw nodes pending # 待配对节点
openclaw nodes approve <节点ID> # 批准节点
openclaw nodes reject <节点ID> # 拒绝节点
openclaw nodes rename <节点ID> <名> # 重命名
openclaw nodes invoke <节点ID> # 调用节点
openclaw nodes notify <节点ID> # 通知节点
openclaw nodes push # 推送配置到节点
openclaw nodes canvas snapshot|present|hide|navigate|eval # Canvas 控制
openclaw nodes camera list|snap|clip # 相机
openclaw nodes screen record # 录屏
openclaw nodes location get # 获取位置
openclaw devices list # 设备列表
openclaw devices remove <设备ID> # 移除设备
openclaw devices clear # 清空设备
openclaw devices approve <设备ID> # 批准设备
openclaw devices reject <设备ID> # 拒绝设备
openclaw devices rotate # 轮换凭证
openclaw devices revoke # 吊销凭证
openclaw directory self # 查看当前目录配置
openclaw directory peers list # 列出对等节点
openclaw directory groups list|members # 群组管理
openclaw proxy start # 启动代理
openclaw proxy run # 运行代理
openclaw proxy coverage # 代理覆盖范围
openclaw proxy sessions # 代理会话
openclaw proxy query # 代理查询
openclaw proxy blob # 代理大对象
openclaw proxy purge # 清理代理十一、安全与权限
openclaw approvals get # 查看审批策略
openclaw approvals set <策略> # 设置审批策略
openclaw approvals allowlist add <项> # 加入白名单
openclaw approvals allowlist remove <项> # 移出白名单
openclaw exec-policy show # 查看执行策略
openclaw exec-policy preset <预设> # 应用预设策略
openclaw exec-policy set <策略> # 自定义策略
openclaw sandbox list # 沙箱列表
openclaw sandbox recreate # 重建沙箱
openclaw sandbox explain # 解释沙箱策略十二、消息与通道管理
openclaw message send <目标> <内容> # 发送消息
openclaw message broadcast <内容> # 广播消息
openclaw message poll <问题> <选项> # 发起投票
openclaw message react <消息ID> <表情> # 表情回应
openclaw message reactions <消息ID> # 查看回应
openclaw message read <会话ID> # 读取消息
openclaw message edit <消息ID> <内容> # 编辑消息
openclaw message delete <消息ID> # 删除消息
openclaw message pin <消息ID> # 置顶消息
openclaw message unpin <消息ID> # 取消置顶
openclaw message pins # 查看置顶
openclaw message permissions # 查看权限
openclaw message search <关键词> # 搜索消息
openclaw message thread create|list|reply # 话题管理
openclaw message emoji list|upload # 表情管理
openclaw message sticker send|upload # 贴纸管理
openclaw message role info|add|remove # 角色管理
openclaw message channel info|list # 通道信息
openclaw message member info # 成员信息
openclaw message voice status # 语音状态
openclaw message event list|create # 事件管理
openclaw message timeout <分钟> # 设置超时
openclaw message kick <成员> # 踢出成员
openclaw message ban <成员> # 封禁成员
openclaw channels list # 通道列表
openclaw channels status # 通道状态
openclaw channels capabilities # 通道能力
openclaw channels resolve # 解析通道路由
openclaw channels logs # 通道日志
openclaw channels add # 添加通道
openclaw channels remove <通道名> # 移除通道
openclaw channels login <通道名> # 登录通道
openclaw channels logout <通道名> # 登出通道
openclaw pairing list # 配对列表
openclaw pairing approve <请求ID> # 批准配对
openclaw qr # 生成配对二维码十三、对话内斜杠命令
在聊天中可以直接使用斜杠命令,无需离开当前会话:
/status 运行快照检查
/new 开启全新会话
/trace 会话级插件调试
/config 持久化配置修改
/debug 运行时临时覆写(需 commands.debug: true)
/think high 高深度推理模式
/fast on 极简快速响应十四、全局参数与输出模式
openclaw --dev # 开发模式:隔离状态目录和端口
openclaw --profile <名称> # 多配置隔离
openclaw --container <名称> # 在容器内运行 CLI
openclaw --log-level <级别> # 覆盖日志级别
openclaw --no-color # 关闭 ANSI 颜色
openclaw --json # JSON 输出(适合脚本)
openclaw --plain # 纯文本输出--dev 会把状态隔离到 ~/.openclaw-dev,并将 Gateway 默认端口改为 19001,非常适合和正式环境并行运行。
写在最后
OpenClaw 的命令树比旧版速查表丰富得多。如果你刚上手,建议先记住 doctor、dashboard、gateway、config 和 status 这五个高频命令;当你需要更细粒度的控制时,再回头查阅本文的对应章节即可。
参考来源
–全文完–

梦行志
