Yesterday we launched WPVibe MCP, a free WordPress plugin that lets any AI assistant manage your WordPress site through a natural conversation. Create posts, update plugins, manage pages, all by just asking.
Today we’re adding something that takes it to a completely different level: WP-CLI support.
If the REST API gave your AI assistant hands, WP-CLI gives it superpowers.
The Problem That Started It All
I shared our WPVibe launch post on Twitter and noticed the preview looked wrong. No featured image, just a tiny generic thumbnail. Not great for a product launch.
Normally, debugging this means:
- Opening All in One SEO settings
- Checking the Social Networks tab
- Comparing global vs. per-post settings
- Looking at the actual HTML meta tags in the page source
- Figuring out which setting overrides which
- Testing, refreshing Twitter’s card validator, repeat
Instead, I just told my AI assistant: “The featured image isn’t showing when I share this post on Twitter. Can you figure out why?”
How WP-CLI Cracked the Case
Here’s what happened next. The AI assistant, connected to my site through WPVibe MCP, ran a series of database queries using WP-CLI to inspect the All in One SEO configuration:
- Queried the AIOSEO posts table to check the per-post social settings for the specific post
- Pulled the global AIOSEO options to see the site-wide Twitter and Facebook defaults
- Fetched the live page HTML to see what meta tags were actually being rendered
Within seconds, it identified three problems:
- The Twitter card type was set to
summary(small thumbnail) instead ofsummary_large_image(full-width banner) - The default image source was set to a generic fallback image from 2020 instead of using the post’s featured image
- The “Use Data from Facebook Tab” option was disabled, so Twitter had no image data to pull from
None of this is exposed through the WordPress REST API. The AI needed to query the aioseo_posts table and parse the aioseo_options option directly. That’s something only WP-CLI can do.
Here’s a screenshot of the AI diagnosing the issue in real time:
The Fix: Three Settings, Zero Clicking
Once the AI diagnosed the issue, it fixed it, updating the global AIOSEO settings through their REST API endpoint (which it discovered by inspecting the available API namespaces). One conversation, three fixes:
- Changed the default Twitter card type to
summary_large_image - Set the default image source to “featured image” for both Facebook and Twitter
- Enabled “Use Data from Facebook Tab” so Twitter inherits OG data
The result? Every post on the site now shows the full featured image when shared on Twitter or Facebook. A global fix from a single conversation.
Then It Got Interesting: A Full SEO Audit
While we were at it, I asked: “Can you do a full SEO audit of the site?”
In under a minute, the AI scanned all 482 published posts and came back with a complete audit:
- 14 posts missing AIOSEO titles (including our brand new WPVibe launch post)
- 7 posts missing meta descriptions
- 27 pages without meta descriptions, including important ones like the Template Directory and Press page
- 30 stale posts not updated since 2024 that could be consolidated or noindexed
- 3 thin content posts under 500 words
- 20+ images missing alt text on recent uploads
This isn’t a surface-level check. The AI queried the AIOSEO database tables directly, cross-referenced post metadata, checked content length, and identified duplicate titles, all through WP-CLI commands running on the live site.
Try getting that from a REST API call.
Why WP-CLI Changes Everything
The WordPress REST API is great for standard CRUD operations: creating posts, updating pages, managing users. But it has blind spots. It can’t:
- Query plugin-specific database tables (like AIOSEO, WooCommerce, or Yoast)
- Inspect raw option values to debug configuration issues
- Run bulk operations across hundreds of posts efficiently
- Search and replace across the database
- Export or analyze data in custom formats
- Check server environment details and configuration
WP-CLI can do all of that. And when your AI assistant has access to WP-CLI, it can diagnose problems that would otherwise require you to SSH into your server or install a database management tool.
Think of it this way: The REST API lets your AI read and write WordPress content. WP-CLI lets your AI understand your WordPress site.
The Secret: Why We Chose WP-CLI’s Interface
Here’s something interesting about how this works under the hood. We’re not actually shelling out to the WP-CLI binary on your server. Instead, we’ve built a WP-CLI compatible interface directly inside the WPVibe plugin.
Why? Because every major AI model, Claude, GPT, Gemini, has been trained on millions of examples of WP-CLI usage. These models already know WP-CLI’s syntax, flags, and subcommands inside and out. When you tell an AI assistant to “check the AIOSEO settings,” it instinctively reaches for wp option get aioseo_options or wp db query because that’s what it’s seen thousands of times in documentation, Stack Overflow answers, and WordPress tutorials.
By implementing a WP-CLI compatible interface, we get all the benefits of this existing AI knowledge without needing actual shell access to your server. The AI already knows the commands. We just gave it a safe way to run them.
What You Can Do With WP-CLI + AI
Here are just a few things that become possible when your AI assistant has WP-CLI access:
- Debug SEO issues: “Why isn’t my featured image showing on Twitter?” Diagnosed and fixed in one conversation.
- Run site audits: “Audit my SEO across all 482 posts.” Complete report in under a minute.
- Inspect plugin settings: “What are my WooCommerce tax settings?” Reads the options table directly.
- Database diagnostics: “Which posts have broken featured images?” Queries postmeta to find orphaned attachment IDs.
- Environment checks: “Is my PHP version compatible with this plugin update?” Checks the server config.
Security First
Giving an AI access to WP-CLI sounds powerful, because it is. That’s why we built WPVibe’s WP-CLI integration with strict security guardrails:
- Read-only for now: The current release supports read commands only, things like database queries, option inspection, and site diagnostics. Write commands are coming soon.
- Command allowlisting: Only approved WP-CLI commands can run. No arbitrary code execution.
- Custom sanitization: Every CLI command goes through a purpose-built sanitizer that prevents injection attacks while preserving the complex query syntax WP-CLI needs.
- No shell access: Commands run through WordPress’s internal execution layer, not through a system shell. There’s no WP-CLI binary involved at all.
You get the diagnostic power of WP-CLI without the risk of giving an AI unrestricted server access.
Try It Now
WP-CLI support is available now in WPVibe MCP v1.2. If you already have the plugin installed, update to the latest version. If you’re new, it takes about two minutes to set up:
- Download the free WPVibe plugin
- Install it on your WordPress site
- Connect it to your AI assistant (Claude, ChatGPT, Cursor, or any MCP-compatible tool)
- Start asking questions about your site
Read-only WP-CLI commands are completely free. You can run SEO audits, debug configuration issues, and inspect your database without paying a cent. Write commands will be available in a future Pro release.
P.S. We’re adding new WP-CLI commands every week based on real use cases like the one above. If there’s something you want your AI to be able to do on your WordPress site, let us know.