devices
openclaw devices
Section titled “openclaw devices”管理裝置配對請求和裝置範圍的權杖。
openclaw devices list
Section titled “openclaw devices list”列出待處理的配對請求和已配對的裝置。
openclaw devices listopenclaw devices list --json待處理請求的輸出包含請求的角色和範圍,以便在您核准之前檢視核准內容。
openclaw devices remove <deviceId>
Section titled “openclaw devices remove <deviceId>”移除一個已配對的裝置項目。
openclaw devices remove <deviceId>openclaw devices remove <deviceId> --jsonopenclaw devices clear --yes [--pending]
Section titled “openclaw devices clear --yes [--pending]”批次清除已配對的裝置。
openclaw devices clear --yesopenclaw devices clear --yes --pendingopenclaw devices clear --yes --pending --jsonopenclaw devices approve [requestId] [--latest]
Section titled “openclaw devices approve [requestId] [--latest]”核准待處理的裝置配對請求。如果省略了 requestId,OpenClaw
會自動核准最近一筆待處理的請求。
注意:如果裝置使用變更的驗證詳細資料 (角色/範圍/公開金鑰)
重試配對,OpenClaw 會取代先前的待處理項目並發出新的
requestId。請在核准前立即執行 openclaw devices list 以使用目前的 ID。
openclaw devices approveopenclaw devices approve <requestId>openclaw devices approve --latestopenclaw devices reject <requestId>
Section titled “openclaw devices reject <requestId>”拒絕待處理的裝置配對請求。
openclaw devices reject <requestId>openclaw devices rotate --device <id> --role <role> [--scope <scope...>]
Section titled “openclaw devices rotate --device <id> --role <role> [--scope <scope...>]”輪替特定角色的裝置權杖 (可選擇更新範圍)。
openclaw devices rotate --device <deviceId> --role operator --scope operator.read --scope operator.writeopenclaw devices revoke --device <id> --role <role>
Section titled “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),列表/批准可以使用本地配對後備方案。
令牌漂移恢復檢查清單
Section titled “令牌漂移恢復檢查清單”當控制 UI 或其他客戶端持續因 AUTH_TOKEN_MISMATCH 或 AUTH_DEVICE_TOKEN_MISMATCH 而失敗時,請使用此方法。
- 確認目前的閘道令牌來源:
openclaw config get gateway.auth.token- 列出已配對的裝置並找出受影響的裝置 ID:
openclaw devices list- 旋轉受影響裝置的操作員令牌:
openclaw devices rotate --device <deviceId> --role operator- 如果旋轉還不夠,請移除過時的配對並再次批准:
openclaw devices remove <deviceId>openclaw devices listopenclaw devices approve <requestId>- 使用目前的共用令牌/密碼重試客戶端連線。
相關內容: