Summary
Add a --latest flag to ecctl stack list that returns only the latest stable stack version for a given region, instead of the full list of all available versions.
Motivation
When creating deployments programmatically, a common need is to resolve the latest available stack version to pass to ecctl deployment create --version. Currently this requires fetching the entire stack list (279+ entries) and parsing the output to extract the first item:
ecctl stack list --region gcp-us-central1 --output json | \
python3 -c "import sys,json; print(json.load(sys.stdin)['stacks'][0]['version'])"
A dedicated flag would simplify this to:
ecctl stack list --region gcp-us-central1 --latest
Proposed behavior
ecctl stack list --latest returns only the latest stable (non-deleted, non-snapshot) stack version.
- Works with
--region to scope to a specific region.
- Works with
--output json to return a structured response (e.g. {"version": "9.3.1"}).
- Text output simply prints the version string (e.g.
9.3.1).
Use case
This came up while building agent skills for automating Elastic Cloud deployment creation. The ecctl deployment create command can fail with "failed to parse version: Version string empty" if no --version is provided and the version can't be inferred, making it important to resolve the latest version explicitly.
Summary
Add a
--latestflag toecctl stack listthat returns only the latest stable stack version for a given region, instead of the full list of all available versions.Motivation
When creating deployments programmatically, a common need is to resolve the latest available stack version to pass to
ecctl deployment create --version. Currently this requires fetching the entire stack list (279+ entries) and parsing the output to extract the first item:A dedicated flag would simplify this to:
Proposed behavior
ecctl stack list --latestreturns only the latest stable (non-deleted, non-snapshot) stack version.--regionto scope to a specific region.--output jsonto return a structured response (e.g.{"version": "9.3.1"}).9.3.1).Use case
This came up while building agent skills for automating Elastic Cloud deployment creation. The
ecctl deployment createcommand can fail with"failed to parse version: Version string empty"if no--versionis provided and the version can't be inferred, making it important to resolve the latest version explicitly.