当前位置: 首页 > news >正文

[特殊字符] OpenClaw 完整命令手册:从入门到精通的 CLI 终极指南

📋 命令速查表

类别命令说明
启动openclaw gateway启动 Gateway
停止Ctrl+C停止 Gateway
重启openclaw gateway restart重启 Gateway
状态openclaw gateway status查看 Gateway 状态
健康检查openclaw gateway health健康检查
安装openclaw update更新 OpenClaw
配置openclaw config set <path> <value>设置配置
验证openclaw config validate验证配置
插件openclaw plugins install @xxx安装插件
频道openclaw channels add --channel xxx添加频道
日志openclaw channels logs --channel all查看日志
诊断openclaw doctor运行诊断
成本openclaw gateway usage-cost查看使用成本

🚀 核心操作命令

1.Gateway 启动/运行

# 启动 Gateway(本地模式)
openclaw gateway

# 启动 Gateway(显式形式)
openclaw gateway run

# 启动 Gateway(开发模式,不强制配置)
openclaw gateway run --allow-unconfigured --dev

# 启动 Gateway 并指定端口
openclaw gateway --port 18789

# 启动 Gateway 并绑定到局域网
openclaw gateway --bind lan

# 启动 Gateway 并使用 Tailscale
openclaw gateway --tailscale serve


2.Gateway 暂停/停止/重启

# 重启 Gateway(安全模式,等待任务完成)
openclaw gateway restart

# 重启 Gateway(强制立即重启)
openclaw gateway restart --force

# 重启 Gateway(等待指定时间)
openclaw gateway restart --wait 30s

# 重启 Gateway(跳过延迟)
openclaw gateway restart --safe --skip-deferral

# 停止 Gateway(需要手动停止进程)
# Windows: Ctrl+C 或关闭终端
# macOS/Linux: Ctrl+C


3.Gateway 状态查询

# 查看Gateway服务状态
openclaw gateway status

# 查看Gateway服务状态(JSON格式)
openclaw gateway status --json

# 查看Gateway服务状态(深度扫描)
openclaw gateway status --deep

# 查看Gateway服务状态(需要RPC权限)
openclaw gateway status --require-rpc

# 健康检查(存活检查)
openclaw gateway health

# 健康检查(就绪检查)
openclaw gateway health --port 18789

# 探测所有目标
openclaw gateway probe

# 探测所有目标(JSON格式)
openclaw gateway probe --json


📦 安装与更新

4.安装 OpenClaw

# macOS / Linux
curl -fsSL https://openclaw.ai/install.sh | bash

# Windows (PowerShell)
iwr -useb https://openclaw.ai/install.ps1 | iex

# 检查版本
openclaw --version

# 更新 OpenClaw
openclaw update


5.首次配置

# 运行引导配置(推荐)
openclaw onboard --install-daemon

# 快速启动(跳过引导)
openclaw gateway

# 打开控制面板
openclaw dashboard

# 手动配置
openclaw configure


⚙️ 配置管理

6.Config 基础操作

# 查看配置文件路径
openclaw config file

# 查看配置
openclaw config get <path>

# 设置配置
openclaw config set <path> <value>

# 批量设置配置
openclaw config set --batch-json '[...]'

# 删除配置
openclaw config unset <path>

# 查看配置模式
openclaw config schema

# 验证配置
openclaw config validate

# 查看配置(JSON格式)
openclaw config get <path> --json

# 应用补丁文件
openclaw config patch --file ./openclaw.patch.json5

# 模拟运行补丁(不实际写入)
openclaw config patch --file ./openclaw.patch.json5 --dry-run


🔌 插件管理

7.Plugin 操作

# 安装插件
openclaw plugins install @openclaw/feishu
openclaw plugins install @openclaw/qqbot
openclaw plugins install "@tencent-weixin/openclaw-weixin"

# 列出已安装插件
openclaw plugins list

# 启用插件
openclaw config set plugins.entries.<plugin-name>.enabled true

# 禁用插件
openclaw config set plugins.entries.<plugin-name>.enabled false


💬 频道管理

8.Channel 操作

# 列出所有频道
openclaw channels list

# 列出所有频道(包括未安装的)
openclaw channels list --all

# 查看频道状态
openclaw channels status

# 查看频道状态(探针模式)
openclaw channels status --probe

# 查看频道能力
openclaw channels capabilities

# 添加频道
openclaw channels add --channel telegram --token "123:abc"
openclaw channels add --channel qqbot --token "***"

# 删除频道
openclaw channels remove --channel telegram --delete

# 登录频道(扫码)
openclaw channels login --channel openclaw-weixin
openclaw channels login --channel whatsapp

# 登出频道
openclaw channels logout --channel whatsapp

# 查看频道日志
openclaw channels logs --channel all
openclaw channels logs --channel discord --lines 100

# 解析名称到ID
openclaw channels resolve --channel slack "#general" "@jane"
openclaw channels resolve --channel discord "My Server/#support" "@someone"


👤 Agent 管理

9.Agent 操作

# 添加新 Agent
openclaw agents add <name>

# 添加新 Agent(非交互模式)
openclaw agents add <name> --model <model-id> --workspace <path>

# 列出所有 Agent
openclaw agents list

# 绑定 Agent 到频道
openclaw agents bind <agent-id> --channel <channel> --peer <peer>

# 解绑 Agent
openclaw agents unbind <agent-id> --channel <channel>


🔍 诊断与维护

10.诊断命令

# 运行诊断
openclaw doctor

# 运行诊断并修复问题
openclaw doctor --fix

# 导出诊断报告
openclaw gateway diagnostics export

# 导出诊断报告(指定输出路径)
openclaw gateway diagnostics export --output openclaw-diagnostics.zip

# 导出诊断报告(JSON格式)
openclaw gateway diagnostics export --json

# 查看使用成本
openclaw gateway usage-cost

# 查看最近7天的使用成本
openclaw gateway usage-cost --days 7

# 查看所有 Agent 的使用成本
openclaw gateway usage-cost --all-agents

# 查看稳定性记录
openclaw gateway stability

# 查看稳定性记录(指定类型)
openclaw gateway stability --type payload.large

# 导出稳定性记录
openclaw gateway stability --bundle latest --export


📊 状态查询

11.状态查询

# 查看整体状态
openclaw status

# 查看整体状态(深度扫描)
openclaw status --deep

# 查看会话信息
openclaw session_status

# 查看会话信息(JSON格式)
openclaw session_status --json

# 查看会话历史
openclaw sessions_history --sessionKey <key>

# 列出所有会话
openclaw sessions_list


📝 其他常用命令

12.其他操作

# 迁移数据
openclaw migrate --from hermes --source ~/.hermes

# 打开聊天界面
openclaw chat

# 修复配置
openclaw doctor --fix

# 查看帮助
openclaw --help
openclaw gateway --help
openclaw channels --help
openclaw config --help


这些就是 OpenClaw 的所有核心操作命令了!如果你想深入了解某个命令的详细参数,可以运行:

openclaw <command> --help

比如:

  • openclaw gateway --help- 查看 Gateway 命令的所有选项
  • openclaw channels add --help- 查看 Channels 添加命令的详细参数
http://www.jsqmd.com/news/1146954/

相关文章:

  • 【Java课程设计/毕业设计】基于前后端分离的智慧高校实验教学管理系统的设计与实现 基于 SpringBoot 的高校实训实验室综合管理系统【附源码、数据库、万字文档】
  • 军队文职备考进阶论:中教睿海如何以“全电子商务”专业服务成就修炼
  • ThinkPad风扇终极控制指南:如何在Windows上实现双风扇智能管理
  • A3910与PIC32MZ2048EFH144在嵌入式电机控制中的黄金组合
  • 静态住宅 IP 和动态住宅 IP 有什么区别?从公网地址、稳定性到使用场景一文讲清
  • Airtest自动化测试入门第一篇:环境搭建与5分钟上手
  • MCP3428与MK24FN1M0VDC12在工业数据采集中的优化应用
  • 直线电机在3D打印中的高速高精度运动控制实践
  • 手机号查询QQ终极指南:3步实现高效查询的完整解决方案
  • 9大网盘直链解析神器LinkSwift:告别限速困扰的终极解决方案
  • Ricon组态可视化编辑器 - 所见即所得的工业画布
  • MonoDETR 深度引导Transformer实战:KITTI数据集AP3D提升至28.84%的代码复现指南
  • 如何快速构建思源黑体TTF字体:免费商用中文字体完全指南
  • 咖啡门店点餐小程序怎么做?餐宝盈/BBWEYY/小艺助手/ModelArts/openPangu 2.0 Pro这5个小程序制作工具助你零基础搭建
  • CefFlashBrowser:Flash时代终结后的终极解决方案
  • MCP3428与MKV44F128VLH16在工业数据采集中的高精度应用
  • Java毕设选题推荐:基于 SpringBoot 的大学生实验教学项目管理系统的设计与实现 基于 SpringBoot+Vue 的实验室教学排班【附源码、mysql、文档、调试+代码讲解+全bao等】
  • CAD看图软件高频功能盘点,详解七大实用工具!
  • 3种方案解除笔记本异常降频:从软件解锁到硬件排查的完整决策树
  • 高压安全隔离技术:ISOM8710与MK20DX128VFM5方案解析
  • 锂离子电池组电压平衡方案:MCP3202与PIC18F4458实现
  • 手机号逆向查询QQ号:Python自动化工具终极指南
  • 日志易5.6全新升级:Copilot智能助手登场,数据采集与搜索体验再进化
  • STM32F215ZG与AD5593R硬件设计及I2C通信优化
  • PInVerify:多模态身份验证数据集与工程实践指南
  • Android原生电视直播软件架构解析:模块化设计与性能优化实践
  • 二硬脂酰磷脂酰乙醇胺-PEG2000-叠氮(DSPE-PEG2000-N3)完整使用教程
  • 餐桌上的“隐形抗生素”:阿莫西林残留,你真的防住了吗?
  • 基于TPIS1S1385与STM32F746VG的运动检测系统设计
  • 400电话底层技术架构解析:从传统号段组网到云原生智能通信演进