Skip to content

Set default context to "auto"#6255

Merged
swissspidy merged 2 commits intomainfrom
copilot/set-default-context-to-auto
Mar 5, 2026
Merged

Set default context to "auto"#6255
swissspidy merged 2 commits intomainfrom
copilot/set-default-context-to-auto

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 2, 2026

Fulfills the long-standing promise from the v2.6.0 release to make --context=auto the default in a future major release. Without this, users running plugin/theme commands without explicitly passing --context=admin encounter subtle failures, particularly with paid plugins.

Changes

  • php/config-spec.php: Change context default from cli to auto
  • features/context.feature: Replace "CLI context is the default" scenario with:
    • Auto context is the default — verifies omitting --context routes evalcli and plugin/themeadmin
    • CLI context can be selected — retains explicit --context=cli coverage

Behavior delta

Command Before After
wp eval ... cli context cli context (via auto)
wp plugin list cli context admin context (via auto)
wp theme list cli context admin context (via auto)
Original prompt

This section details on the original issue you should resolve

<issue_title>Set default context to "auto"</issue_title>
<issue_description>WP-CLI v2.6.0 introduced the --context argument, see https://make.wordpress.org/cli/2022/01/26/wp-cli-v2-6-0-release-notes/

There it was announced --context=auto will become the new default in v2.7.0, but this never happened.

People keep running into issues with paid plugins, either being unaware of the flag (we should improve documentation) or despite the flag (see #5320).

Once we've fixed the remaining quirks, we should finally make good on the promise and change the default behavior going forward.

v3.0.0 is an excellent opportunity for that.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot AI changed the title [WIP] Set default context to 'auto' in WP-CLI Set default context to "auto" Mar 2, 2026
@swissspidy swissspidy added this to the 3.0.0 milestone Mar 3, 2026
@swissspidy swissspidy requested a review from Copilot March 4, 2026 08:10
@swissspidy

This comment was marked as resolved.

gemini-code-assist[bot]

This comment was marked as resolved.

This comment was marked as resolved.

@swissspidy swissspidy marked this pull request as ready for review March 4, 2026 08:42
@swissspidy swissspidy requested a review from a team as a code owner March 4, 2026 08:42
@swissspidy swissspidy merged commit 0dcc77f into main Mar 5, 2026
72 checks passed
@swissspidy swissspidy deleted the copilot/set-default-context-to-auto branch March 5, 2026 09:19
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.

Set default context to "auto"

3 participants