WP-CLI exposes WordPress dashboard actions and extra maintenance tasks from the shell. Install the phar, then run wp commands against a WordPress installation.
Overview
WP-CLI is the command-line interface for WordPress. It wraps many tasks you would perform in the web admin—installing plugins, managing themes, users, posts, cron, multisite networks, and core updates—so they can be scripted without a browser.
It also includes operations that are awkward or unavailable in the admin UI, such as bulk transient cleanup or database search-replace. Output can feed deploy pipelines, cron jobs, and automation recipes for exports, cache flushes, and environment migrations.
Installation is typically a downloadable Phar executable placed on your PATH, with alternatives via Composer, Homebrew, or Docker documented separately. It expects a UNIX-like environment, a supported PHP runtime, and a compatible WordPress tree. Bash and Zsh tab-completion scripts are provided.
Developers can register custom commands with WP_CLI::add_command, reusing internal APIs documented for extensions. The project is community-maintained and described as scriptable infrastructure for agent and MCP integrations in recent materials.
Key features
- Plugin and theme install and update commands
- Database export, import, and search-replace
- User, post, and multisite management
- Core install, update, and verify
- Cron inspection and execution
- Custom command registration in PHP
- Shell tab completion for Bash and Zsh
Use cases
- Automating WordPress deploy and migration steps
- Running maintenance from cron without a browser
- Scripting bulk content or user administration
- CI checks on WordPress core integrity