cli: add help for incorrectly spelled commands
What is the problem this feature would solve?
When a user incorrectly type a cli argument it would be ideal if the cli helped the user find the right command instead of erroring. Git and many other cli tools tell the user what command they might be thinking of and some prompt the user to run the suggested command instead. For example, if you run git comit` git will reply with
git: 'comit' is not a git command. See 'git --help'.
The most similar command is
commit
At the moment the effect cli just errors.
Compare:
to:
What is the feature you are proposing to solve the problem?
I think we should handle this case better. When effect cli detects that the user incorrectly typed either a command or an argument it should suggest the closest command name (if one is close enough) and ask the user if they want to run that instead using a yes/no prompt.
This should be done automatically by the effect cli framework without the cli implementer having to change anything.
https://www.npmjs.com/package/didyoumean2
What alternatives have you considered?
Implementing this manually for every cli is possible but is not fun..