Skip to content

feat(extension): dispatch unknown top-level commands to installed extensions #297

@margaretjgu

Description

@margaretjgu

Part of #222.

When elastic <name> is called and <name> is not a built-in command, look up elastic-<name> in the extension registry and exec it, forwarding all remaining argv and the context env vars.

  • Module at src/extension/runner.ts with a runExtension(ext, args, env) export
  • In cli.ts, before program.parseAsync, check firstArg against the set of known built-ins; if unknown, attempt extension dispatch
  • Exit with the extension process exit code
  • If no matching extension found, let Commander handle the unknown command error normally

Depends on: #293, #294, #296

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions