Context
Typos are the #1 source of friction with any CLI. When a user runs w3-kit chian list (instead of chain), or asks for arbtrum (instead of arbitrum), the current error is a flat "not found" — leaving the user to figure out what they typed wrong. A small Levenshtein-based suggestion turns dead ends into wins.
What to build
When the CLI hits an unknown command, subcommand, or chain/token name, compute the closest match (Levenshtein distance ≤ 2) from the set of valid options and append a "Did you mean <suggestion>?" line to the error.
Apply this to at least:
- Unknown top-level commands
- Unknown chain names (in
chains show <chain> and similar future commands)
- Unknown flag names
Acceptance criteria
Pointers
- Reference:
fastest-levenshtein npm package for the distance calc
- Pairs well with the
chains commands issue
Complexity
🟢 Good first issue
Context
Typos are the #1 source of friction with any CLI. When a user runs
w3-kit chian list(instead ofchain), or asks forarbtrum(instead ofarbitrum), the current error is a flat "not found" — leaving the user to figure out what they typed wrong. A small Levenshtein-based suggestion turns dead ends into wins.What to build
When the CLI hits an unknown command, subcommand, or chain/token name, compute the closest match (Levenshtein distance ≤ 2) from the set of valid options and append a "Did you mean
<suggestion>?" line to the error.Apply this to at least:
chains show <chain>and similar future commands)Acceptance criteria
Pointers
fastest-levenshteinnpm package for the distance calcchainscommands issueComplexity
🟢 Good first issue