Skip to content
Apothem
CLI 参考

profile

apothem profile 命令组的 CLI 参考。

管理共享的 Apothem 配置文件。

profile 是一个命令组,包含四个子命令:initshowsetedit。 共享配置文件是单一事实来源,每个harness适配器都将其物化为各自的原生配置。

概要

apothem profile init [--profile PATH] [--force]
                     [--quiet|-q] [--verbose|-v]
                     [--format plain|json] [--json] [--no-color]
apothem profile show [--profile PATH] [--quiet|-q] [--verbose|-v]
                     [--format plain|json] [--json] [--no-color]
apothem profile set KEY VALUE
                     [--profile PATH] [--quiet|-q] [--verbose|-v]
                     [--format plain|json] [--json] [--no-color]
apothem profile edit [--profile PATH] [--quiet|-q] [--verbose|-v]
                     [--format plain|json] [--json] [--no-color]

通用选项

每个子命令都接受下列共享选项。

选项描述
--profile PATH共享配置文件 YAML 的路径(默认为标准配置文件位置)。
--quiet, -q抑制信息性输出;仅发出错误。
--verbose, -v发出额外的诊断输出。
--format plain|json输出格式(默认:plain)。
--json--format json 的简写。
--no-color在输出中禁用 ANSI 颜色码。
-h, --help显示帮助并退出。

子命令

profile init

~/.config/apothem/profile.yaml--profile PATH 处创建一个符合模式的最小配置文件脚手架。除非提供 --force,否则会保留现有文件。

选项描述
--force覆盖现有的配置文件脚手架。

profile show

显示经过校验、默认值已展开的共享配置文件。

profile set KEY VALUE

在共享配置文件中设置一个键。KEY 是一个点分路径,会逐层下降到嵌套的配置文件中(identity.namepreferences.styleenforcement.sprintsharnesses.<harness>.preferences.style);不含点的单个键设置一个顶层节点。VALUE 作为字面字符串存储——裸词不会被强制转换(no 保持为 "no"2024-01-011.0 保持为字符串)——但 true/false(布尔型强制执行标志)以及显式的 [...]/{...} 列表/映射输入除外。在写入之前,完整组装的配置文件会针对模式进行校验;无效的设置会被拒绝,磁盘上的配置文件保持不变。

参数描述
KEY要设置的、进入配置文件的点分路径(必填)。
VALUE要赋的字面值;写入前会被校验(必填)。

profile edit

在系统编辑器中打开共享配置文件。

示例

apothem profile init
apothem profile init --profile ./profile.yaml --force --json
apothem profile show
apothem profile show --json
apothem profile set seriousness SHARED
apothem profile set rules '["Use fake placeholders in examples."]'
apothem profile edit

退出码

含义
0成功(或者,对于 edit,编辑器正常退出)
1配置文件缺失、无效、在没有 --force 时已存在,或无法写入

另请参阅

On this page