refactor(stack): rename top-level es to stack es#201
Merged
Conversation
Promote `stack` to a top-level command with `es` as its first sub-group, so `elastic es …` becomes `elastic stack es …`. Future `stack kibana` and `stack fleet` groups are reserved but not yet implemented. The `es` sub-tree itself is unchanged: codegen output (src/es/apis/**/*.ts, src/es/apis.ts) is untouched and registerEsCommands() still returns a group named `es`. The re-parenting happens at registration time in src/cli.ts by wrapping it in a `stack` group. Clean break, no aliases. Project is 0.1.0-alpha.1. - src/cli.ts: lazily loads `stack` branch, wrapping `registerEsCommands()`. Dropped the top-level `es` branch. Updated program description. - src/es/register.ts, src/es/types.ts: doc comments updated to show `elastic stack es …` in examples. - README.md: `### es` section renamed to `### stack`, examples updated. - package.json: `description` updated to match the new top-level tagline. - test/cli.test.ts: updated the two `['es', 'info']` invocations to `['stack', 'es', 'info']`; added `stack` command-tree smoke tests covering top-level help, `stack --help`, and `stack es --help`.
Contributor
✅MegaLinter analysis: Success
See detailed reports in MegaLinter artifacts MegaLinter is graciously provided by OX Security |
JoshMock
approved these changes
Apr 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes part of #193. Sibling to #199.
Summary
Renames the top-level
elastic escommand toelastic stack, with the existing Elasticsearch tree nested underneath aselastic stack es …. This aligns the CLI with how the product is organized around the Elastic Stack (Elasticsearch, Kibana, Fleet) and leaves a clean scaffold for futurestack kibanaandstack fleetgroups.New tree
The
essub-tree itself is unchanged. Codegen output (src/es/apis/**/*.ts,src/es/apis.ts) is untouched.registerEsCommands()still returns a group namedes— the re-parenting happens at registration time insrc/cli.tsby wrapping it in astackgroup. Addingstack kibana/stack fleetlater is a one-liner next to the existingregisterEsCommands()call.Design notes
0.1.0-alpha.1, so I'm not keepingelastic es …around.stack kibanaandstack fleetas future groups; those APIs don't exist yet, so I only added the top-levelstackcontainer and didn't prematurely wire up empty sub-groups.src/es/andregisterEsCommandsstay as-is. The content is still ES-specific, and renaming is churn without payoff — the directory name is an implementation detail of a module that composes into the larger tree.Migration
elastic es search --index my-indexelastic stack es search --index my-indexelastic es indices create --index fooelastic stack es indices create --index fooelastic es cat healthelastic stack es cat healthelastic es helpers scroll-search …elastic stack es helpers scroll-search …Out of scope
elastic stack kibana …andelastic stack fleet …— not implemented; the top-level scaffold is in place so these can be added as one-liners when their APIs land.cloudnamespace #199.Files changed
src/cli.ts— replaced the lazy-load branch foreswith one forstack; wrapsregisterEsCommands()in astackgroup. Updated the top-level program description.src/es/register.ts,src/es/types.ts— doc comments updated to showelastic stack es …in examples.README.md—### essection renamed to### stack, examples updated.package.json—descriptionupdated to match the new top-level tagline.test/cli.test.ts— updated the two['es', 'info']preAction-error invocations to['stack', 'es', 'info']; added three new smoke tests covering top-level help,elastic stack --help, andelastic stack es --help.Test plan
npx tsc --noEmitclean.npm run test:unit— 862/862 passing (includes 3 new stack command-tree smoke tests).npm run test:lintclean.node dist/cli.js --helpshowsstackand no longer showsesat the top level.node dist/cli.js stack --helplistsesas the only sub-group.node dist/cli.js stack es --helpshows the full namespace tree (indices,cluster,ml,cat, …) and top-level leaves (search,bulk,reindex, …).node dist/cli.js stack es search --helpshows a real leaf command with all its flags.