openclaw-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOpenClaw 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
undefinedQuick 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 doctoropenclaw configure
**健康检查:**
```bash
openclaw doctorGateway Management
网关管理
Run gateway:
bash
undefined启动网关:
bash
undefinedInteractive 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:**
```bashopenclaw gateway --tailscale serve
**网关服务:**
```bashInstall 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 healthopenclaw gateway start
openclaw gateway stop
openclaw gateway restart
openclaw gateway status
**网关健康状态:**
```bash
openclaw status
openclaw status --deep # Probe channels
openclaw healthAgent Management
Agent管理
List agents:
bash
openclaw agents list
openclaw agents list --bindings # Show routingAdd agent:
bash
undefined列出Agent:
bash
openclaw agents list
openclaw agents list --bindings # Show routing添加Agent:
bash
undefinedInteractive 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
--workspace ~/.openclaw/workspace-dev
--model claude-sonnet-4.5
--non-interactive
**Delete agent:**
```bash
openclaw agents delete <id>Set identity:
bash
undefinedopenclaw agents add dev \
--workspace ~/.openclaw/workspace-dev \
--model claude-sonnet-4.5 \
--non-interactive
**删除Agent:**
```bash
openclaw agents delete <id>设置身份信息:
bash
undefinedFrom 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
--name "MyAgent"
--emoji "🤖"
--avatar avatars/bot.png
undefinedopenclaw agents set-identity --agent main \
--name "MyAgent" \
--emoji "🤖" \
--avatar avatars/bot.png
undefinedSkills Management
Skill管理
List skills:
bash
openclaw skills list
openclaw skills list --eligible # Only ready skills
openclaw skills list --json # JSON outputSkill 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 outputSkill详情:
bash
openclaw skills info <skill-name>检查可用性:
bash
openclaw skills checkHooks Management
钩子管理
List hooks:
bash
openclaw hooks list
openclaw hooks list --eligible
openclaw hooks list --verbose # Show missing requirementsHook info:
bash
openclaw hooks info <hook-name>Enable/disable:
bash
openclaw hooks enable session-memory
openclaw hooks disable command-loggerInstall 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
undefinedFrom 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 --allopenclaw hooks install -l ./my-hooks
**更新钩子:**
```bash
openclaw hooks update <id>
openclaw hooks update --allChannel Management
渠道管理
List channels:
bash
openclaw channels listChannel status:
bash
openclaw channels status
openclaw channels status --probeAdd channel:
bash
undefined列出渠道:
bash
openclaw channels list渠道状态:
bash
openclaw channels status
openclaw channels status --probe添加渠道:
bash
undefinedInteractive
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
--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
--account work
--token $DISCORD_BOT_TOKEN
**Remove channel:**
```bash
openclaw channels remove --channel telegram --account alerts
openclaw channels remove --channel discord --account work --deleteWhatsApp login:
bash
openclaw channels login --channel whatsappChannel logs:
bash
openclaw channels logs
openclaw channels logs --channel whatsapp --lines 100openclaw 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 --deleteWhatsApp登录:
bash
openclaw channels login --channel whatsapp渠道日志:
bash
openclaw channels logs
openclaw channels logs --channel whatsapp --lines 100Models & Authentication
模型与身份验证
Status:
bash
openclaw models status
openclaw models status --probe # Live check
openclaw models status --probe-provider anthropicList models:
bash
openclaw models list
openclaw models list --all
openclaw models list --provider anthropicSet default:
bash
openclaw models set claude-sonnet-4.5
openclaw models set-image claude-sonnet-4.5Auth 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
undefinedAnthropic (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 clearScan for models:
bash
openclaw models scan
openclaw models scan --set-defaultopenclaw 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-defaultMessaging
消息功能
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"
--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 tabsNavigate:
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 EnterCapture:
bash
openclaw browser screenshot
openclaw browser screenshot --full-page
openclaw browser snapshot --format aiProfiles:
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 oldNodes & Devices
节点与设备
List nodes:
bash
openclaw nodes list
openclaw nodes status --connectedNode operations:
bash
undefined列出节点:
bash
openclaw nodes list
openclaw nodes status --connected节点操作:
bash
undefinedDescribe 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
--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 10sCanvas:
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 30sopenclaw 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 30sSystem Commands
系统命令
System event:
bash
openclaw system event --text "Deployment complete" --mode nowHeartbeat:
bash
openclaw system heartbeat last
openclaw system heartbeat enable
openclaw system heartbeat disablePresence:
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 presenceCron Jobs
定时任务
List jobs:
bash
openclaw cron list
openclaw cron list --all
openclaw cron statusAdd job:
bash
undefined列出任务:
bash
openclaw cron list
openclaw cron list --all
openclaw cron status添加任务:
bash
undefinedSystem event every hour
System event every hour
openclaw cron add
--name "hourly-check"
--every "1h"
--system-event "Hourly check"
--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!"
--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 10openclaw 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 10Configuration
配置
Get/set config:
bash
undefined获取/设置配置:
bash
undefinedGet 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
undefinedopenclaw config unset some.config.path
undefinedMemory Operations
内存操作
Memory status:
bash
openclaw memory statusIndex memory:
bash
openclaw memory indexSearch 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 --jsonSandbox
沙箱
List sandboxes:
bash
openclaw sandbox listRecreate sandbox:
bash
openclaw sandbox recreate列出沙箱:
bash
openclaw sandbox list重建沙箱:
bash
openclaw sandbox recreateSecurity
安全
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 --fixPlugins
插件
List plugins:
bash
openclaw plugins list
openclaw plugins list --jsonPlugin 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 doctorUpdate & Maintenance
更新与维护
Update OpenClaw:
bash
openclaw updateReset config:
bash
openclaw reset --scope config
openclaw reset --scope config+creds+sessions
openclaw reset --scope fullUninstall:
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 --allGlobal 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 versionCommon Workflows
常见工作流
First-Time Setup
首次设置
bash
undefinedbash
undefined1. 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"
undefinedopenclaw message send --target +1234567890 --message "Test"
undefinedMulti-Agent Setup
多Agent设置
bash
undefinedbash
undefined1. 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
undefinedopenclaw agents list --bindings
undefinedHook Automation
钩子自动化
bash
undefinedbash
undefined1. 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
undefinedopenclaw gateway restart
undefinedChannel Setup
渠道设置
bash
undefinedbash
undefined1. Add Telegram bot
1. Add Telegram bot
openclaw channels add --channel telegram
--account alerts
--token $TELEGRAM_BOT_TOKEN
--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"
--target <chat-id>
--message "Bot online"
undefinedopenclaw message send --channel telegram \
--target <chat-id> \
--message "Bot online"
undefinedModel Configuration
模型配置
bash
undefinedbash
undefined1. 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
undefinedopenclaw models status
undefinedDebugging
调试
Check gateway status:
bash
openclaw status --deep
openclaw doctor
openclaw healthView logs:
bash
openclaw logs --follow
openclaw channels logs --lines 200Test channel:
bash
openclaw channels status --probeCheck 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 doctorTips
小贴士
- Use for scripting - All commands support JSON output
--json - Profile isolation - Use for testing without affecting main config
--profile - Doctor fixes - Run regularly to catch issues
openclaw doctor - Logs location - for file logs
~/.openclaw/logs/ - Config location -
~/.openclaw/openclaw.json - Workspace - (or custom path)
~/.openclaw/workspace
- 脚本化使用参数 - 所有命令均支持JSON输出
--json - 配置文件隔离 - 使用参数进行测试,不影响主配置
--profile - 定期运行- 及时发现并修复问题
openclaw doctor - 日志位置 - 文件日志位于
~/.openclaw/logs/ - 配置文件位置 -
~/.openclaw/openclaw.json - 工作区 - 默认(可自定义路径)
~/.openclaw/workspace