zarf
zarf copied to clipboard
Investigate implementing Cobra Suggestions
Is your feature request related to a problem? Please describe.
Currently we display help and an error when a Zarf command or flag is inputted incorrectly. This is somewhat helpful but doesn't always guide the user toward what they want to do.
Describe the solution you'd like
We should investigate Cobra suggestions to help with the UX around mistyped commands (and flags) if possible. https://cobra.dev/#suggestions-when-unknown-command-happens
Describe alternatives you've considered
We could manually write our own distance functions and checks but this would not be ideal.
Additional context
This would help with the UX of the CLI for deploy users who may not be familiar with Zarf or command lines.
@Noxsios [2 minutes ago] Making sure each command has a help message + examples is also useful
Getting cobra to do this for us relies upon us not using cmd.Run + message.Fatal
in our commands. I lean more towards this anyways as that is a more true CLI experience + it stops os.Exit
s when zarf's CMD
is embedded.