本頁為機器翻譯。閱讀英文原文。
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-serve.md — 用戶端為了相容性而檢查其版本的常駐程式。
概要
aggrega version [flags]說明
Print the aggrega CLI's build identity.
By default the output is a single human-readable line followed by aone-line pointer to the plugins compiled into the binary. With-o json, the output is a structured JSON object suitable forprogrammatic consumption (the VS Code extension uses this form toread the binary's version at activation time), in the same indentedshape every aggrega command's JSON output uses.
With --verbose, the output replaces the pointer line with a table ofthe 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 arraycarrying the same detail.
With --licenses, the output is the third-party notices of everythingcompiled into the binary: the host and each embedded plugin, everydependency with its version, license and copyright lines, then eachlicense text once. It is printed as plain text, so --licenses cannot becombined with -o json or --verbose.
Version strings are v-less (1.0.0, not v1.0.0), homogeneous with theversion form catalog entities use. Tagged release builds report therelease 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.旗標
| 旗標 | 預設 | 說明 |
|---|---|---|
--licenses | false | 印出編譯進二進位檔的所有內容的第三方聲明 |
--output, -o | text | 輸出格式:text|json。 |
--verbose | false | 在輸出中包含內嵌的外掛程式集合 |