Skip to content

Did-you-mean suggestions limited to subcommands; absent for flags and values #1582

Description

@Widthdom

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions