openclaw qr

根據目前的 Gateway 設定,產生 iOS 配對 QR 碼與設定碼。

用法

openclaw qr
openclaw qr --setup-code-only
openclaw qr --json
openclaw qr --remote
openclaw qr --url wss://gateway.example/ws

選項

  • --remote:使用 gateway.remote.url 加上設定中的遠端 token/password
  • --url <url>:覆寫酬載中使用的 Gateway URL
  • --public-url <url>:覆寫酬載中使用的公開 URL
  • --token <token>:覆寫啟動引導流程驗證所用的 Gateway 權杖
  • --password <password>:覆寫啟動引導流程驗證所用的 Gateway 密碼
  • --setup-code-only:僅輸出設定碼
  • --no-ascii:跳過 ASCII QR 碼渲染
  • --json:輸出 JSON(setupCodegatewayUrlauthurlSource

注意事項

  • --token--password 互斥。
  • 設定碼本身現在攜帶不透明的短期 bootstrapToken,而非共用的 Gateway token/password。
  • 使用 --remote 時,若有效啟用的遠端憑證設定為 SecretRef 且你未傳入 --token--password,指令會從目前的 Gateway 快照解析。Gateway 無法連線時,指令會立即失敗。
  • 未使用 --remote 時,若未傳入 CLI 驗證覆寫,本機 Gateway 驗證 SecretRef 會被解析:
    • gateway.auth.token 在 token 驗證可能勝出時解析(明確的 gateway.auth.mode="token" 或推斷模式中沒有 password 來源勝出)。
    • gateway.auth.password 在 password 驗證可能勝出時解析(明確的 gateway.auth.mode="password" 或推斷模式中沒有來自 auth/env 的 token 勝出)。
  • 若同時設定了 gateway.auth.tokengateway.auth.password(包含 SecretRef)但未設定 gateway.auth.mode,設定碼解析會失敗,直到明確設定 mode。
  • Gateway 版本相容性提醒:此指令路徑需要支援 secrets.resolve 的 Gateway;舊版 Gateway 會回傳 unknown-method 錯誤。
  • 掃描後,使用以下指令核准裝置配對:
    • openclaw devices list
    • openclaw devices approve <requestId>