OpenClaw 是一款开源多通道 AI 智能体框架,以下为 CLI 完整命令与常用参数,按功能模块分类整理。
全局通用参数(所有命令支持)
--help, -h # 查看帮助
--version, -V # 查看版本
--config <path> # 指定配置文件路径
--verbose, -v # 详细输出模式
--quiet, -q # 静默模式
--json # JSON 格式输出
--workspace <dir> # 指定工作目录
1. 基础与系统管理
openclaw help [command]
# 查看帮助或指定命令详情
openclaw version [--check]
# --check 检查是否有新版本
openclaw update [--no-restart] [--channel stable|beta]
# --no-restart 更新后不自动重启
# --channel 指定更新通道
openclaw start|stop|restart
# 启动/停止/重启 OpenClaw 核心服务
openclaw status [--short] [--json]
# 查看整体运行状态
openclaw health [--gateway] [--channels] [--agents]
# 系统健康检查
openclaw logs [--follow] [--level info|warn|error] [--last 1h] [--agent <id>]
# --follow 实时滚动日志
# --level 过滤日志级别
# --last 查看最近 N 时间日志
# --agent 查看指定智能体日志
openclaw dashboard [--port <port>] [--bind <ip>]
# 启动 Web 管理面板
openclaw tui
# 启动终端交互式界面
openclaw backup create|restore --output <file>|--input <file>
# 备份与恢复配置及数据
openclaw usage [--last 30d] [--agent <id>]
# 查看 Token/调用量统计
2. 安装、初始化与配置
openclaw onboard [--reset] [--non-interactive]
# 初始化向导;--reset 重置初始化
openclaw config get <key>
openclaw config set <key> <value>
openclaw config unset <key>
openclaw config file
# 查看/修改/编辑配置
openclaw doctor [--fix] [--force]
# 系统诊断与自动修复
openclaw reset [--hard]
# --hard 硬重置,清空所有数据
openclaw uninstall [--purge]
# --purge 彻底卸载并删除所有数据
3. 网关(Gateway)管理
openclaw gateway start|stop|restart|status
# 网关服务控制
openclaw gateway logs [--follow]
# 网关独立日志
openclaw gateway call <method> [--params <json>]
# 手动调用网关 RPC 接口
4. 通道(Channels)管理
支持微信、Telegram、QQ、Web 等多通道接入。
openclaw channels list [--json]
# 列出所有已配置通道
openclaw channels add --channel <name> --token <t> [--name <alias>]
# 添加新通道
openclaw channels status [--probe]
# --probe 主动探测连通性
openclaw channels remove <id|name>
# 删除通道
openclaw channels logs <id> [--follow]
# 查看指定通道日志
5. 智能体(Agents)管理
openclaw agents list [--bindings] [--json]
# 列出所有智能体
openclaw agents add --name <name> --model <model> [--tools t1,t2]
# 创建智能体
openclaw agents remove <id>
# 删除智能体
openclaw agents bind --agent <id> --bind <channel[:account]>
# 将智能体绑定到通道
openclaw agent <id> -m "your message" [--deliver]
# 直接与智能体对话测试
6. 模型(Models)管理
openclaw models list [--available]
# 列出已配置/可用模型
openclaw models set <model-id>
# 设置默认模型
openclaw models auth add --provider <name> --key <api-key>
# 添加模型服务商 API Key
7. 消息(Message)操作
openclaw message send --to <target> -m "text" [--channel <c>]
# 主动发送消息
openclaw message read [--agent <id>] [--unread]
# 查看消息记录
8. 节点与分布式(Nodes)
openclaw nodes list [--connected]
# 列出集群节点
openclaw nodes status [--last-connected 24h]
# 节点在线状态
openclaw nodes approve|deny <id>
# 批准或拒绝节点接入
9. 插件(Plugins)系统
openclaw plugins list [--enabled]
# 列出插件
openclaw plugins install|update|remove <name>
# 安装/更新/卸载插件
openclaw plugins enable|disable <name>
# 启用/禁用插件
10. 浏览器自动化
openclaw browser install|start|stop
# 安装/启动/停止内置浏览器
openclaw browser run --url <url> [--script <file>]
# 执行网页自动化任务
11. 安全、沙箱与密钥
openclaw security check|scan
# 安全扫描
openclaw sandbox list|recreate
# 沙箱规则管理
openclaw secrets list|add|remove
# 敏感密钥管理
12. 聊天内斜杠命令(交互模式)
plaintext
/help 帮助
/status 系统状态
/model <name> 切换模型
/agent <id> 切换当前智能体
/skill <name> 执行技能
/logs 查看实时日志
/approve 批准待确认操作