🦞OpenClaw ClawBook

CLI 参考

OpenClaw CLI 是管理 Gateway、渠道、Agent、模型和自动化的统一入口。

全局参数:--dev(开发模式)、--profile <name>(配置档案)、--no-color(无颜色)、--json(JSON 输出)

初始设置

# 交互式引导(推荐首次使用)
openclaw onboard --install-daemon

# 交互式配置编辑
openclaw configure

# 单字段读写
openclaw config get agents.defaults.model.primary
openclaw config set agents.defaults.model.primary "anthropic/claude-sonnet-4-5"
openclaw config unset channels.telegram.botToken

# 配置文件路径
openclaw config file

# 校验配置
openclaw config validate

# 健康诊断
openclaw doctor
openclaw doctor --fix

Gateway 管理

# 前台运行
openclaw gateway
openclaw gateway --port 18790

# 注册为系统服务
openclaw gateway install

# 服务管理
openclaw gateway status
openclaw gateway restart
openclaw gateway stop

# 查看日志
openclaw logs --follow

# 直接调用 RPC 方法
openclaw gateway call <method> [params...]

渠道管理

# 登录渠道
openclaw channels login
openclaw channels login telegram

# 查看渠道状态
openclaw channels list
openclaw channels status --probe

# 添加/移除渠道
openclaw channels add <channel>
openclaw channels remove <channel>

# 配对管理
openclaw pairing list
openclaw pairing approve <code>

Agent 管理

# 列出 Agent 及其 Binding
openclaw agents list --bindings

# 增删 Agent
openclaw agents add <name> --workspace <path>
openclaw agents delete <name>

# 绑定/解绑路由规则
openclaw agents bind <agentId> --channel <channel>
openclaw agents unbind <agentId> --channel <channel>

# 直接发消息给 Agent
openclaw agent --message "你好"

模型管理

# 查看模型
openclaw models list
openclaw models status
openclaw models status --check

# 设置默认模型
openclaw models set anthropic/claude-sonnet-4-5

# 扫描可用模型
openclaw models scan

# 认证管理
openclaw models auth add --provider anthropic
openclaw models auth setup-token --provider anthropic
openclaw models auth paste-token --provider openai

# 认证优先级
openclaw models auth order get --provider anthropic
openclaw models auth order set --provider anthropic <profileIds...>

# 别名与备用
openclaw models aliases
openclaw models fallbacks

会话管理

# 查看会话
openclaw sessions list

# 系统事件
openclaw system event
openclaw system heartbeat
openclaw system presence

定时任务

# 管理 Cron 任务
openclaw cron list
openclaw cron status
openclaw cron add
openclaw cron edit <jobId>
openclaw cron rm <jobId>

# 手动执行
openclaw cron run <jobId>

# 查看执行记录
openclaw cron runs <jobId>

Skills 与 Hook

# Skill 管理
openclaw skills list
openclaw skills install <name>

# Hook 管理
openclaw hooks list
openclaw hooks install <package>

安全与 Secret

# 安全审计
openclaw security audit
openclaw security audit --deep --fix

# Secret 管理
openclaw secrets audit --check
openclaw secrets configure
openclaw secrets apply --from plan.json
openclaw secrets reload

浏览器控制

# 浏览器工具 CLI(25+ 子命令)
openclaw browser launch
openclaw browser navigate <url>
openclaw browser screenshot
openclaw browser snapshot
openclaw browser act <action>
openclaw browser close

设备与节点

# 节点管理
openclaw nodes status
openclaw nodes describe <nodeId>
openclaw nodes run <nodeId> <command>
openclaw nodes notify <nodeId> <message>
openclaw nodes camera <nodeId>
openclaw nodes screen <nodeId>
openclaw nodes location <nodeId>

其他常用

# 版本信息
openclaw --version

# 打开控制台
openclaw dashboard

# 内存管理
openclaw memory status
openclaw memory index
openclaw memory search <query>

# DNS 检测
openclaw dns

# 插件管理
openclaw plugins list