openclaw agent(ダイレクトエージェント実行)
openclaw agent は、受信チャットメッセージを必要とせず、単一のエージェントターンを実行します。
デフォルトでは Gateway 経由 で動作しますが、--local を付けると現在のマシン上の組み込みランタイムを強制的に使用します。
動作
- 必須:
--message <text> - セッション選択:
--to <dest>でセッションキーを導出(グループ/チャンネル指定時は分離を維持、ダイレクトチャットはmainに集約)、または--session-id <id>で既存セッション ID を再利用、または--agent <id>で設定済みエージェントを直接指定(そのエージェントのmainセッションキーを使用)
- 通常の受信返信と同じ組み込みエージェントランタイムで実行されます。
- thinking/verbose フラグはセッションストアに保持されます。
- 出力:
- デフォルト: 返信テキスト(
MEDIA:<url>行を含む)を表示 --json: 構造化ペイロード+メタデータを表示
- デフォルト: 返信テキスト(
--deliver+--channelでチャンネルへの配信も可能(ターゲット形式はopenclaw message --targetと同様)。--reply-channel/--reply-to/--reply-accountでセッションを変更せずに配信先をオーバーライドできます。
Gateway に到達できない場合、CLI は組み込みローカル実行にフォールバックします。
使用例
openclaw agent --to +15555550123 --message "status update"
openclaw agent --agent ops --message "Summarize logs"
openclaw agent --session-id 1234 --message "Summarize inbox" --thinking medium
openclaw agent --to +15555550123 --message "Trace logs" --verbose on --json
openclaw agent --to +15555550123 --message "Summon reply" --deliver
openclaw agent --agent ops --message "Generate report" --deliver --reply-channel slack --reply-to "#reports"
フラグ
--local: ローカル実行(シェルにモデルプロバイダー API キーが必要)--deliver: 選択したチャンネルに返信を送信--channel: 配信チャンネル(whatsapp|telegram|discord|googlechat|slack|signal|imessage、デフォルト:whatsapp)--reply-to: 配信先オーバーライド--reply-channel: 配信チャンネルオーバーライド--reply-account: 配信アカウント ID オーバーライド--thinking <off|minimal|low|medium|high|xhigh>: thinking レベルを保持(GPT-5.2 + Codex モデルのみ)--verbose <on|full|off>: verbose レベルを保持--timeout <seconds>: エージェントタイムアウトをオーバーライド--json: 構造化 JSON を出力