Repository navigation
Document WP_CLI_AUTOCORRECT - #683
Merged
Merged
Conversation
WP-CLI 3.0.0 asks to run the closest match for a mistyped command, and WP_CLI_AUTOCORRECT controls whether it asks, runs it right away or stops with an error. Add it to the environment variable list.
Contributor
schlessera
approved these changes
Nov 27, 2026
schlessera
left a comment
Member
There was a problem hiding this comment.
Thanks for documenting WP_CLI_AUTOCORRECT so clearly and verifying all the modes against 3.0.0, @ekamran! LGTM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
WP_CLI_AUTOCORRECTto the environment variable list in the Config reference. It arrives in WP-CLI 3.0.0 with wp-cli/wp-cli#6122 and wp-cli/wp-cli#6460, where documenting it here was suggested.Changes
One entry, in alphabetical order:
Did you mean '<command>'? [y/n]when input and output are a terminal, otherwise stop with an error that includes the suggestion.confirmorprompt: always ask.auto,1,true,yesoron: run the suggested command without asking.none,0,false,nooroff: always stop with the error.Verification
Checked each value with
wp cluon wp-cli/wp-climainat 1b861da (with #6460 merged), without a terminal (STDIN from/dev/null) and in a real terminal:confirmandprompt: prompt in both.auto,1,true,yesandon: no prompt in either.none,0,false,noandoff: error in both.git diff --check.Use of AI
AI assistance: Yes
Tool(s): Claude Code and Codex
Used for: testing each value against wp-cli/wp-cli#6460, drafting the change, and reviewing it. I reviewed the reasoning and test results, and I take responsibility for the contribution.
Summary by CodeRabbit
WP_CLI_AUTOCORRECT, including its default behavior, supported settings for prompting or automatically running suggested commands, and options for disabling autocorrection.