跳转到内容
AggregaAggrega
选择语言: 简体中文
本页面由机器翻译。阅读英文原文。

aggrega version

aggrega version 打印 aggrega CLI 的版本。

输出

默认情况下,aggrega version 打印一行人类可读的版本信息。

使用 -o json 时,它输出一个机器可读的对象,缩进两个空格,其结构与每个 aggrega 命令的 JSON 输出所用的结构相同。请使用 JSON 解析器读取它;如果使用方改为对 文本进行匹配,应在匹配前去除空白字符,因为字段名才是约定的契约, 而周围的排版不是。

{
"version": "1.2.3",
"committed": "2026-07-09T18:07:57Z",
"commit": "a1b2c3d",
"abiVersion": "v1beta1",
"goVersion": "go1.23.0",
"platform": "linux/amd64"
}

这些字段来自二进制文件中嵌入的构建元数据。committed 是提交时间戳, 仅当构建记录了它时才会出现。abiVersion 是该二进制文件所使用的插件 ABI 版本, 流水线可以读取它来检查插件兼容性,而无需加载插件。 未嵌入版本的开发构建会报告一个哨兵值(例如 (devel)), 而不是失败。

何时使用 -o json

  • 编辑器扩展将守护进程报告的版本与其构建时所针对的版本进行比较,以便在驱动 aggrega serve 二进制文件之前检测出不兼容的版本。
  • CI 和溯源工具会记录生成某个制品的确切编译器构建。

另请参阅

概要

aggrega version [flags]

说明

Print the aggrega CLI's build identity.
By default the output is a single human-readable line followed by a
one-line pointer to the plugins compiled into the binary. With
-o json, the output is a structured JSON object suitable for
programmatic consumption (the VS Code extension uses this form to
read the binary's version at activation time), in the same indented
shape every aggrega command's JSON output uses.
With --verbose, the output replaces the pointer line with a table of
the embedded plugins — type, name, served capabilities, and commit —
under a header naming the count and their shared version. With
--verbose -o json, the JSON object gains an embeddedPlugins array
carrying the same detail.
Version strings are v-less (1.0.0, not v1.0.0), homogeneous with the
version form catalog entities use. Tagged release builds report the
release version, a build stamped with a version reports that version,
and a build carrying no version stamp reports the literal "(devel)",
which marks an unreleased build.

标志

标志默认值描述
--output, -otext输出格式:text|json。
--verbosefalse在输出中包含嵌入的插件集