Feature Request
When a user mistypes a command name, halp currently returns no useful output because all help flags fail against the non-existent binary. This is a common UX friction point — CLI tools with many subcommands (git, cargo, docker, npm) are especially prone to typos.
Proposed behavior
When halp <cmd> fails to find the command (all help/version checks return non-zero because the binary doesn't exist), halp could fall back to searching PATH for similarly named commands and suggest them:
$ halp gti
"gti" not found. Did you mean one of these?
git — the stupid content tracker
gtime — timed execution of commands
Implementation sketch
- After all help/version probes fail, collect the exit codes
- If the exit codes suggest the binary itself wasn't found (e.g.,
Command returned NotFound), walk PATH entries
- Compute Levenshtein or Jaro-Winkler distance between the requested command and each PATH entry
- Return the top 3-5 closest matches with their short descriptions (from
--version or whatis)
Prior art
git has git help -a and suggests similar commands on typos
apt suggests "did you mean" for misspelled package names
cargo suggests similar subcommands
- The
thefuck tool corrects previous console commands
Why this fits halp
Halp is already positioned as the "help with CLI tools" tool. Making it resilient to typos adds a concrete new capability — instead of just checking flags for known tools, it helps users discover the right tool name in the first place.
Feature Request
When a user mistypes a command name,
halpcurrently returns no useful output because all help flags fail against the non-existent binary. This is a common UX friction point — CLI tools with many subcommands (git, cargo, docker, npm) are especially prone to typos.Proposed behavior
When
halp <cmd>fails to find the command (all help/version checks return non-zero because the binary doesn't exist), halp could fall back to searching PATH for similarly named commands and suggest them:Implementation sketch
CommandreturnedNotFound), walk PATH entries--versionorwhatis)Prior art
githasgit help -aand suggests similar commands on typosaptsuggests "did you mean" for misspelled package namescargosuggests similar subcommandsthefucktool corrects previous console commandsWhy this fits halp
Halp is already positioned as the "help with CLI tools" tool. Making it resilient to typos adds a concrete new capability — instead of just checking flags for known tools, it helps users discover the right tool name in the first place.