openclaw-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OpenClaw CLI

OpenClaw CLI

Complete reference for openclaw command-line interface operations.
OpenClaw命令行界面操作的完整参考文档。

When to Use

使用场景

Managing OpenClaw gateway, agents, channels, skills, hooks, and automation.
用于管理OpenClaw网关、Agent、渠道、Skill、钩子及自动化功能。

Core Commands

核心命令

Setup & Onboarding

安装与入门

Initial setup:
bash
undefined
初始设置:
bash
undefined

Quick onboarding with daemon install

Quick onboarding with daemon install

openclaw onboard --install-daemon
openclaw onboard --install-daemon

Setup workspace and config

Setup workspace and config

openclaw setup --workspace ~/.openclaw/workspace
openclaw setup --workspace ~/.openclaw/workspace

Interactive configuration

Interactive configuration

openclaw configure

**Health check:**
```bash
openclaw doctor
openclaw configure

**健康检查:**
```bash
openclaw doctor

Gateway Management

网关管理

Run gateway:
bash
undefined
启动网关:
bash
undefined

Interactive mode

Interactive mode

openclaw gateway
openclaw gateway

With specific port

With specific port

openclaw gateway --port 18789
openclaw gateway --port 18789

With tailscale

With tailscale

openclaw gateway --tailscale serve

**Gateway service:**
```bash
openclaw gateway --tailscale serve

**网关服务:**
```bash

Install as system service

Install as system service

openclaw gateway install
openclaw gateway install

Control service

Control service

openclaw gateway start openclaw gateway stop openclaw gateway restart openclaw gateway status

**Gateway health:**
```bash
openclaw status
openclaw status --deep     # Probe channels
openclaw health
openclaw gateway start openclaw gateway stop openclaw gateway restart openclaw gateway status

**网关健康状态:**
```bash
openclaw status
openclaw status --deep     # Probe channels
openclaw health

Agent Management

Agent管理

List agents:
bash
openclaw agents list
openclaw agents list --bindings    # Show routing
Add agent:
bash
undefined
列出Agent:
bash
openclaw agents list
openclaw agents list --bindings    # Show routing
添加Agent:
bash
undefined

Interactive wizard

Interactive wizard

openclaw agents add <name>
openclaw agents add <name>

Non-interactive

Non-interactive

openclaw agents add dev
--workspace ~/.openclaw/workspace-dev
--model claude-sonnet-4.5
--non-interactive

**Delete agent:**
```bash
openclaw agents delete <id>
Set identity:
bash
undefined
openclaw agents add dev \ --workspace ~/.openclaw/workspace-dev \ --model claude-sonnet-4.5 \ --non-interactive

**删除Agent:**
```bash
openclaw agents delete <id>
设置身份信息:
bash
undefined

From IDENTITY.md

From IDENTITY.md

openclaw agents set-identity --agent main --from-identity
openclaw agents set-identity --agent main --from-identity

Explicit values

Explicit values

openclaw agents set-identity --agent main
--name "MyAgent"
--emoji "🤖"
--avatar avatars/bot.png
undefined
openclaw agents set-identity --agent main \ --name "MyAgent" \ --emoji "🤖" \ --avatar avatars/bot.png
undefined

Skills Management

Skill管理

List skills:
bash
openclaw skills list
openclaw skills list --eligible    # Only ready skills
openclaw skills list --json        # JSON output
Skill info:
bash
openclaw skills info <skill-name>
Check eligibility:
bash
openclaw skills check
列出Skill:
bash
openclaw skills list
openclaw skills list --eligible    # Only ready skills
openclaw skills list --json        # JSON output
Skill详情:
bash
openclaw skills info <skill-name>
检查可用性:
bash
openclaw skills check

Hooks Management

钩子管理

List hooks:
bash
openclaw hooks list
openclaw hooks list --eligible
openclaw hooks list --verbose      # Show missing requirements
Hook info:
bash
openclaw hooks info <hook-name>
Enable/disable:
bash
openclaw hooks enable session-memory
openclaw hooks disable command-logger
Install hooks:
bash
undefined
列出钩子:
bash
openclaw hooks list
openclaw hooks list --eligible
openclaw hooks list --verbose      # Show missing requirements
钩子详情:
bash
openclaw hooks info <hook-name>
启用/禁用:
bash
openclaw hooks enable session-memory
openclaw hooks disable command-logger
安装钩子:
bash
undefined

From npm

From npm

openclaw hooks install @openclaw/my-hooks
openclaw hooks install @openclaw/my-hooks

Local directory

Local directory

openclaw hooks install ./my-hooks
openclaw hooks install ./my-hooks

Link (development)

Link (development)

openclaw hooks install -l ./my-hooks

**Update hooks:**
```bash
openclaw hooks update <id>
openclaw hooks update --all
openclaw hooks install -l ./my-hooks

**更新钩子:**
```bash
openclaw hooks update <id>
openclaw hooks update --all

Channel Management

渠道管理

List channels:
bash
openclaw channels list
Channel status:
bash
openclaw channels status
openclaw channels status --probe
Add channel:
bash
undefined
列出渠道:
bash
openclaw channels list
渠道状态:
bash
openclaw channels status
openclaw channels status --probe
添加渠道:
bash
undefined

Interactive

Interactive

openclaw channels add
openclaw channels add

Telegram bot

Telegram bot

openclaw channels add --channel telegram
--account alerts
--name "Alerts Bot"
--token $TELEGRAM_BOT_TOKEN
openclaw channels add --channel telegram \ --account alerts \ --name "Alerts Bot" \ --token $TELEGRAM_BOT_TOKEN

Discord

Discord

openclaw channels add --channel discord
--account work
--token $DISCORD_BOT_TOKEN

**Remove channel:**
```bash
openclaw channels remove --channel telegram --account alerts
openclaw channels remove --channel discord --account work --delete
WhatsApp login:
bash
openclaw channels login --channel whatsapp
Channel logs:
bash
openclaw channels logs
openclaw channels logs --channel whatsapp --lines 100
openclaw channels add --channel discord \ --account work \ --token $DISCORD_BOT_TOKEN

**移除渠道:**
```bash
openclaw channels remove --channel telegram --account alerts
openclaw channels remove --channel discord --account work --delete
WhatsApp登录:
bash
openclaw channels login --channel whatsapp
渠道日志:
bash
openclaw channels logs
openclaw channels logs --channel whatsapp --lines 100

Models & Authentication

模型与身份验证

Status:
bash
openclaw models status
openclaw models status --probe               # Live check
openclaw models status --probe-provider anthropic
List models:
bash
openclaw models list
openclaw models list --all
openclaw models list --provider anthropic
Set default:
bash
openclaw models set claude-sonnet-4.5
openclaw models set-image claude-sonnet-4.5
Auth setup:
bash
undefined
状态:
bash
openclaw models status
openclaw models status --probe               # Live check
openclaw models status --probe-provider anthropic
列出模型:
bash
openclaw models list
openclaw models list --all
openclaw models list --provider anthropic
设置默认模型:
bash
openclaw models set claude-sonnet-4.5
openclaw models set-image claude-sonnet-4.5
身份验证设置:
bash
undefined

Anthropic (recommended)

Anthropic (recommended)

claude setup-token openclaw models auth setup-token --provider anthropic
claude setup-token openclaw models auth setup-token --provider anthropic

Or paste token

Or paste token

openclaw models auth paste-token --provider anthropic

**Fallbacks:**
```bash
openclaw models fallbacks list
openclaw models fallbacks add claude-opus-4.6
openclaw models fallbacks remove claude-haiku-4.5
openclaw models fallbacks clear
Scan for models:
bash
openclaw models scan
openclaw models scan --set-default
openclaw models auth paste-token --provider anthropic

** fallback设置:**
```bash
openclaw models fallbacks list
openclaw models fallbacks add claude-opus-4.6
openclaw models fallbacks remove claude-haiku-4.5
openclaw models fallbacks clear
扫描模型:
bash
openclaw models scan
openclaw models scan --set-default

Messaging

消息功能

Send message:
bash
openclaw message send \
  --target +15555550123 \
  --message "Hello from OpenClaw"
发送消息:
bash
openclaw message send \\
  --target +15555550123 \\
  --message "Hello from OpenClaw"

Discord channel

Discord channel

openclaw message send
--channel discord
--target channel:123456
--message "Deployment complete"

**Send poll:**
```bash
openclaw message poll \
  --channel discord \
  --target channel:123 \
  --poll-question "Lunch?" \
  --poll-option "Pizza" \
  --poll-option "Sushi"
Other message operations:
bash
openclaw message read --target +15555550123
openclaw message react --target <id> --emoji "👍"
openclaw message edit --target <id> --message "Updated"
openclaw message delete --target <id>
openclaw message send \ --channel discord \ --target channel:123456 \ --message "Deployment complete"

**发送投票:**
```bash
openclaw message poll \\
  --channel discord \\
  --target channel:123 \\
  --poll-question "Lunch?" \\
  --poll-option "Pizza" \\
  --poll-option "Sushi"
