Skip to content

Add 'Did you mean' suggestion for misspelled commands#3229

Closed
thakoreh wants to merge 1 commit intopallets:mainfrom
thakoreh:add-did-you-mean-for-commands
Closed

Add 'Did you mean' suggestion for misspelled commands#3229
thakoreh wants to merge 1 commit intopallets:mainfrom
thakoreh:add-did-you-mean-for-commands

Conversation

@thakoreh
Copy link

Summary

Fixes #3107 - Adds "Did you mean" suggestion for misspelled commands.

Problem

When a user misspells a command, they get an unhelpful error:

When they misspell an option, they get a helpful suggestion:

Solution

Use to suggest similar command names, just like options are handled.

Now when a user misspells a command:

Changes

  • Modified in to suggest similar commands when a command is not found
  • Uses the same pattern as option suggestions in

Test Plan

Tested with the example from the issue:

Running now shows:

When a user misspells a command, show similar command names using
difflib.get_close_matches, similar to how misspelled options are
handled.

Fixes: pallets#3107
@davidism davidism closed this Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suggest "Did you mean" for misspelled commands

2 participants