[Feature Request] Show active context and target deployment in interactive command output
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, typescript
- Ambito
- cli, developer-experience
Direzione di ricerca
Start by locating the interactive command output and context selection paths, especially where --use-context is applied and where --json output is written. Check the existing CLI configuration and tests for output flags. Done means the selected context and target can be shown optionally while stdout, JSON, exit codes, and non-interactive behavior remain compatible; the issue does not identify specific files or tests.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
When managing multiple Elasticsearch and Kibana deployments using Elastic CLI, it is not immediately obvious which deployment a command is targeting.
In our environment, engineers manage multiple customer deployments across several Elastic Cloud Enterprise (ECE) installations and self-managed Elastic Stack clusters.
Each deployment can have multiple contexts with different privilege levels, such as read-only and write-capable API keys.
This makes context awareness particularly important for operational safety.
Currently, the user must explicitly check the active context using elastic config current-context get or elastic status.
Proposed solution
Provide an optional context header for interactive command execution.
For example:
Elastic CLI
Context: ece-eu01-customer-a-pr-01-ro
Target: customer-a-pr-01
Endpoint: https://es.example.com:9243
Access: ro
[
{
"id": "dashboard-123",
"title": "Infrastructure Overview"
}
]
The header should show:
- Effective context name.
- Target Elasticsearch, Kibana or Cloud endpoint.
- Optional human-readable deployment name or alias.
- Configured permission profile, if explicitly available.
The context should reflect the context actually selected for the command, including --use-context, rather than simply displaying the default context.
Output compatibility
Preserving machine-readable output is essential.
Suggested behavior:
- Disabled by default in non-interactive sessions.
- Enabled optionally through a configuration setting or
--show-contextflag. - Display the header on stderr, leaving stdout unchanged.
- Preserve valid JSON output when using
--jsonor piping tojq. - Preserve existing exit codes and command behavior.
- Support
--no-context-headerto suppress the header explicitly.
An alternative would be an interactive-only startup banner controlled by the existing CLI configuration.
Example configuration
output:
context_header: interactive
Possible values:
neverinteractivealways
The configuration syntax is only illustrative.
Additional considerations
The CLI should not infer actual privileges solely from context names like ro and rw. These names are conventions, not authorization guarantees.
An optional display label could be useful for long context names.
The feature should not require additional API requests just to print the header.
Environment
- Elastic CLI v0.7.0
- Rocky Linux 9.8
- Node.js 24
- Multiple Elastic Stack 9.x deployments
- ECE and self-managed clusters
- Named contexts using separate RO/RW API keys
Motivation
This would improve usability and reduce the risk of executing commands against an unintended customer or environment, without requiring shell wrappers or custom Bash prompt modifications.
- Lingua principale
- TypeScript
- Stelle
- 53
- Fork
- 28
- Merge medio
- 23h 41m
- PR unite (30g)
- 44
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di elastic/cli
-
tracking
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
feat: ship skills/elastic/SKILL.md for agent invocationForse già presa @onatozmenn l’ha presa 31 giorni fa. Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
elastic/cli#628 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
elastic/cli#617 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 63/100
I maintainer di solito rispondono entro 1 giorno
-
`es search --input-file` drops top-level `aggs` (and any unrecognised key) without an errorForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Shell: serve the home app's Cookie Policy on a hard reloadForse già presa @2001anshkaushik l’ha presa oggi. Apertafeature module:ai
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
rocketride-org/rocketride-server#2899 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
wazuh/wazuh-dashboard-plugins#9551 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
gofish-graphics/gofish-graphics#1252 ·
I maintainer di solito rispondono entro 1 giorno
-
optimization P3 size:XS
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
josephfung/curia#2366 ·
I maintainer di solito rispondono entro 1 giorno
-
stranded-follow-up sweep trusts any issue whose body carries the marker as the tracking issueApertatype:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
nightgauge/nightgauge#2688 ·
I maintainer di solito rispondono entro 1 giorno