Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Auto-detection of Elasticsearch and Kibana version being used

クローズ
#766 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 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.version and kibana.version type changes from a semver string to string | { value: string, checked_ts: string } where value is the semver string (or serverless), and checked_ts is 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 version value set in its config file, it fetches the version first (GET / for Elasticsearch, GET /api/status for 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 status also sniffs and sets the same version information.
  • If checked_ts contains a date more than 30 days in the past, re-run the sniff and update the values.
  • A version set 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: boolean key (applies to all contexts) controls detection. Defaults to true. If set to false, always skip the sniff step even if a version value 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 --help or --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>.version node using yaml's parseDocument, preserving the user's comments and formatting. Do not round-trip through writeConfig/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時間
マージ済み PR(30日)
67

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

elastic/cli のほかの issue

elastic/cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。