其他消息操作:
bash
openclaw message read --target +15555550123
openclaw message react --target <id> --emoji "👍"
openclaw message edit --target <id> --message "Updated"
openclaw message delete --target <id>

Browser Control

浏览器控制

Status & control:
bash
openclaw browser status
openclaw browser start
openclaw browser stop
openclaw browser tabs
Navigate:
bash
openclaw browser open https://example.com
openclaw browser navigate https://example.com --target-id <id>
Interact:
bash
openclaw browser click "#submit-button"
openclaw browser type "#email" "user@example.com"
openclaw browser press Enter
Capture:
bash
openclaw browser screenshot
openclaw browser screenshot --full-page
openclaw browser snapshot --format ai
Profiles:
bash
openclaw browser profiles
openclaw browser create-profile --name dev
openclaw browser delete-profile --name old
状态与控制:
bash
openclaw browser status
openclaw browser start
openclaw browser stop
openclaw browser tabs
导航:
bash
openclaw browser open https://example.com
openclaw browser navigate https://example.com --target-id <id>
交互操作:
bash
openclaw browser click "#submit-button"
openclaw browser type "#email" "user@example.com"
openclaw browser press Enter
捕获内容:
bash
openclaw browser screenshot
openclaw browser screenshot --full-page
openclaw browser snapshot --format ai
配置文件:
bash
openclaw browser profiles
openclaw browser create-profile --name dev
openclaw browser delete-profile --name old

Nodes & Devices

节点与设备

List nodes:
bash
openclaw nodes list
openclaw nodes status --connected
Node operations:
bash
undefined
列出节点:
bash
openclaw nodes list
openclaw nodes status --connected
节点操作:
bash
undefined

Describe node

Describe node

openclaw nodes describe --node <id>
openclaw nodes describe --node <id>

Run command on node

Run command on node

openclaw nodes run --node <id> --cwd /path -- ls -la
openclaw nodes run --node <id> --cwd /path -- ls -la

Notify (macOS)

Notify (macOS)

openclaw nodes notify --node <id>
--title "Build Complete"
--body "Success"
--sound default

**Camera:**
```bash
openclaw nodes camera list --node <id>
openclaw nodes camera snap --node <id> --facing front
openclaw nodes camera clip --node <id> --duration 10s
Canvas:
bash
openclaw nodes canvas snapshot --node <id>
openclaw nodes canvas present --node <id> --target index.html
openclaw nodes canvas hide --node <id>
Screen recording:
bash
openclaw nodes screen record --node <id> --duration 30s
openclaw nodes notify --node <id> \ --title "Build Complete" \ --body "Success" \ --sound default

**摄像头:**
```bash
openclaw nodes camera list --node <id>
openclaw nodes camera snap --node <id> --facing front
openclaw nodes camera clip --node <id> --duration 10s
画布:
bash
openclaw nodes canvas snapshot --node <id>
openclaw nodes canvas present --node <id> --target index.html
openclaw nodes canvas hide --node <id>
屏幕录制:
bash
openclaw nodes screen record --node <id> --duration 30s

System Commands

系统命令

System event:
bash
openclaw system event --text "Deployment complete" --mode now
Heartbeat:
bash
openclaw system heartbeat last
openclaw system heartbeat enable
openclaw system heartbeat disable
Presence:
bash
openclaw system presence
系统事件:
bash
openclaw system event --text "Deployment complete" --mode now
心跳检测:
bash
openclaw system heartbeat last
openclaw system heartbeat enable
openclaw system heartbeat disable
在线状态:
bash
openclaw system presence

Cron Jobs

定时任务

List jobs:
bash
openclaw cron list
openclaw cron list --all
openclaw cron status
Add job:
bash
undefined
列出任务:
bash
openclaw cron list
openclaw cron list --all
openclaw cron status
添加任务:
bash
undefined

System event every hour

System event every hour

openclaw cron add
--name "hourly-check"
--every "1h"
--system-event "Hourly check"
openclaw cron add \ --name "hourly-check" \ --every "1h" \ --system-event "Hourly check"

Message at specific time

Message at specific time

