openclaw qr
根据你当前的网关配置生成 iOS 配对二维码和设置码。
用法
选项
--remote:使用配置中的gateway.remote.url以及远程令牌/密码--url <url>:覆盖负载中使用的网关 URL--public-url <url>:覆盖负载中使用的公网 URL--token <token>:覆盖负载中使用的网关令牌--password <password>:覆盖负载中使用的网关密码--setup-code-only:仅打印设置码--no-ascii:跳过 ASCII 二维码渲染--json:输出 JSON(包含setupCode、gatewayUrl、auth、urlSource)
备注
--token和--password不能同时使用。- 使用
--remote时,如果配置中有效的远程凭据以 SecretRefs 形式存在,且没有传入--token或--password,命令会从活动的网关快照中解析它们。若网关不可用,则命令会快速失败。 - 不使用
--remote时,在没有 CLI 认证覆盖的情况下会解析本地网关的认证 SecretRefs:- 当令牌认证可用时(明确指定
gateway.auth.mode="token"或推断的模式中没有密码来源优先),解析gateway.auth.token。 - 当密码认证可用时(明确指定
gateway.auth.mode="password"或推断的模式中没有令牌优先),解析gateway.auth.password。
- 当令牌认证可用时(明确指定
- 如果同时配置了
gateway.auth.token和gateway.auth.password(包括 SecretRefs),且未设置gateway.auth.mode,则设置码解析失败,直到显式设置认证模式。 - 网关版本兼容性说明:该命令路径需要支持
secrets.resolve的网关;旧版本网关将返回未知方法错误。 - 扫码后,通过以下命令批准设备配对:
openclaw devices listopenclaw devices approve <requestId>