elastic / elastic/cli

feat: suggest closest command on unknown subcommand

Open
#629 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
41
Forks
24
Avg merge
1d 3h
Merged PRs (30d)
56

Description

Unknown subcommands print `unknown command: foo` and stop (`src/factory-core.ts` `defineGroup`). On a generated tree (100+ KB namespaces, long ES names) that is the usual human and agent miss.

On unknown command, suggest the closest registered sibling (Levenshtein or commander's built-in). Cap at 3 suggestions. Same for unknown flags if cheap.

Acceptance: `elastic stack es indice` (missing s) suggests `indices`. Test the misspelling. No suggestion when distance is large.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.