Unknown-command suggestions are empty or misleading
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 697
- Forks
- 60
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 71
Description
Description
When openai is invoked with an unknown subcommand, the "Did you mean ..." hint that follows No help topic for 'X'. is either empty or points at a command that has nothing to do with the user's input. suggestCommand in pkg/cmd/suggest.go picks the highest jaro-winkler score with no minimum threshold, so any unknown string gets a suggestion even when nothing is close.
Repro
$ openai responses zzzzz
No help topic for 'zzzzz'. Did you mean ''?
$ openai totallybogus
No help topic for 'totallybogus'. Did you mean 'openai completions'?
Expected
For input that isn't close to any real command, the CLI should just print No help topic for 'X'. with no suggestion clause. Genuine typos like creat -> create should still be suggested.
Environment
- openai CLI v1.1.2
- macOS / darwin-arm64
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pkg/cmd/suggest.go, focusing on suggestCommand and how it handles the highest Jaro-Winkler score. Reproduce the empty and misleading suggestions with the commands in the issue, then verify that close typos such as creat still suggest create while unrelated input prints only the no-help-topic message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100