[Feature Request] Show active context and target deployment in interactive command output
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, typescript
- Área
- cli, developer-experience
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 53
- Forks
- 28
- Merge medio
- 4 d 12 h
- PR fusionados (30 d)
- 61
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de elastic/cli
-
Extension --help prints root help instead of running the extensionPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertotracking
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
feat: ship skills/elastic/SKILL.md for agent invocationPosiblemente ocupada @onatozmenn la tomó hace 33 días. Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
elastic/cli#628 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
elastic/cli#617 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
tracking
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 63/100
Los mantenedores suelen responder en 1 día
Todos los issues de elastic/cli
Issues similares
-
Replace discontinued crypto-js in the themePosiblemente ocupada @aelmanaa la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
PaloAltoNetworks/docusaurus-openapi-docs#1689 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
solana-foundation/solana-web3.js#4015 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
formatSearchQuery drops the :present modifier, so `email:present=true` is sent as `email=true`Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 1/5 1-3 horas Aptitud para principiantes 90/100
ivopogace/opencode-courier#422 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
chapel-lang/chapel-vscode#158 ·
Los mantenedores suelen responder en 1 día