Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

WP-CLI

$ wp Official High Risk
WordPress · Workspace & SaaS · MIT · macos / linux / windows

WP-CLI (wp) is the standard command-line interface for administering WordPress sites—managing plugins, themes, users, cron jobs, config constants, and serialized database search-replace. Supports --format=json, --fields, --skip-plugins, --path, --url, and remote --ssh aliases.

FCRS-1.0 Score
79 /100
Good
Medium Confidence
Zero-Friction Install
brew install wp-cli
CLI vs MCP Decision CLI Preferred vs MCP

wp runs directly inside the WordPress PHP runtime to execute PHP-serialized search-replace, plugin lifecycle hooks, and local DB operations that REST-based MCP servers cannot safely handle.

Agent-Readiness Checklist

✓ JSON Output
✓ Field Filtering
✓ Non-Interactive
✓ Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 21 / 25

Strong --format=json, --fields, --skip-plugins, and --dry-run on search-replace, though plugin PHP notices can pollute stdout unless --skip-plugins is used.

  • --format=json and --fields supported across list/get subcommands
  • --skip-plugins isolates execution from noisy third-party PHP plugins
Trust & Safety 19 / 25

Includes --dry-run on search-replace and --yes gates on db reset/drop, though running arbitrary PHP/WordPress hooks carries high blast radius.

  • wp search-replace --dry-run previews serialized DB diffs safely
Setup & Portability 12 / 15

Distributed as a single PHAR or via brew install wp-cli, but requires a compatible PHP runtime and WordPress files/DB.

  • Available via Homebrew and PHAR on macOS, Linux, and Windows
Utility & Efficiency 12 / 15

Unmatched breadth for WordPress admin, serialized DB replacement, cron, multisite, and remote --ssh management.

  • Covers plugins, themes, users, config, cron, and DB in one CLI
Maintenance & Lineage 8 / 10

Official WordPress project (wp-cli/wp-cli) licensed under MIT.

  • Maintained under official WordPress org
Docs & Verifiability 7 / 10

Comprehensive command handbook at developer.wordpress.org/cli/commands/, though third-party plugins add custom subcommands with varying quality.

  • Official WordPress CLI handbook and --help docs

Security, Auth & Guardrails

Auth Modes
Config File
Credential Storage

Reads WordPress database credentials directly from wp-config.php in --path, and stores remote SSH site aliases in wp-cli.yml or ~/.wp-cli/config.yml using standard SSH key authentication.

Side Effects
Read-Only Local Write Remote Write Destructive
Cost & Quotas

MIT open-source CLI; free to use on any local or remote WordPress installation.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# WP-CLI (wp) Agent Rules
- Always pass `--path <wp-root>` (or `@alias`) and `--format=json` on list/get commands.
- Always run `wp search-replace ... --dry-run` before executing live database replacements.
- Never run `wp db reset`, `wp db drop`, or `wp site delete` without explicit approval and a `wp db export` backup.

Agent-Ready Command Recipes

Safe Read-Only Queries

List installed WordPress plugins as JSON
wp plugin list --format=json --skip-plugins

Outputs plugin names, statuses, and available updates as JSON while skipping plugin runtime loading.

Preview a serialized database search-replace
wp search-replace 'http://old.example' 'https://new.example' --dry-run --skip-plugins

Counts matching database table changes across serialized PHP values without writing to the database.

Controlled Writes & Previews

Update a specific plugin safely
wp plugin update akismet --format=json

Updates a named WordPress plugin and reports the update result as JSON.

Strengths for Agents

  • + Widespread --format=json and --fields support across core WordPress resources.
  • + --skip-plugins prevents broken plugins from crashing or polluting agent JSON output.

Caveats & Pitfalls

  • ! Requires PHP CLI and access to wp-config.php and the MySQL/MariaDB database.
  • ! Third-party plugins can emit PHP warnings to stdout unless --skip-plugins or --quiet is used.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI