Agent coordination
エージェント送信
openclaw agent は、受信チャットメッセージを必要とせずにコマンドラインから単一のエージェントターンを実行します。スクリプト化されたワークフロー、テスト、プログラムによる配信に使用します。
クイックスタート
単純なエージェントターンを実行する
openclaw agent --message "What is the weather today?"これはメッセージを Gateway 経由で送信し、返信を出力します。
特定のエージェントまたはセッションを対象にする
# Target a specific agentopenclaw agent --agent ops --message "Summarize logs" # Target a phone number (derives session key)openclaw agent --to +15555550123 --message "Status update" # Reuse an existing sessionopenclaw agent --session-id abc123 --message "Continue the task"返信をチャンネルに配信する
# Deliver to WhatsApp (default channel)openclaw agent --to +15555550123 --message "Report ready" --deliver # Deliver to Slackopenclaw agent --agent ops --message "Generate report" \ --deliver --reply-channel slack --reply-to "#reports"フラグ
| フラグ | 説明 |
|---|---|
--message \<text\> |
送信するメッセージ(必須) |
--to \<dest\> |
対象(電話、チャット ID)からセッションキーを導出する |
--agent \<id\> |
設定済みエージェントを対象にする(その main セッションを使用) |
--session-id \<id\> |
ID で既存のセッションを再利用する |
--local |
ローカルの組み込みランタイムを強制する(Gateway をスキップ) |
--deliver |
返信をチャットチャンネルに送信する |
--channel \<name\> |
配信チャンネル(whatsapp、telegram、discord、slack など) |
--reply-to \<target\> |
配信先の上書き |
--reply-channel \<name\> |
配信チャンネルの上書き |
--reply-account \<id\> |
配信アカウント ID の上書き |
--thinking \<level\> |
選択したモデルプロファイルの thinking レベルを設定する |
--verbose \<on|full|off\> |
verbose レベルを設定する |
--timeout \<seconds\> |
エージェントのタイムアウトを上書きする |
--json |
構造化 JSON を出力する |
動作
- デフォルトでは、CLI は Gateway 経由で動作します。現在のマシン上の組み込みランタイムを強制するには
--localを追加します。 - Gateway に到達できない場合、CLI はローカルの組み込み実行にフォールバックします。
- セッション選択:
--toはセッションキーを導出します(グループ/チャンネルの対象は分離を維持し、直接チャットはmainに統合されます)。 - thinking と verbose のフラグはセッションストアに永続化されます。
- 出力: デフォルトはプレーンテキスト、構造化ペイロード + メタデータには
--jsonを使用します。 --json --deliverを指定すると、JSON には送信済み、抑制済み、部分送信、送信失敗の配信ステータスが含まれます。JSON 配信ステータスを参照してください。
例
# Simple turn with JSON outputopenclaw agent --to +15555550123 --message "Trace logs" --verbose on --json # Turn with thinking levelopenclaw agent --session-id 1234 --message "Summarize inbox" --thinking medium # Deliver to a different channel than the sessionopenclaw agent --agent ops --message "Alert" --deliver --reply-channel telegram --reply-to "@admin"