Skip to content

Document WP_CLI_AUTOCORRECT - #683

Merged
schlessera merged 1 commit into
wp-cli:mainfrom
ekamran:shifteq/document-autocorrect
Nov 27, 2026
Merged

schlessera merged 1 commit into
wp-cli:mainfrom
ekamran:shifteq/document-autocorrect

Conversation

@ekamran

@ekamran ekamran commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds WP_CLI_AUTOCORRECT to 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:

  • Default: ask Did you mean '<command>'? [y/n] when input and output are a terminal, otherwise stop with an error that includes the suggestion.
  • confirm or prompt: always ask.
  • auto, 1, true, yes or on: run the suggested command without asking.
  • none, 0, false, no or off: always stop with the error.

Verification

Checked each value with wp clu on wp-cli/wp-cli main at 1b861da (with #6460 merged), without a terminal (STDIN from /dev/null) and in a real terminal:

  • Not set: error without a terminal, prompt in a terminal. A value of only spaces behaves the same.
  • confirm and prompt: prompt in both.
  • auto, 1, true, yes and on: no prompt in either.
  • none, 0, false, no and off: error in both.
  • Ran 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

  • Documentation
    • Added documentation for WP_CLI_AUTOCORRECT, including its default behavior, supported settings for prompting or automatically running suggested commands, and options for disabling autocorrection.
    • Noted that the setting is available starting with WP-CLI 3.0.0.

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.
@ekamran
ekamran requested a review from a team as a code owner November 27, 2026 12:18
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The configuration reference documents the WP_CLI_AUTOCORRECT environment variable, including its default behavior, accepted values, and availability since WP-CLI 3.0.0.

Changes: Autocorrection Configuration

Layer / File(s) Summary
Document autocorrection settings
references/config.md
The environment variables section describes when WP-CLI prompts, runs a suggested command automatically, or stops with an error. It lists accepted values and notes availability since WP-CLI 3.0.0.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Other

Suggested labels: scope:documentation

Suggested reviewers: swissspidy

Merge Risk: Minimal · up to ee947

This PR documents the WP_CLI_AUTOCORRECT environment variable in the config reference. It does not change runtime behavior, and no merge-blocking risk remains.

Architecture risk: Low · up to ee947

The change affects 1 source area.

Changed areas: references

Review details

Systems and components

  • observed — 1 changed file mapped to references.

Before / after behavior

  • observed — Modified behavior in references/config.md: Adds documentation for WP_CLI_AUTOCORRECT: by default, WP-CLI prompts when both input and output are terminals, and otherwise stops with an error containing the suggestion. confirm and prompt always ask; auto, 1, true, yes, and on run the suggestion without asking; none, 0, false, no, and off stop with the error. The entry notes availability since WP-CLI 3.0.0.
Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Document WP_CLI_AUTOCORRECT" matches the main change. The PR adds a documentation entry for the WP_CLI_AUTOCORRECT environment variable to references/config.md, covering its default behavio…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Document WP_CLI_AUTOCORRECT" matches the main change. The PR adds a documentation entry for the WP_CLI_AUTOCORRECT environment variable to references/config.md, covering its default behavior, accepted values, and availability since WP-CLI 3.0.0. The title is short, specific, and names the exact variable, so a reader scanning history can identify the change.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a9fbaa33-fd90-4272-90ba-db0a95afef27
Commits

Reviewing files that changed from the base of the PR and between 4205ac3 and ee94784.

Files selected for processing: 1

  • references/config.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@schlessera schlessera left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for documenting WP_CLI_AUTOCORRECT so clearly and verifying all the modes against 3.0.0, @ekamran! LGTM.

@schlessera
schlessera merged commit 79b1a70 into wp-cli:main Nov 27, 2026
8 checks passed
@ekamran
ekamran deleted the shifteq/document-autocorrect branch November 27, 2026 15:03
@schlessera schlessera added this to the 3.0.0 milestone Dec 1, 2026 — with schlessera-agent-fleet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants