Appearance
openclaw qr
从当前 Gateway 配置生成 iOS 配对二维码和 Setup Code。
用法
bash
openclaw qr
openclaw qr --setup-code-only
openclaw qr --json
openclaw qr --remote
openclaw qr --url wss://gateway.example/ws选项
--remote:使用gateway.remote.url加上配置中的远程令牌/密码--url <url>:覆盖 payload 中使用的 Gateway URL--public-url <url>:覆盖 payload 中使用的公共 URL--token <token>:覆盖 bootstrap 流程鉴权使用的 Gateway 令牌--password <password>:覆盖 bootstrap 流程鉴权使用的 Gateway 密码--setup-code-only:仅打印 Setup Code--no-ascii:跳过 ASCII 二维码渲染--json:输出 JSON(包含setupCode、gatewayUrl、auth、urlSource)
说明
--token和--password互斥。- Setup Code 现在携带不透明的短期
bootstrapToken,而非共享的 Gateway 令牌/密码。 - 使用
--remote时,如果远程凭证配置为 SecretRef 且未传入--token或--password,命令会从活跃 Gateway 快照中解析凭证;若 Gateway 不可用,命令立即报错退出。 - 不使用
--remote时,当没有传入 CLI 认证覆盖参数时会解析本地 Gateway 的 auth SecretRef:- 当令牌认证能够生效时(显式设置
gateway.auth.mode="token"或推断模式下无密码来源获胜),gateway.auth.token会被解析。 - 当密码认证能够生效时(显式设置
gateway.auth.mode="password"或推断模式下无获胜令牌),gateway.auth.password会被解析。
- 当令牌认证能够生效时(显式设置
- 如果同时配置了
gateway.auth.token和gateway.auth.password(包括 SecretRef)且未设置gateway.auth.mode,Setup Code 解析将失败,直到显式设置 mode 为止。 - Gateway 版本差异说明:此命令路径需要支持
secrets.resolve的 Gateway;旧版 Gateway 会返回未知方法错误。 - 扫码后,使用以下命令审批设备配对:
openclaw devices listopenclaw devices approve <requestId>
Tips:
openclaw qr是连接 iOS 客户端最快的方式,扫一扫就能把你的小龙虾绑定到手机上,随时随地发号施令。