openclaw devices

デバイスペアリングリクエストとデバイススコープのトークンを管理します。

コマンド

openclaw devices list

保留中のペアリングリクエストとペアリング済みデバイスを一覧表示します。

openclaw devices list
openclaw devices list --json

openclaw devices remove <deviceId>

ペアリング済みデバイスエントリを1つ削除します。

openclaw devices remove <deviceId>
openclaw devices remove <deviceId> --json

openclaw devices clear --yes [--pending]

ペアリング済みデバイスを一括クリアします。

openclaw devices clear --yes
openclaw devices clear --yes --pending
openclaw devices clear --yes --pending --json

openclaw devices approve [requestId] [--latest]

保留中のデバイスペアリングリクエストを承認します。requestIdを省略すると、OpenClawは最新の保留中リクエストを自動的に承認します。

openclaw devices approve
openclaw devices approve <requestId>
openclaw devices approve --latest

openclaw devices reject <requestId>

保留中のデバイスペアリングリクエストを拒否します。

openclaw devices reject <requestId>

openclaw devices rotate --device <id> --role <role> [--scope <scope...>]

特定のロールのデバイストークンをローテーションします(オプションでスコープも更新)。

openclaw devices rotate --device <deviceId> --role operator --scope operator.read --scope operator.write

openclaw devices revoke --device <id> --role <role>

特定のロールのデバイストークンを失効させます。

openclaw devices revoke --device <deviceId> --role node

共通オプション

  • --url <url>: Gateway WebSocket URL(設定時はgateway.remote.urlがデフォルト)。
  • --token <token>: Gatewayトークン(必要な場合)。
  • --password <password>: Gatewayパスワード(パスワード認証)。
  • --timeout <ms>: RPCタイムアウト。
  • --json: JSON出力(スクリプティング向け推奨)。

補足:--urlを設定すると、CLIは設定や環境の認証情報にフォールバックしません。 --tokenまたは--passwordを明示的に渡してください。明示的な認証情報がない場合はエラーになります。

補足

  • トークンローテーションは新しいトークン(機密情報)を返します。シークレットとして扱ってください。
  • これらのコマンドにはoperator.pairing(またはoperator.admin)スコープが必要です。
  • devices clear--yesで意図的にゲートされています。
  • ローカルループバックでペアリングスコープが利用できない場合(明示的な--urlが渡されていない場合)、list/approveはローカルペアリングフォールバックを使用できます。

トークンドリフト回復チェックリスト

Control UIや他のクライアントがAUTH_TOKEN_MISMATCHAUTH_DEVICE_TOKEN_MISMATCHで失敗し続ける場合に使用します。

  1. 現在のGatewayトークンソースを確認:
openclaw config get gateway.auth.token
  1. ペアリング済みデバイスを一覧表示し、該当するデバイスIDを特定:
openclaw devices list
  1. 該当デバイスのoperatorトークンをローテーション:
openclaw devices rotate --device <deviceId> --role operator
  1. ローテーションだけでは不十分な場合、古いペアリングを削除して再承認:
openclaw devices remove <deviceId>
openclaw devices list
openclaw devices approve <requestId>
  1. 現在の共有トークン/パスワードでクライアント接続を再試行。

関連: