跳转到内容

cnb-rs info auth

cnb-rs info auth [--json]

精简认证摘要(5 行)。只回答 3 个最高频问题:我是谁、连到哪儿、用什么 token

完整的多账号 / token 过期 / ping 检查请用 cnb-rs auth status

输出

text
AUTH ────────────────────────────────────────────────────
Domain         cnb.cool
Endpoint       https://api.cnb.cool
Source         env CNB_TOKEN
Token          33qx…FgfG
Logged in as   illegal_name_cnb.by9cbmyhqda

  → 详细多账号状态 / token 过期 / ping 检查请运行 cnb-rs auth status

字段

key含义
Domain当前域名(CLI --domain 优先 → git remote → cnb.cool 默认)
EndpointAPI 实际 URL(https://api.{domain}
Sourceenv CNB_TOKENconfig / keyring
Token掩码:前 4 + + 后 4 字符;≤ 8 字符全掩
Logged in asclient.me() 返回的 username(拿不到时显示 -

选项

  • --json:输出结构化 JSON(含 token_masked 字段,永远不输出明文 token)

auth status 的区别

维度info authauth status
输出量5 行 + 1 行引导多账号每个一组,几十行
多账号只显示当前 active列所有 stored 账号
Token 过期不检查检查并标红
Ping 测试不发真实发请求验 token

示例

bash
# 1 屏摘要
cnb-rs info auth

# 完整状态(推荐排查问题时)
cnb-rs auth status

# JSON 模式(含 token_source / token_masked)
cnb-rs info auth --json

另请参阅

Released under the MIT License.