CLI commands
エージェント
openclaw agents
分離されたエージェント(ワークスペース + 認証 + ルーティング)を管理します。
関連:
- マルチエージェントルーティング
- エージェントワークスペース
- Skills 設定: スキルの可視性設定。
例
openclaw agents listopenclaw agents list --bindingsopenclaw agents add work --workspace ~/.openclaw/workspace-workopenclaw agents add work --workspace ~/.openclaw/workspace-work --bind telegram:*openclaw agents add ops --workspace ~/.openclaw/workspace-ops --bind telegram:ops --non-interactiveopenclaw agents bindingsopenclaw agents bind --agent work --bind telegram:opsopenclaw agents unbind --agent work --bind telegram:opsopenclaw agents set-identity --workspace ~/.openclaw/workspace --from-identityopenclaw agents set-identity --agent main --avatar avatars/openclaw.pngopenclaw agents delete workルーティングバインディング
ルーティングバインディングを使用して、受信チャネルトラフィックを特定のエージェントに固定します。
エージェントごとに表示されるスキルも変えたい場合は、openclaw.json の agents.defaults.skills と agents.list[].skills を設定します。Skills 設定 と 設定リファレンス を参照してください。
バインディングを一覧表示します:
openclaw agents bindingsopenclaw agents bindings --agent workopenclaw agents bindings --jsonバインディングを追加します:
openclaw agents bind --agent work --bind telegram:ops --bind discord:guild-aエージェントの作成時にバインディングを追加することもできます:
openclaw agents add work --workspace ~/.openclaw/workspace-work --bind telegram:* --bind discord:*accountId(--bind <channel>)を省略すると、OpenClaw は Plugin セットアップフック、強制アカウントバインディング、またはチャネルに設定されたアカウント数から解決します。
bind または unbind で --agent を省略すると、OpenClaw は現在のデフォルトエージェントを対象にします。
--bind 形式
| 形式 | 意味 |
|---|---|
--bind <channel>:* |
チャネル上のすべてのアカウントに一致します。 |
--bind <channel>:<account> |
1 つのアカウントに一致します。 |
--bind <channel> |
CLI が Plugin 固有のアカウントスコープを安全に解決できる場合を除き、デフォルトアカウントのみに一致します。 |
バインディングスコープの動作
accountIdなしで保存されたバインディングは、チャネルのデフォルトアカウントのみに一致します。accountId: "*"はチャネル全体のフォールバック(すべてのアカウント)であり、明示的なアカウントバインディングより具体性が低くなります。- 同じエージェントに
accountIdなしの一致するチャネルバインディングがすでにあり、後から明示的または解決済みのaccountIdでバインドした場合、OpenClaw は重複を追加する代わりに、その既存のバインディングをその場でアップグレードします。
例:
# match all accounts on the channelopenclaw agents bind --agent work --bind telegram:* # match a specific accountopenclaw agents bind --agent work --bind telegram:ops # initial channel-only bindingopenclaw agents bind --agent work --bind telegram # later upgrade to account-scoped bindingopenclaw agents bind --agent work --bind telegram:alertsアップグレード後、そのバインディングのルーティングは telegram:alerts にスコープされます。デフォルトアカウントのルーティングも必要な場合は、明示的に追加します(例: --bind telegram:default)。
バインディングを削除します:
openclaw agents unbind --agent work --bind telegram:opsopenclaw agents unbind --agent work --allunbind は --all または 1 つ以上の --bind 値のどちらかを受け付けますが、両方は受け付けません。
コマンドサーフェス
agents
サブコマンドなしで openclaw agents を実行することは、openclaw agents list と同等です。
agents list
オプション:
--json--bindings: エージェントごとの件数や要約だけでなく、完全なルーティングルールを含めます
agents add [name]
オプション:
--workspace <dir>--model <id>--agent-dir <dir>--bind <channel[:accountId]>(繰り返し指定可能)--non-interactive--json
注記:
- 明示的な追加フラグを渡すと、コマンドは非対話パスに切り替わります。
- 非対話モードでは、エージェント名と
--workspaceの両方が必要です。 mainは予約済みであり、新しいエージェント ID として使用できません。- 対話モードでは、認証シードはポータブルな静的プロファイルのみをコピーします
(デフォルトでは
api_keyと静的token)。OAuth 更新トークンプロファイルは、 実際のmainエージェントストアからの読み取りスルー継承によってのみ引き続き利用できます。 設定済みのデフォルトエージェントがmainではない場合、新しいエージェントで OAuth プロファイルに個別にサインインしてください。
agents bindings
オプション:
--agent <id>--json
agents bind
オプション:
--agent <id>(現在のデフォルトエージェントが既定)--bind <channel[:accountId]>(繰り返し指定可能)--json
agents unbind
オプション:
--agent <id>(現在のデフォルトエージェントが既定)--bind <channel[:accountId]>(繰り返し指定可能)--all--json
agents delete <id>
オプション:
--force--json
注記:
mainは削除できません。--forceがない場合は、対話的な確認が必要です。- ワークスペース、エージェント状態、セッショントランスクリプトディレクトリは完全削除されず、ゴミ箱へ移動されます。
- Gateway に到達できる場合、削除は Gateway 経由で送信されるため、設定とセッションストアのクリーンアップはランタイムトラフィックと同じライターを共有します。Gateway に到達できない場合、CLI はオフラインのローカルパスにフォールバックします。
- 別のエージェントのワークスペースが同じパスである、このワークスペース内にある、またはこのワークスペースを含んでいる場合、
ワークスペースは保持され、
--jsonはworkspaceRetained、workspaceRetainedReason、workspaceSharedWithを報告します。
ID ファイル
各エージェントワークスペースには、ワークスペースルートに IDENTITY.md を含めることができます:
- 例のパス:
~/.openclaw/workspace/IDENTITY.md set-identity --from-identityはワークスペースルート(または明示的な--identity-file)から読み取ります
アバターパスはワークスペースルートからの相対パスとして解決されます。
ID を設定する
set-identity は agents.list[].identity にフィールドを書き込みます:
namethemeemojiavatar(ワークスペース相対パス、http(s) URL、またはデータ URI)
オプション:
--agent <id>--workspace <dir>--identity-file <path>--from-identity--name <name>--theme <theme>--emoji <emoji>--avatar <value>--json
注記:
--agentまたは--workspaceを使用して、対象エージェントを選択できます。--workspaceに依存していて複数のエージェントがそのワークスペースを共有している場合、コマンドは失敗し、--agentを渡すよう求めます。- ローカルのワークスペース相対アバター画像ファイルは 2 MB に制限されます。HTTP(S) URL と
data:URI は、ローカルファイルサイズ制限ではチェックされません。 - 明示的な ID フィールドが指定されていない場合、コマンドは
IDENTITY.mdから ID データを読み取ります。
IDENTITY.md から読み込みます:
openclaw agents set-identity --workspace ~/.openclaw/workspace --from-identityフィールドを明示的に上書きします:
openclaw agents set-identity --agent main --name "OpenClaw" --emoji "🦞" --avatar avatars/openclaw.png設定サンプル:
{ agents: { list: [ { id: "main", identity: { name: "OpenClaw", theme: "space lobster", emoji: "🦞", avatar: "avatars/openclaw.png", }, }, ], },}