Skip to content

#付録 A: コマンドのチートシート

OpenClaw は豊富なコマンド ライン ツールを提供します。この付録では、公式ドキュメントに基づいて、一般的に使用されるすべてのコマンドを整理します。

参照元:OpenClaw CLI Reference

クイックナビゲーション


グローバルオプション

bash
openclaw [--dev] [--profile <name>] <command>

--dev              # 隔离状态到 ~/.openclaw-dev,并偏移默认端口
--profile <name>   # 隔离状态到 ~/.openclaw-<name>
--no-color         # 禁用 ANSI 颜色
--update           # 简写为 openclaw update(仅源码安装)
-V, --version, -v  # 打印版本并退出

インストールとアップデート

OpenClaw をインストールする

bash
# 通过 npm 安装(推荐)
npm install -g openclaw@latest

# 或通过 pnpm
pnpm add -g openclaw@latest

OpenClaw を更新する

bash
# 检查并更新到最新版本
openclaw update

# 切换到特定频道
openclaw update --channel stable|beta|dev

# 查看当前版本
openclaw --version

OpenClaw をアンインストールする

bash
# 卸载网关服务和本地数据(CLI 保留)
openclaw uninstall

# 指定范围卸载
openclaw uninstall --service --state --workspace --app --all

# 重置配置和状态(保留 CLI)
openclaw reset
openclaw reset --scope config+creds+sessions --yes

初期化と構成

初期化ウィザード

bash
# 交互式设置向导(推荐)
openclaw onboard

# 初始化并安装守护进程
openclaw onboard --install-daemon

# 非交互式模式
openclaw onboard --non-interactive --mode local

# 重置后重新初始化
openclaw onboard --reset

構成ウィザード

bash
# 交互式配置向导
openclaw configure

# 验证配置
openclaw doctor
openclaw doctor --fix          # 自动修复
openclaw doctor --deep         # 深度扫描

コンソールを開きます

bash
# 启动 Web Dashboard
openclaw dashboard

ゲートウェイ管理

Gateway は OpenClaw のコア サービスであり、デフォルトでは ws://127.0.0.1:18789 で実行されます。

ゲートウェイの開始

bash
# 前台运行(调试模式)
openclaw gateway --port 18789 --verbose

# 指定绑定地址
openclaw gateway --bind loopback|lan|tailnet|auto|custom

# 使用 Token 认证
openclaw gateway --auth token --token <token>

# 使用密码认证
openclaw gateway --auth password --password <password>

# Tailscale 集成
openclaw gateway --tailscale serve|funnel

# 开发模式
openclaw gateway --dev

ゲートウェイサービス管理

bash
# 查看网关服务状态
openclaw gateway status

# 安装为系统服务
openclaw gateway install

# 卸载服务
openclaw gateway uninstall

# 启动/停止/重启服务
openclaw gateway start
openclaw gateway stop
openclaw gateway restart

# 查看日志
openclaw logs
openclaw logs --limit 100

ゲートウェイのヘルスチェック

bash
# 获取网关健康状态
openclaw health
openclaw health --json
openclaw health --verbose

# 网关调用(RPC)
openclaw gateway call <method> --params '<json>'

エージェント管理

すべてのエージェントをリストする

bash
openclaw agents list
openclaw agents list --json
openclaw agents list --bindings

エージェントを追加

bash
# 交互式添加
openclaw agents add

# 指定名称添加
openclaw agents add [name]

# 非交互式添加
openclaw agents add my-agent \
  --workspace ~/.openclaw/workspace-my-agent \
  --model anthropic/claude-sonnet-4-5 \
  --bind whatsapp:personal \
  --non-interactive

バインディング管理

bash
# 查看绑定
openclaw agents bindings
openclaw agents bindings --agent <id>

# 添加绑定
openclaw agents bind --agent <id> --bind <channel[:accountId]>

# 移除绑定
openclaw agents unbind --agent <id> --bind <channel[:accountId]>
openclaw agents unbind --agent <id> --all

エージェントの削除

bash
openclaw agents delete <id>
openclaw agents delete <id> --force

エージェントを実行する

bash
# 单次对话
openclaw agent --message "Hello" --to <dest>

# 指定会话
openclaw agent --message "Hello" --session-id <id>

# 指定思考级别
openclaw agent --message "Hello" --thinking high

# 本地模式(不通过网关)
openclaw agent --message "Hello" --local

# 指定渠道回复
openclaw agent --message "Hello" --channel whatsapp --deliver

スキル管理

スキルをリストアップする

bash
openclaw skills list
openclaw skills list --eligible    # 仅显示就绪技能
openclaw skills list --json
openclaw skills list -v            # 显示缺失需求详情

スキルの詳細を表示する

bash
openclaw skills info <name>

スキルステータスを確認する

bash
openclaw skills check

ヒント: npx clawhub を使用して、スキルを検索、インストール、同期します。


プラグイン管理

プラグインの一覧表示

bash
openclaw plugins list
openclaw plugins list --json

プラグインの詳細を表示する

bash
openclaw plugins info <id>

プラグインをインストールする

bash
openclaw plugins install <path|.tgz|npm-spec>

プラグインを有効/無効にする

bash
openclaw plugins enable <id>
openclaw plugins disable <id>

プラグイン診断

bash
openclaw plugins doctor

メモリ管理

メモリステータスの表示

bash
openclaw memory status

インデックスメモリ

bash
openclaw memory index

メモリの検索

bash
openclaw memory search "<query>"
openclaw memory search --query "<query>"

デバイス管理

デバイスのリストを表示する

bash
openclaw devices list
openclaw devices list --json

承認装置

bash
openclaw devices approve [requestId]
openclaw devices approve --latest

デバイスを拒否します

bash
openclaw devices reject <requestId>

デバイスを削除します

bash
openclaw devices remove <deviceId>

デバイスをクリアします

bash
openclaw devices clear --yes
openclaw devices clear --yes --pending

ペアリング管理

ペアリング要求をリストする

bash
openclaw pairing list
openclaw pairing list [channel] --channel <channel> --account <id>

ペアリングを承認する

bash
openclaw pairing approve <channel> <code>
openclaw pairing approve --channel <channel> <code> --notify

チャネル管理

チャンネルをリストする

bash
openclaw channels list
openclaw channels list --json

チャンネルのステータスを確認する

bash
openclaw channels status
openclaw channels status --probe

チャンネルログを表示する

bash
openclaw channels logs
openclaw channels logs --channel <name> --limit 200

チャンネルを追加

bash
# 交互式添加
openclaw channels add

# 非交互式添加 Telegram
openclaw channels add \
  --channel telegram \
  --account alerts \
  --name "Alerts Bot" \
  --token $TELEGRAM_BOT_TOKEN

# 非交互式添加 Discord
openclaw channels add \
  --channel discord \
  --account work \
  --name "Work Bot" \
  --token $DISCORD_BOT_TOKEN

チャンネルを削除します

bash
openclaw channels remove --channel <channel> --account <id>
openclaw channels remove --channel <channel> --account <id> --delete

ログイン/ログアウト

bash
# WhatsApp Web 登录
openclaw channels login
openclaw channels login --channel whatsapp --account <id> --verbose

# 登出
openclaw channels logout
openclaw channels logout --channel <channel> --account <id>

メッセージ送信

メッセージを送信

bash
openclaw message send --target +15555550123 --message "Hello"

投票を送信

bash
openclaw message poll \
  --channel discord \
  --target channel:123 \
  --poll-question "Snack?" \
  --poll-option Pizza \
  --poll-option Sushi

その他のメッセージ操作

bash
openclaw message react
openclaw message reactions
openclaw message read
openclaw message edit
openclaw message delete
openclaw message pin
openclaw message unpin

モデル管理

モデルのリスト

bash
openclaw models list
openclaw models status

モデルをセットアップする

bash
openclaw models set <model>
openclaw models set-image <model>

モデルのエイリアス

bash
openclaw models aliases list
openclaw models aliases add <alias> <model>
openclaw models aliases remove <alias>

モデルのロールバック

bash
openclaw models fallbacks list
openclaw models fallbacks add <model>
openclaw models fallbacks remove <model>
openclaw models fallbacks clear

モデル認定

bash
openclaw models auth add
openclaw models auth setup-token
openclaw models auth paste-token
openclaw models auth order get|set|clear

設定操作

構成を取得する

bash
openclaw config get <path>
openclaw config get agents.defaults.workspace

設定の設定

bash
openclaw config set <path> <value>
openclaw config set agents.defaults.heartbeat.every "2h"

構成の削除

bash
openclaw config unset <path>

設定ファイルのパス

bash
openclaw config file

構成を確認する

bash
openclaw config validate
openclaw config validate --json

システム管理

システムイベント

bash
openclaw system event

ハートビート管理

bash
openclaw system heartbeat last
openclaw system heartbeat enable
openclaw system heartbeat disable

オンラインステータス

bash
openclaw system presence

セキュリティ管理

セキュリティ監査

bash
openclaw security audit
openclaw security audit --deep
openclaw security audit --fix

鍵管理

bash
openclaw secrets reload
openclaw secrets audit
openclaw secrets configure
openclaw secrets apply --from <plan.json>

セッション管理

セッションの一覧表示

bash
openclaw sessions list
openclaw sessions --json
openclaw sessions --verbose

ステータスを確認する

bash
openclaw status
openclaw status --json
openclaw status --deep
openclaw status --usage

ブラウザ管理

bash
openclaw browser status
openclaw browser start
openclaw browser stop
openclaw browser reset-profile
openclaw browser tabs
openclaw browser open <url>
openclaw browser screenshot
openclaw browser navigate <url>

スケジュールされたタスク

bash
openclaw cron status
openclaw cron list
openclaw cron add
openclaw cron edit <id>
openclaw cron rm <id>
openclaw cron enable <id>
openclaw cron disable <id>
openclaw cron runs
openclaw cron run <id>

ショートカット コマンドのエイリアス

効率を向上させるために、よく使用されるコマンドのエイリアスを設定できます。

bash
# 添加到 ~/.bashrc 或 ~/.zshrc
alias oc='openclaw'
alias ocg='openclaw gateway'
alias ocs='openclaw skills'
alias oca='openclaw agents'
alias ocd='openclaw dashboard'
alias ocdr='openclaw doctor'
alias occh='openclaw channels'

# 快速启动别名
alias ocstart='openclaw gateway start && openclaw dashboard'
alias ocstop='openclaw gateway stop'
alias ocrestart='openclaw gateway restart'

トラブルシューティングのクイックチェック

問題診断コマンドソリューション
ゲートウェイを起動できません。 openclaw doctorポート占有率を確認し、ログを表示します。
ダッシュボードにアクセスできませんopenclaw gateway statusゲートウェイが実行されていることを確認し、ファイアウォールをチェックします。
チャネル接続に失敗しましたopenclaw channels status --probeチャネル構成と認証を確認する
モデルの接続に失敗しましたopenclaw models statusAPI キーとモデル構成を確認する
デバイスのペアリングに失敗しましたopenclaw devices list保留中のデバイスを承認する
構成の検証に失敗しましたopenclaw config validateエラー プロンプトに従って構成を修復します。

さらにヘルプ

bash
# 查看全局帮助
openclaw --help

# 查看子命令帮助
openclaw <command> --help

# 查看具体命令帮助
openclaw gateway --help
openclaw channels add --help

ヒント: このチートシートは、OpenClaw の公式ドキュメントに基づいています。最新情報については、docs.openclaw.ai にアクセスすることをお勧めします。