Summary
"Did you mean...?" suggestions exist for subcommand typos (Levenshtein-style) but not for flag names or enumerated argument values. --paht produces a bare "unknown option"; --lang pythno produces "unknown language" with no suggestion. Recovery friction is highest in MCP contexts where the client cannot interactively retry.
Evidence
src/CodeIndex/Cli/ProgramRunner.cs:193-195 — Levenshtein suggestion for command name only.
Impact
- More round trips for human users; for MCP, more failed tool calls.
- Discoverability of valid values (languages, kinds, formats) is hidden behind reading docs.
Proposed direction
- Extend the existing Levenshtein suggester to flag names and to the enumerated value sets (languages, kinds, output formats).
- In MCP error responses, include a
data.similar_values: [...] array so clients can offer the alternatives.
Repro env
- Branch:
main @ 2ee912d (release v1.21.0)
Summary
"Did you mean...?" suggestions exist for subcommand typos (Levenshtein-style) but not for flag names or enumerated argument values.
--pahtproduces a bare "unknown option";--lang pythnoproduces "unknown language" with no suggestion. Recovery friction is highest in MCP contexts where the client cannot interactively retry.Evidence
src/CodeIndex/Cli/ProgramRunner.cs:193-195— Levenshtein suggestion for command name only.Impact
Proposed direction
data.similar_values: [...]array so clients can offer the alternatives.Repro env
main@ 2ee912d (release v1.21.0)