openclaw qr

从当前 Gateway 配置生成移动端配对二维码和 setup code。

基本用法

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

选项

选项说明
--remote优先使用 gateway.remote.url;未设置时可用 Tailscale serve/funnel 提供的公网 URL
--url <url>覆盖 payload 中使用的 Gateway URL
--public-url <url>覆盖 payload 中使用的公网 URL
--token <token>覆盖 bootstrap 流程使用的 gateway token
--password <password>覆盖 bootstrap 流程使用的 gateway 密码
--setup-code-only仅打印 setup code
--no-ascii跳过 ASCII 二维码渲染
--jsonJSON 输出(含 setupCode、gatewayUrl、auth、urlSource)

安全说明

  • --token 和 --password 互斥
  • setup code 携带的是短期 bootstrapToken,而非共享的 gateway token/password
  • 移动端配对对 Tailscale/公网 ws:// URL 失败关闭(fail closed);私有 LAN 地址和 .local Bonjour 主机仍支持 ws://
  • 如果 gateway.auth.token 和 gateway.auth.password 同时配置且 gateway.auth.mode 未设置,setup code 解析失败,需显式设置 mode

扫码后续操作

扫码后,通过以下命令审批设备配对:

openclaw devices list
openclaw devices approve <requestId>

相关链接