# WP-CLI Cheatsheet — AI Agent Bridge v0.21.1 > **d0a1.es** — Human when you decide. Agent when you delegate. All commands run inside the `wpcli` container: ```bash docker exec wpcli wp ai-agent [options] ``` --- ## Agent Jobs ### `run` — Enqueue an agent job ```bash docker exec wpcli wp ai-agent run --topic="AI trends 2026" docker exec wpcli wp ai-agent run --topic="WordPress security" --model="llama3" --wait docker exec wpcli wp ai-agent run --prompt="Write about Docker best practices" --timeout=600 ``` | Option | Description | |--------|-------------| | `--topic=` | Target topic for content generation | | `--prompt=` | Custom prompt (defaults to topic-based) | | `--model=` | LLM model (e.g. ministral-3:3b) | | `--provider=` | LLM provider (ollama or openai-compatible) | | `--wait` | Poll for job completion | | `--timeout=` | Max wait seconds (default: 300) | ### `jobs` — List recent agent jobs ```bash docker exec wpcli wp ai-agent jobs docker exec wpcli wp ai-agent jobs --status=failed --format=json docker exec wpcli wp ai-agent jobs --limit=50 --format=csv ``` | Option | Description | |--------|-------------| | `--status=` | Filter: queued, processing, completed, failed | | `--limit=` | Number of jobs (default: 20) | | `--offset=` | Pagination offset | | `--format=` | table, json, csv | ### `job ` — Show job details ```bash docker exec wpcli wp ai-agent job abc123-def456 docker exec wpcli wp ai-agent job abc123-def456 --format=json ``` ### `rerun ` — Re-run a failed/completed job ```bash docker exec wpcli wp ai-agent rerun abc123-def456 docker exec wpcli wp ai-agent rerun abc123-def456 --wait ``` | Option | Description | |--------|-------------| | `--wait` | Poll for completion | | `--timeout=` | Max wait seconds (default: 300) | --- ## Content Management ### `content list` — List AI-generated posts ```bash docker exec wpcli wp ai-agent content list docker exec wpcli wp ai-agent content list --status=draft --format=json docker exec wpcli wp ai-agent content list --score-min=80 --per-page=50 ``` | Option | Description | |--------|-------------| | `--status=` | Filter: any, draft, publish, pending, trash | | `--per-page=` | Posts per page (default: 20) | | `--paged=` | Page number | | `--score-min=` | Minimum validation score (0-100) | | `--score-max=` | Maximum validation score (0-100) | | `--format=` | table, json, csv, ids | ### `content publish ` — Publish a draft ```bash docker exec wpcli wp ai-agent content publish 42 ``` ### `content update ` — Update a post ```bash docker exec wpcli wp ai-agent content update 42 --title="New Title" docker exec wpcli wp ai-agent content update 42 --status=draft echo "New content" | docker exec -i wpcli wp ai-agent content update 42 --content=- ``` | Option | Description | |--------|-------------| | `--title=` | New post title | | `--content=<content>` | New content (use `-` for stdin) | | `--status=<status>` | draft, publish, pending | ### `content delete <id>` — Delete a post ```bash docker exec wpcli wp ai-agent content delete 42 docker exec wpcli wp ai-agent content delete 42 --force ``` | Option | Description | |--------|-------------| | `--force` | Skip trash, delete permanently | ### `content meta <id>` — View/update AI metadata ```bash docker exec wpcli wp ai-agent content meta 42 docker exec wpcli wp ai-agent content meta 42 --seo-score=85 --keywords="ai,wordpress" ``` | Option | Description | |--------|-------------| | `--seo-score=<n>` | Set validation score (0-100) | | `--keywords=<keywords>` | Set keywords (comma-separated) | | `--prompt=<prompt>` | Set original prompt | | `--topic=<topic>` | Set target topic | | `--format=<format>` | table, json | --- ## Configuration ### `config get` — Get content generation config ```bash docker exec wpcli wp ai-agent config get docker exec wpcli wp ai-agent config get --section=generation docker exec wpcli wp ai-agent config get --section=topics --format=json ``` | Option | Description | |--------|-------------| | `--section=<section>` | topics, sources, schedule, generation | | `--format=<format>` | table, json | ### `config set` — Update a config value ```bash docker exec wpcli wp ai-agent config set --key=generation.model --value="llama3" docker exec wpcli wp ai-agent config set --key=schedule.enabled --value=true docker exec wpcli wp ai-agent config set --key=schedule.posts_per_run --value=3 ``` | Option | Description | |--------|-------------| | `--key=<key>` | Dot notation: section.field | | `--value=<value>` | New value (true/false for booleans) | ### `config topics` — List configured topics ```bash docker exec wpcli wp ai-agent config topics docker exec wpcli wp ai-agent config topics --format=json ``` ### `config topics add` — Add a new topic ```bash docker exec wpcli wp ai-agent config topics add --name="AI Trends" --keywords="ai,machine learning,2026" ``` | Option | Description | |--------|-------------| | `--name=<name>` | Topic name (required) | | `--keywords=<keywords>` | Comma-separated keywords | | `--category-id=<id>` | WordPress category ID | | `--priority=<priority>` | low, medium, high (default: medium) | | `--frequency=<frequency>` | daily, biweekly, weekly, monthly | ### `config topics remove <id>` — Remove a topic ```bash docker exec wpcli wp ai-agent config topics remove abc123-def456 ``` ### `config sources` — List configured sources ```bash docker exec wpcli wp ai-agent config sources docker exec wpcli wp ai-agent config sources --format=json ``` ### `config sources add` — Add a new source ```bash docker exec wpcli wp ai-agent config sources add --name="TechCrunch" --url="https://techcrunch.com/feed" --type=rss ``` | Option | Description | |--------|-------------| | `--name=<name>` | Source name (required) | | `--url=<url>` | Source URL (required) | | `--type=<type>` | rss, url (default: rss) | ### `config sources remove <id>` — Remove a source ```bash docker exec wpcli wp ai-agent config sources remove abc123-def456 ``` --- ## Health & Monitoring ### `status` — System overview ```bash docker exec wpcli wp ai-agent status docker exec wpcli wp ai-agent status --format=json ``` Shows: plugin version, WP version, PHP version, backend connectivity, service status (Redis, Ollama, Qdrant, WordPress), job counts, AI post counts, config summary, webhook secret status. ### `health` — Service health check ```bash docker exec wpcli wp ai-agent health docker exec wpcli wp ai-agent health --format=json ``` ### `services` — Detailed service dependency status ```bash docker exec wpcli wp ai-agent services docker exec wpcli wp ai-agent services --format=json ``` --- ## Site & Plugin Management ### `site info` — WordPress site details ```bash docker exec wpcli wp ai-agent site info docker exec wpcli wp ai-agent site info --format=json ``` ### `plugin activate <slug>` — Activate a plugin ```bash docker exec wpcli wp ai-agent plugin activate redis-cache ``` ### `plugin deactivate <slug>` — Deactivate a plugin ```bash docker exec wpcli wp ai-agent plugin deactivate redis-cache ``` ### `plugin install <slug>` — Install a plugin ```bash docker exec wpcli wp ai-agent plugin install hello-dolly docker exec wpcli wp ai-agent plugin install classic-editor --no-activate ``` | Option | Description | |--------|-------------| | `--no-activate` | Install without activating | ### `plugin update [slug]` — Update plugins ```bash docker exec wpcli wp ai-agent plugin update docker exec wpcli wp ai-agent plugin update redis-cache ``` ### `theme update [slug]` — Update themes ```bash docker exec wpcli wp ai-agent theme update docker exec wpcli wp ai-agent theme update d0a1-binary ``` ### `updates check` — Check pending updates ```bash docker exec wpcli wp ai-agent updates check ``` --- ## Cache Management ### `cache status` — Redis cache status ```bash docker exec wpcli wp ai-agent cache status docker exec wpcli wp ai-agent cache status --format=json ``` ### `cache flush` — Flush Redis object cache ```bash docker exec wpcli wp ai-agent cache flush ``` ### `cache stats` — Redis cache statistics ```bash docker exec wpcli wp ai-agent cache stats docker exec wpcli wp ai-agent cache stats --format=json ``` --- ## Security ### `secret regenerate` — Rotate webhook secret ```bash docker exec wpcli wp ai-agent secret regenerate docker exec wpcli wp ai-agent secret regenerate --format=json ``` ⚠️ Update any external services that use this secret (n8n webhooks, FastAPI backend). --- ## Comment Moderation ### `comments moderate` — Review/trash/approve comments ```bash docker exec wpcli wp ai-agent comments moderate docker exec wpcli wp ai-agent comments moderate --action=trash-spam --dry-run docker exec wpcli wp ai-agent comments moderate --action=trash-spam --limit=100 ``` | Option | Description | |--------|-------------| | `--action=<action>` | review, trash-spam, approve (default: review) | | `--limit=<n>` | Max comments to process (default: 50) | | `--dry-run` | Preview without making changes | | `--format=<format>` | table, json | --- ## Cron Management ### `cron status` — Cron system status ```bash docker exec wpcli wp ai-agent cron status ``` ### `cron list` — List scheduled cron events ```bash docker exec wpcli wp ai-agent cron list docker exec wpcli wp ai-agent cron list --format=json ``` ### `cron run` — Run due cron events ```bash docker exec wpcli wp ai-agent cron run docker exec wpcli wp ai-agent cron run --hook=aiab_hourly_guardian ``` | Option | Description | |--------|-------------| | `--hook=<hook>` | Run a specific cron hook | ### `cron schedule` — Schedule a recurring event ```bash docker exec wpcli wp ai-agent cron schedule --hook=my_custom_hook --interval=3600 ``` | Option | Description | |--------|-------------| | `--hook=<hook>` | Cron hook name (required) | | `--interval=<seconds>` | 3600 (hourly), 86400 (daily), 604800 (weekly) | ### `cron unschedule` — Remove a scheduled event ```bash docker exec wpcli wp ai-agent cron unschedule --hook=my_custom_hook ``` ### `cron pause` — Pause cron processing ```bash docker exec wpcli wp ai-agent cron pause ``` ### `cron resume` — Resume cron processing ```bash docker exec wpcli wp ai-agent cron resume ``` --- ## Media ### `media show` — Show media settings ```bash docker exec wpcli wp ai-agent media show ``` ### `media optimize` — Optimize media library ```bash docker exec wpcli wp ai-agent media optimize docker exec wpcli wp ai-agent media optimize --limit=100 ``` | Option | Description | |--------|-------------| | `--limit=<n>` | Max items to process | --- ## Quick Reference | Task | Command | |------|---------| | System overview | `wp ai-agent status` | | Service health | `wp ai-agent health` | | Generate content | `wp ai-agent run --topic="..."` | | List AI posts | `wp ai-agent content list` | | Publish draft | `wp ai-agent content publish <id>` | | View config | `wp ai-agent config get` | | Change model | `wp ai-agent config set --key=generation.model --value="llama3"` | | Flush cache | `wp ai-agent cache flush` | | Moderate comments | `wp ai-agent comments moderate` | | Check updates | `wp ai-agent updates check` | | Rotate secret | `wp ai-agent secret regenerate` | | Cron status | `wp ai-agent cron status` | --- > Generated from `compose/cms/plugins/ai-agent-bridge/includes/class-cli.php` > AI Agent Bridge v0.21.1 — d0a1.es