openai / openai/openai-cli

Unknown-command suggestions are empty or misleading

Open Beginner friendly
#16 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.