You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(cli): add shell completion support (bash, zsh, fish) #315
elastic <TAB> produces no completions today. With 500+ ES subcommands across multiple namespaces, shell completion is essential for discoverability and day-to-day usability before public launch.
Proposed UX
Following the gh / kubectl convention -- a completion subcommand that prints a sourcing script to stdout:
Commander v14 ships generateCompletion() which emits a completion script for the registered command tree. This should cover the top-level commands automatically.
The main challenge is the lazy-loaded command trees (stack es, stack kb, etc.) -- completions for those namespaces will only be accurate if the full command tree is registered before generateCompletion() is called. The completion command should force-load all lazy subtrees before generating.
The extension subtree is dynamic (installed extensions vary per user) -- completion for extension names can be generated by reading ~/.elastic/extensions.json at completion time.
Acceptance criteria
elastic completion zsh prints a valid zsh completion script
elastic completion bash prints a valid bash completion script
elastic completion fish prints a valid fish completion script
Top-level commands (stack, cloud, config, extension, docs, sanitize) all complete
ES/KB namespace commands complete (e.g. elastic es ind<TAB> -> indices)
Installed extension names complete as top-level commands
Activity