Don't auto-skip plugins/themes in wp_cli#63
Merged
christianc1 merged 2 commits intomainfrom Apr 30, 2026
Merged
Conversation
Forcing --skip-themes --skip-plugins on every WP-CLI invocation prevented plugin-provided commands like `wp elasticpress stats`, `wp acf`, and `wp redis` from being reachable through the MCP tool. Drop the unconditional flags so plugins and themes load by default. When a specific plugin or theme is fatally erroring, callers can pass --skip-plugins=<slug> / --skip-themes=<slug> (or the bare flags) per command to bypass it. The tool description now documents this so the agent can self-recover from fatals. Closes #58
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
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
runWpCliwas always appending--skip-themes --skip-plugins, which made plugin-provided WP-CLI commands (e.g.wp elasticpress stats,wp acf,wp redis) unreachable through the MCP tool — Claude would see "command not found" instead of being able to use the plugin's CLI.This drops the unconditional flags. Plugins and themes load by default; if a specific plugin/theme fatals, the caller passes
--skip-plugins=<slug>(or the bare flag) per command. The tool description now documents this so the agent can self-recover from a plugin fatal without dropping out to a terminal.src/tools/wpcli.ts— remove the auto-injected--skip-themes --skip-plugins; expand the tool description to call out the new default and the per-command escape hatch.tests/tools/__snapshots__/definitions.test.ts.snap— regenerate to match the updated description.Closes #58
Test plan
npm run lint(no new errors; pre-existing warnings only)npx tsc --noEmitnpm run test:coverage— 102/102 passnpm run buildwp_cliwithargs: "elasticpress stats"returns plugin output instead of "command not found"wp_cliwithargs: "plugin list --format=json"still workswp_cliwithargs: "--skip-plugins=problematic-plugin plugin list"— caller-provided skip flag is preserved