home / http-apis / wp-cli

WP-CLI

Official · WordPress
5k

Official WordPress command-line interface for core, plugins, themes, config, content, and multisite operations.

$curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && chmod +x wp-cli.phar && sudo mv wp-cli.phar /usr/local/bin/wp
Language
PHP
Stars
5,030
Category
HTTP & APIs
Agent
Ready
Agent Compatibility
JSON Output
Agent Skill
MCP Support
AI Analysis

WP-CLI is the command-line interface for administering WordPress installations without using wp-admin. It covers core setup, plugins, themes, content, database tasks, multisite operations, and remote execution against targeted installs.

What It Enables
  • Install, update, activate, and inspect plugins or themes, configure core settings, and run common site-admin tasks from the shell instead of the browser.
  • Inspect and change WordPress data, including posts, options, transients, imports, exports, and database search-replace operations.
  • Target local or remote installs with --path, --url, --ssh, --http, or saved aliases so the same workflow can run against dev, staging, or production sites.
Agent Fit
  • The command surface is mostly flag-driven, and site-targeting flags plus aliases make inspect, mutate, and verify loops practical across multiple WordPress environments.
  • Many commands can emit structured output through --format=json, and the framework also exposes JSON command and parameter dumps that help agents discover what is available.
  • It works best as a generic WordPress action layer that skills can pin to the right site, user, and safety flags for a specific project.
Caveats
  • Structured output is command-specific, so some commands still return prose and need per-command parsing instead of a uniform JSON contract.
  • Most commands bootstrap WordPress itself, which can execute plugin or theme code; remote or fragile sites often need careful targeting and flags like --skip-plugins, --skip-themes, or --context.