Auto-detection of Elasticsearch and Kibana version being used
维护者通常 1 天内回复
@JoshMock 已经在做这个了。
开始于 2026年10月13日。
评估
这个 Issue 还没有评估数据。
描述
Following the work done in #530, the CLI should be able to auto-detect what versions of Elasticsearch and Kibana it is targeting, so that the commands and flags exposed align with what features are available in that version.
Requirements
elasticsearch.versionandkibana.versiontype changes from a semverstringtostring | { value: string, checked_ts: string }wherevalueis the semver string (orserverless), andchecked_tsis an ISO 8601 datetime string describing when that version was last checked.- The first time a CLI command is issued targeting an Elasticsearch or Kibana instance that has no
versionvalue set in its config file, it fetches the version first (GET /for Elasticsearch,GET /api/statusfor Kibana), setting it in the config using the{ value, checked_ts }form. Once the sniff is complete, the original command runs as normal, with commands filtered for the detected version. - Running
elastic statusalso sniffs and sets the sameversioninformation. - If
checked_tscontains a date more than 30 days in the past, re-run the sniff and update the values. - A
versionset as a plain string is treated as user-pinned: it is never sniffed, refreshed, or overwritten. Only the{ value, checked_ts }form expires. - An optional top-level
detect_version: booleankey (applies to all contexts) controls detection. Defaults totrue. If set tofalse, always skip the sniff step even if aversionvalue is not set. - If the config file is not writable, the sniff step should be skipped.
Implementation details
- Timing: the sniff runs during early config loading, before command registration, so availability filtering uses the detected version on the same invocation.
- Skipped modes: never sniff on
--helpor--dry-run. - Credentials: secrets (including
$(cmd:...)expressions) are resolved early only when a sniff is actually due. Invocations that do not need a sniff keep the current behavior from #706 (no early secret resolution). - Writing the config: update only the
contexts.<name>.<service>.versionnode usingyaml'sparseDocument, preserving the user's comments and formatting. Do not round-trip throughwriteConfig/serializeConfig, which drops comments. - Sniff failure (network error, 401, 404, unparseable response): fail open. Print a one-line warning to stderr (suppressed with
--json), continue without a version (all commands available), and write nothing. The next invocation retries. - HTTP: sniff requests set
redirect: 'error', like the other credentialed requests.
authored by Pi Coding Agent (Claude Opus 5.5)
- 主要语言
- TypeScript
- 星标
- 49
- 派生
- 27
- 平均合并
- 1 天 23 小时
- 30 天内合并 PR
- 67
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
elastic/cli 的其他 Issue
-
feat: ship skills/elastic/SKILL.md for agent invocation可能已有人在做 @onatozmenn 于 18 天前认领。 未关闭enhancement
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 38/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 58/100
维护者通常 1 天内回复
-
难度 3/5 半天 新手友好度 62/100
维护者通常 1 天内回复
相似的 Issue
-
documentation good first issue
难度 2/5 半天 新手友好度 72/100
sujithputta02/Esapay#13 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
ehmpathy/rhachet-roles-bhuild#468 ·
维护者通常 1 天内回复
-
Share dialog: the address book's contact count reads "1 contacts" (no singular form in any language)可能已有人在做 @chibenwa 今天认领。 未关闭ai-driven-qa bug claude Cosmetic
难度 2/5 1-3 小时 新手友好度 72/100
linagora/twake-contacts-frontend#271 · 1 条评论 ·
维护者通常 1 天内回复
-
factory-active task-identify-harness-labels-done task-identify-issue-type-done
难度 1/5 1 小时以内 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
Koenkk/zigbee2mqtt#33402 ·
维护者通常 1 天内回复