Documentation / WP-CLI Commands

WP-CLI Commands

Updated March 28, 2026

Agent Builder includes full WP-CLI support for managing agents, configuring providers, running interactive chats, inspecting capabilities, and automating workflows from the command line.

Agent Management

wp agent list

List all installed agents with status, provider, model, and version.

wp agent list
wp agent list --status=active
wp agent list --format=json
OptionDescription
--status=<status>Filter by status: active or all (default: all)
--format=<format>Output format: table, json, csv, yaml
wp agent rag statusRAG service status and credit balance
wp agent rag sourcesList trained data sources
wp agent rag train <id>Train vector store on a post or page
wp agent rag upload <file>Upload PDF/TXT file for training
wp agent rag delete <source>Remove a trained source
wp agent rag creditsShow credit balance
wp agent rag search "query"Search the vector store
wp agent sync-marketplaceSync agent metadata to marketplace

wp agent info <slug>

Show detailed information about an agent: metadata, provider, model, mode, permissions, tools, deployment surfaces, scheduled tasks, and event listeners.

wp agent info wordpress-assistant
wp agent info content-writer --format=json

wp agent capabilities <slug>

Show the full capability stack for an agent: tools (with risk level and enabled state), skills, channels, WordPress abilities, and MCP status.

wp agent capabilities wordpress-assistant
wp agent capabilities content-writer --section=skills
wp agent capabilities seo-assistant --section=tools --format=json
OptionDescription
--section=<section>Show one section: tools, skills, channels, abilities, mcp, or all (default)
--format=<format>Output format: table or json
wp agent rag statusRAG service status and credit balance
wp agent rag sourcesList trained data sources
wp agent rag train <id>Train vector store on a post or page
wp agent rag upload <file>Upload PDF/TXT file for training
wp agent rag delete <source>Remove a trained source
wp agent rag creditsShow credit balance
wp agent rag search "query"Search the vector store
wp agent sync-marketplaceSync agent metadata to marketplace

wp agent deployments [<slug>]

Show where agents are deployed: shortcodes, admin bar, Gutenberg sidebar, WhatsApp, cron tasks, and event hooks. Omit the slug to see all active agents.

wp agent deployments
wp agent deployments content-writer
wp agent deployments --format=json

wp agent tools <slug>

List all tools available to an agent with their description, source, and enabled state.

wp agent tools content-writer
wp agent tools seo-assistant --type=agent
wp agent tools wordpress-assistant --format=json

Chat and Prompts

wp agent chat <slug>

Start an interactive chat session with an agent. Conversation history is maintained across turns. Type exit or quit to end the session.

wp agent chat wordpress-assistant
wp agent chat content-writer --verbose
wp agent chat seo-assistant --user=1
OptionDescription
--user=<id>Run as a specific WordPress user ID (default: 1)
--verboseShow tool calls and token usage after each response
wp agent rag statusRAG service status and credit balance
wp agent rag sourcesList trained data sources
wp agent rag train <id>Train vector store on a post or page
wp agent rag upload <file>Upload PDF/TXT file for training
wp agent rag delete <source>Remove a trained source
wp agent rag creditsShow credit balance
wp agent rag search "query"Search the vector store
wp agent sync-marketplaceSync agent metadata to marketplace

wp agent prompt <slug> "message"

Send a single-turn prompt to an agent and get a response. The agent has access to all its tools and can execute them during the response.

wp agent prompt wordpress-assistant "How do I create a custom post type?"
wp agent prompt content-writer "Draft a post about WordPress security" --format=json
wp agent prompt seo-assistant "Audit the homepage" --user=1 --raw
OptionDescription
--format=<format>Output format: text or json
--rawOutput raw response without formatting
--user=<id>Run as a specific WordPress user ID (default: 1)
wp agent rag statusRAG service status and credit balance
wp agent rag sourcesList trained data sources
wp agent rag train <id>Train vector store on a post or page
wp agent rag upload <file>Upload PDF/TXT file for training
wp agent rag delete <source>Remove a trained source
wp agent rag creditsShow credit balance
wp agent rag search "query"Search the vector store
wp agent sync-marketplaceSync agent metadata to marketplace

wp agent run-task <slug> <task>

Run a scheduled task for an agent. If the task has a prompt, it runs through the LLM autonomously; otherwise it falls back to a direct callback.

wp agent run-task seo-assistant audit-pages
wp agent run-task security-assistant scan-vulnerabilities

Configuration

wp agent config get

View the global or per-agent configuration for provider, model, mode, and vision model. Shows the effective value and whether it comes from a global default or per-agent override.

wp agent config get
wp agent config get --agent=content-writer
wp agent config get --format=json

wp agent config set <key> <value>

Set a global or per-agent configuration value. Valid keys: provider, model, mode, vision_model.

wp agent config set provider agentic
wp agent config set model gemini-2.5-flash
wp agent config set provider anthropic --agent=content-writer
wp agent config set mode autonomous --agent=seo-assistant

wp agent config reset –agent=<slug>

Clear all per-agent overrides for a specific agent, reverting it to the global defaults.

wp agent config reset --agent=content-writer

wp agent providers

List configured LLM providers with their status, active model, and which agents are using each provider.

wp agent providers
wp agent providers --all
wp agent providers --format=json
OptionDescription
--allInclude providers without API keys configured
--format=<format>Output format: table or json
wp agent rag statusRAG service status and credit balance
wp agent rag sourcesList trained data sources
wp agent rag train <id>Train vector store on a post or page
wp agent rag upload <file>Upload PDF/TXT file for training
wp agent rag delete <source>Remove a trained source
wp agent rag creditsShow credit balance
wp agent rag search "query"Search the vector store
wp agent sync-marketplaceSync agent metadata to marketplace

wp agent models

List available models for a provider by querying the provider’s API. Shows which model is currently active.

wp agent models
wp agent models --provider=openai
wp agent models --provider=ollama --format=json

wp agent license

Show the current license status, type (free, personal, agency), validity, and expiration.

wp agent license
wp agent license --format=json

MCP Integration

wp agent mcp-connect <slug>

Generate a ready-to-paste MCP configuration JSON for Claude Desktop, VS Code, Cursor, or any MCP-compatible client.

wp agent mcp-connect wordpress-assistant
wp agent mcp-connect content-writer --transport=http
OptionDescription
--transport=stdioSTDIO transport for local development (default)
--transport=httpHTTP transport for remote servers via @automattic/mcp-wordpress-remote
wp agent rag statusRAG service status and credit balance
wp agent rag sourcesList trained data sources
wp agent rag train <id>Train vector store on a post or page
wp agent rag upload <file>Upload PDF/TXT file for training
wp agent rag delete <source>Remove a trained source
wp agent rag creditsShow credit balance
wp agent rag search "query"Search the vector store
wp agent sync-marketplaceSync agent metadata to marketplace

Testing and Debugging

wp agent role-test <slug>

Test whether an agent understands its own role and capabilities. Sends 5 contextual questions about the agent’s identity, tools, expertise, limitations, and domain knowledge, then scores each response. A bonus round runs if all 5 core questions pass.

wp agent role-test wordpress-assistant
wp agent role-test content-writer --format=json

wp agent test-tools [<agent>]

Run functional tests on agent tools and core utilities. Invokes tools directly and asserts the response structure is correct.

wp agent test-tools
wp agent test-tools ai-radar --verbose
wp agent test-tools --format=json

wp agent resign-all

Regenerate HMAC-SHA256 integrity signatures for all agent abilities.json manifests. Run this after cloning a site or changing SECURE_AUTH_KEY.

wp agent resign-all
wp agent resign-all --format=json

Vector Store & RAG

These commands manage the AI Data Training feature — training agents on your own content via the Vector Store and RAG (Retrieval-Augmented Generation) system. Requires a premium license with API credits.

wp agent rag status

wp agent rag status

Shows the connection status to the RAG service, your credit balance, number of trained sources, and total vectors stored.

wp agent rag sources

wp agent rag sources

Lists all trained data sources with their type, chunk count, and training date.

wp agent rag train <post_id>

wp agent rag train 42
wp agent rag train scan

Trains the vector store on a specific published post or page. The content is stripped of HTML, chunked, and embedded. Use wp agent rag train scan to list all published content available for training.

wp agent rag upload <file>

wp agent rag upload /path/to/document.pdf
wp agent rag upload /path/to/data.txt

Uploads a PDF or text file to the vector store. The file is sent to the RAG service, parsed, chunked, and embedded. Supported formats: PDF, TXT, MD.

wp agent rag delete <source>

wp agent rag delete wp-post-42

Removes a trained source and its vectors from the store. Use wp agent rag sources to see source names.

wp agent rag credits

wp agent rag credits

Shows your current credit balance, lifetime purchased, and lifetime used.

wp agent rag search “<query>”

wp agent rag search "How do I reset my password?"
wp agent rag search "refund policy" --limit=3

Searches the vector store for content matching the query. Returns the most relevant chunks with their source and similarity score.

Marketplace Sync

wp agent sync-marketplace

wp agent sync-marketplace
wp agent sync-marketplace --dry-run
wp agent sync-marketplace --slug=ai-radar

Syncs bundled agent metadata (name, description, version, icon, tools) from the plugin library to the marketplace post type. Only runs on the marketplace site. Use --dry-run to preview changes without writing, or --slug to sync a single agent.

Examples

Run a quick SEO check from the command line:

wp agent prompt seo-assistant "Check the SEO for my latest 5 posts"

Start an interactive chat session:

wp agent chat wordpress-assistant

Switch all agents to a different provider:

wp agent config set provider anthropic
wp agent config set model claude-sonnet-4-6

Check where your agents are deployed:

wp agent deployments

Generate an MCP config for Claude Desktop:

wp agent mcp-connect wordpress-assistant --transport=stdio

Command Reference

CommandDescription
wp agent listList all agents with provider, model, and status
wp agent info <slug>Detailed agent metadata and deployment info
wp agent capabilities <slug>Tools, skills, channels, abilities, MCP
wp agent deployments [<slug>]Where agents are deployed
wp agent tools <slug>List tools with enabled/disabled state
wp agent chat <slug>Interactive multi-turn chat session
wp agent prompt <slug> "msg"Single-turn prompt with response
wp agent run-task <slug> <task>Run a scheduled task manually
wp agent config get/set/resetView or change provider, model, mode
wp agent providersList providers and agent assignments
wp agent modelsList available models from provider API
wp agent licenseShow license status and type
wp agent mcp-connect <slug>Generate MCP client configuration
wp agent role-test <slug>Test agent self-awareness
wp agent test-toolsFunctional tool tests
wp agent resign-allRe-sign abilities manifests
wp agent rag statusRAG service status and credit balance
wp agent rag sourcesList trained data sources
wp agent rag train <id>Train vector store on a post or page
wp agent rag upload <file>Upload PDF/TXT file for training
wp agent rag delete <source>Remove a trained source
wp agent rag creditsShow credit balance
wp agent rag search "query"Search the vector store
wp agent sync-marketplaceSync agent metadata to marketplace