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 二维码渲染 |
--json | JSON 输出(含 setupCode、gatewayUrl、auth、urlSource) |
安全说明
--token和--password互斥- setup code 携带的是短期
bootstrapToken,而非共享的 gateway token/password - 移动端配对对 Tailscale/公网
ws://URL 失败关闭(fail closed);私有 LAN 地址和.localBonjour 主机仍支持ws:// - 如果
gateway.auth.token和gateway.auth.password同时配置且gateway.auth.mode未设置,setup code 解析失败,需显式设置 mode
扫码后续操作
扫码后,通过以下命令审批设备配对:
openclaw devices list
openclaw devices approve <requestId>相关链接
- cli-pairing — 配对码审批
- cli-onboard — 完整 Gateway 初始化流程