跳转到内容

cnb-rs info config

cnb-rs info config [--json]

CLI 自身配置(运行时生效值)。回答「为什么 cnb-rs 用了这个 endpoint / 这个 repo」。

输出分区

CLI

  • Versioncnb-rs --version 同源(编译时注入)
  • Domain — 优先级:CLI --domain → git remote → 默认 cnb.cool
  • Active Repo — 当前生效的 {owner/group}/{repo}--repo flag 或 git remote 解析)

GIT

  • Remote URL — 从 GitInfo 重组的远程 URL
  • Parsed Repo — 从 remote URL 解析出的 repo 路径
  • Current Branch — 本地 git HEAD 所在分支(非 git 仓库时显示 -

CONFIG FILE

  • Path~/.cnb/config.toml 绝对路径
  • Loaded — 文件存在且解析成功为 yes(绿),否则 no(灰)

config list 的区别

维度info configconfig list
范围仅运行时生效的关键值(最常诊断的 7 项)配置文件全部 KV + 默认值
风格3 分区卡片 + 状态颜色KV 完整列表
适用「我现在用的是哪个 endpoint / repo / token」一屏排查完整审计 / 文档化配置

选项

  • --json:JSON 输出(含 config_loaded 布尔值)

示例

bash
# 默认输出
cnb-rs info config

# 排查仓库解析问题
cnb-rs info config | grep -E "Domain|Repo|Remote"

# JSON 模式
cnb-rs info config --json | jq '{version, domain, repo, config_loaded}'

另请参阅

Released under the MIT License.