openclaw cron add
--name "morning-reminder"
--at "09:00"
--message "Good morning!"

**Manage jobs:**
```bash
openclaw cron enable <id>
openclaw cron disable <id>
openclaw cron rm <id>
openclaw cron run <id>
Job runs:
bash
openclaw cron runs --id <id> --limit 10
openclaw cron add \ --name "morning-reminder" \ --at "09:00" \ --message "Good morning!"

**管理任务:**
```bash
openclaw cron enable <id>
openclaw cron disable <id>
openclaw cron rm <id>
openclaw cron run <id>
任务执行记录:
bash
openclaw cron runs --id <id> --limit 10

Configuration

配置

Get/set config:
bash
undefined
获取/设置配置:
bash
undefined

Get value

Get value

openclaw config get agents.defaults.model.primary
openclaw config get agents.defaults.model.primary

Set value

Set value

openclaw config set agents.defaults.model.primary "claude-sonnet-4.5"
openclaw config set agents.defaults.model.primary "claude-sonnet-4.5"

Unset value

Unset value

openclaw config unset some.config.path
undefined
openclaw config unset some.config.path
undefined

Memory Operations

内存操作

Memory status:
bash
openclaw memory status
Index memory:
bash
openclaw memory index
Search memory:
bash
openclaw memory search "GraphQL implementation patterns"
内存状态:
bash
openclaw memory status
索引内存:
bash
openclaw memory index
搜索内存:
bash
openclaw memory search "GraphQL implementation patterns"

Logs

日志

Tail logs:
bash
openclaw logs
openclaw logs --follow
openclaw logs --limit 200
openclaw logs --json
查看日志:
bash
openclaw logs
openclaw logs --follow
openclaw logs --limit 200
openclaw logs --json

Sandbox

沙箱

List sandboxes:
bash
openclaw sandbox list
Recreate sandbox:
bash
openclaw sandbox recreate
列出沙箱:
bash
openclaw sandbox list
重建沙箱:
bash
openclaw sandbox recreate

Security

安全

Security audit:
bash
openclaw security audit
openclaw security audit --deep
openclaw security audit --fix
安全审计:
bash
openclaw security audit
openclaw security audit --deep
openclaw security audit --fix

Plugins

插件

List plugins:
bash
openclaw plugins list
openclaw plugins list --json
Plugin info:
bash
openclaw plugins info <plugin-id>
Install plugin:
bash
openclaw plugins install <path-or-spec>
Enable/disable:
bash
openclaw plugins enable <id>
openclaw plugins disable <id>
Plugin health:
bash
openclaw plugins doctor
列出插件:
bash
openclaw plugins list
openclaw plugins list --json
插件详情:
bash
openclaw plugins info <plugin-id>
安装插件:
bash
openclaw plugins install <path-or-spec>
启用/禁用:
bash
openclaw plugins enable <id>
openclaw plugins disable <id>
插件健康检查:
bash
openclaw plugins doctor

Update & Maintenance

更新与维护

Update OpenClaw:
bash
openclaw update
Reset config:
bash
openclaw reset --scope config
openclaw reset --scope config+creds+sessions
openclaw reset --scope full
Uninstall:
bash
openclaw uninstall --service
openclaw uninstall --state
openclaw uninstall --workspace
openclaw uninstall --all
更新OpenClaw:
bash
openclaw update
重置配置:
bash
openclaw reset --scope config
openclaw reset --scope config+creds+sessions
openclaw reset --scope full
卸载:
bash
openclaw uninstall --service
openclaw uninstall --state
openclaw uninstall --workspace
openclaw uninstall --all

Global Flags

全局参数

Available everywhere:
bash
--dev               # Use ~/.openclaw-dev for isolation
--profile <name>    # Use ~/.openclaw-<name>
--no-color         # Disable ANSI colors
--json             # Machine-readable output
-V, --version      # Show version
所有命令均支持:
bash
--dev               # Use ~/.openclaw-dev for isolation
--profile <name>    # Use ~/.openclaw-<name>
--no-color         # Disable ANSI colors
--json             # Machine-readable output
-V, --version      # Show version

Common Workflows

常见工作流

First-Time Setup

首次设置

bash
undefined
bash
undefined

1. Onboard with daemon

1. Onboard with daemon

openclaw onboard --install-daemon
openclaw onboard --install-daemon

2. Pair WhatsApp (or other channel)

2. Pair WhatsApp (or other channel)

openclaw channels login
openclaw channels login

3. Start gateway

3. Start gateway

openclaw gateway
openclaw gateway

4. Test with message

4. Test with message

openclaw message send --target +1234567890 --message "Test"
undefined
openclaw message send --target +1234567890 --message "Test"
undefined

Multi-Agent Setup

多Agent设置

bash
undefined
bash
undefined

1. Add agent

1. Add agent

openclaw agents add work --workspace ~/.openclaw/workspace-work
openclaw agents add work --workspace ~/.openclaw/workspace-work

2. Set identity

2. Set identity

openclaw agents set-identity --agent work --from-identity
openclaw agents set-identity --agent work --from-identity

3. Add binding (in openclaw.json)

3. Add binding (in openclaw.json)

bindings: [{ agentId: "work", match: { channel: "discord" } }]

bindings: [{ agentId: "work", match: { channel: "discord" } }]

4. List to verify

4. List to verify

openclaw agents list --bindings
undefined
openclaw agents list --bindings
undefined

Hook Automation

钩子自动化

bash
undefined
bash
undefined

1. Enable session memory hook

1. Enable session memory hook

openclaw hooks enable session-memory
openclaw hooks enable session-memory

2. Enable command logger

2. Enable command logger

openclaw hooks enable command-logger
openclaw hooks enable command-logger

3. Verify

3. Verify

openclaw hooks check
openclaw hooks check

4. Restart gateway

4. Restart gateway

openclaw gateway restart
undefined
openclaw gateway restart
undefined

Channel Setup

渠道设置

bash
undefined
bash
undefined

1. Add Telegram bot

1. Add Telegram bot

openclaw channels add --channel telegram
--account alerts
--token $TELEGRAM_BOT_TOKEN
openclaw channels add --channel telegram \ --account alerts \ --token $TELEGRAM_BOT_TOKEN

2. Verify

2. Verify

openclaw channels status
openclaw channels status

3. Send test message

3. Send test message

openclaw message send --channel telegram
--target <chat-id>
--message "Bot online"
undefined
openclaw message send --channel telegram \ --target <chat-id> \ --message "Bot online"
undefined

Model Configuration

模型配置

bash
undefined
bash
undefined

1. Setup auth

1. Setup auth

claude setup-token
claude setup-token

2. Set default model

2. Set default model

openclaw models set claude-sonnet-4.5
openclaw models set claude-sonnet-4.5

3. Add fallbacks

3. Add fallbacks

openclaw models fallbacks add claude-opus-4.6 openclaw models fallbacks add claude-haiku-4.5
openclaw models fallbacks add claude-opus-4.6 openclaw models fallbacks add claude-haiku-4.5

4. Verify

4. Verify

openclaw models status
undefined
openclaw models status
undefined

Debugging

调试

Check gateway status:
bash
openclaw status --deep
openclaw doctor
openclaw health
View logs:
bash
openclaw logs --follow
openclaw channels logs --lines 200
Test channel:
bash
openclaw channels status --probe
Check skills/hooks:
bash
openclaw skills check
openclaw hooks check
openclaw plugins doctor
检查网关状态:
bash
openclaw status --deep
openclaw doctor
openclaw health
查看日志:
bash
openclaw logs --follow
openclaw channels logs --lines 200
测试渠道:
bash
openclaw channels status --probe
检查Skill/钩子:
bash
openclaw skills check
openclaw hooks check
openclaw plugins doctor

Tips

小贴士

  1. Use
    --json
    for scripting
    - All commands support JSON output
  2. Profile isolation - Use
    --profile
    for testing without affecting main config
  3. Doctor fixes - Run
    openclaw doctor
    regularly to catch issues
  4. Logs location -
    ~/.openclaw/logs/
    for file logs
  5. Config location -
    ~/.openclaw/openclaw.json
  6. Workspace -
    ~/.openclaw/workspace
    (or custom path)
  1. 脚本化使用
    --json
    参数
    - 所有命令均支持JSON输出
  2. 配置文件隔离 - 使用
    --profile
    参数进行测试,不影响主配置
  3. 定期运行
    openclaw doctor
    - 及时发现并修复问题
  4. 日志位置 - 文件日志位于
    ~/.openclaw/logs/
  5. 配置文件位置 -
    ~/.openclaw/openclaw.json
  6. 工作区 - 默认
    ~/.openclaw/workspace
    (可自定义路径)

Resources

资源