PHPackages                             wp-cli/wp-cli - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. wp-cli/wp-cli

ActiveLibrary[CLI &amp; Console](/categories/cli)

wp-cli/wp-cli
=============

WP-CLI framework

v2.12.0(1y ago)5.1k17.2M↑20.6%1.0k[26 issues](https://github.com/wp-cli/wp-cli/issues)[12 PRs](https://github.com/wp-cli/wp-cli/pulls)20MITPHPPHP ^5.6 || ^7.0 || ^8.0CI failing

Since Jan 26Pushed yesterday152 watchersCompare

[ Source](https://github.com/wp-cli/wp-cli)[ Packagist](https://packagist.org/packages/wp-cli/wp-cli)[ Docs](https://wp-cli.org)[ RSS](/packages/wp-cli-wp-cli/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (9)Versions (118)Used By (20)Security (1)

WP-CLI
======

[](#wp-cli)

[WP-CLI](https://wp-cli.org/) is the command-line interface for [WordPress](https://wordpress.org/). You can update plugins, configure multisite installations, and much more, without using a web browser.

Ongoing maintenance is made possible by:

[![](https://camo.githubusercontent.com/851aa9be8c70b0157e97f1867c288b09ca31883265c48516e5254f5ee4f8abc7/68747470733a2f2f6d616b652e776f726470726573732e6f72672f636c692f66696c65732f323031372f30342f6175746f6d61747469632d312e706e67)](https://automattic.com/)[![](https://camo.githubusercontent.com/c2e84c020fa53c35b3b86f0c85932451944957236d2519180999e0e0f9cde6d1/68747470733a2f2f6d616b652e776f726470726573732e6f72672f636c692f66696c65732f323031372f30342f626c7565686f73742e706e67)](https://www.bluehost.com/)[![](https://camo.githubusercontent.com/4b7ee067a1e79d845fd66e9fdb817e5b3d794d3e81bf39b9da1028c7d4ce132f/68747470733a2f2f6d616b652e776f726470726573732e6f72672f636c692f66696c65732f323031392f30362f70616e7468656f6e2e706e67)](https://pantheon.io/)[![](https://camo.githubusercontent.com/50eb1d4ca56b4be4fb7f40131949e0be23ad9200aa48b57fe3114c213481a2cf/68747470733a2f2f6d616b652e776f726470726573732e6f72672f636c692f66696c65732f323031392f30362f53475f6c6f676f2e706e67)](https://www.siteground.com/)[![](https://camo.githubusercontent.com/f08f3505eb6e6e6e4452340dc7f7208f2958457ec7316b0fee207375d00c0898/68747470733a2f2f6d616b652e776f726470726573732e6f72672f636c692f66696c65732f323031372f30342f7770656e67696e652e706e67)](https://wpengine.com/)[![](https://camo.githubusercontent.com/3b0f9e77bee573bb0d42ca746d250d3c54dafa40df0af89b0e189af0e4ff2a94/68747470733a2f2f6d616b652e776f726470726573732e6f72672f636c692f66696c65732f323032312f30322f436c6f7564776179732d4c6f676f2d65313631323238353236373639312e706e67)](https://www.cloudways.com/)

The current stable release is [version 2.12.0](https://make.wordpress.org/cli/2025/05/07/wp-cli-v2-12-0-release-notes/). For announcements, follow [@wpcli on Twitter](https://twitter.com/wpcli) or [sign up for email updates](https://make.wordpress.org/cli/subscribe/). [Check out the roadmap](https://make.wordpress.org/cli/handbook/roadmap/) for an overview of what's planned for upcoming releases.

[![Testing](https://github.com/wp-cli/wp-cli/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/wp-cli/actions/workflows/testing.yml) [![Average time to resolve an issue](https://camo.githubusercontent.com/0ccbf63301ce4d9320e75c54fc6ae743cd3cb6f2984a370751219c27763c642b/68747470733a2f2f697369746d61696e7461696e65642e636f6d2f62616467652f7265736f6c7574696f6e2f77702d636c692f77702d636c692e737667)](https://isitmaintained.com/project/wp-cli/wp-cli "Average time to resolve an issue") [![Percentage of issues still open](https://camo.githubusercontent.com/98c38ecec4c85b2c93e4912bd0d501d8ece3dd96c2fdd2841e4e18e67618e846/68747470733a2f2f697369746d61696e7461696e65642e636f6d2f62616467652f6f70656e2f77702d636c692f77702d636c692e737667)](https://isitmaintained.com/project/wp-cli/wp-cli "Percentage of issues still open")

Quick links: [Using](#using) | [Installing](#installing) | [Support](#support) | [Extending](#extending) | [Contributing](#contributing) | [Credits](#credits)

Using
-----

[](#using)

WP-CLI provides a command-line interface for many actions you might perform in the WordPress admin. For instance, `wp plugin install --activate` ([doc](https://developer.wordpress.org/cli/commands/plugin/install/)) lets you install and activate a WordPress plugin:

```
$ wp plugin install user-switching --activate
Installing User Switching (1.0.9)
Downloading installation package from https://downloads.wordpress.org/plugin/user-switching.1.0.9.zip...
Unpacking the package...
Installing the plugin...
Plugin installed successfully.
Activating 'user-switching'...
Plugin 'user-switching' activated.
Success: Installed 1 of 1 plugins.
```

WP-CLI also includes commands for many things you can't do in the WordPress admin. For example, `wp transient delete --all` ([doc](https://developer.wordpress.org/cli/commands/transient/delete/)) lets you delete one or all transients:

```
$ wp transient delete --all
Success: 34 transients deleted from the database.
```

For a more complete introduction to using WP-CLI, read the [Quick Start guide](https://make.wordpress.org/cli/handbook/quick-start/). Or, catch up with [shell friends](https://make.wordpress.org/cli/handbook/shell-friends/) to learn about helpful command line utilities.

Already feel comfortable with the basics? Jump into the [complete list of commands](https://developer.wordpress.org/cli/commands/) for detailed information on managing themes and plugins, importing and exporting data, performing database search-replace operations and more.

Installing
----------

[](#installing)

Downloading the Phar file is the recommended installation method for most users. See the documentation for [alternative installation methods](https://make.wordpress.org/cli/handbook/installing/) ([Composer](https://make.wordpress.org/cli/handbook/installing/#installing-via-composer), [Homebrew](https://make.wordpress.org/cli/handbook/installing/#installing-via-homebrew), [Docker](https://make.wordpress.org/cli/handbook/installing/#installing-via-docker)).

Before installing WP-CLI, please make sure your environment meets the minimum requirements:

- UNIX-like environment (OS X, Linux, FreeBSD, Cygwin); limited support in Windows environment
- PHP 7.2.24 or later
- WordPress 4.9 or later. Versions older than the latest WordPress release may have degraded functionality

Once you've verified requirements, download the [wp-cli.phar](https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) file using `wget` or `curl`:

```
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
```

Next, check the Phar file to verify that it's working:

```
php wp-cli.phar --info
```

To use WP-CLI from the command line by typing `wp`, make the file executable and move it to somewhere in your PATH. For example:

```
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
```

If WP-CLI was installed successfully, you should see something like this when you run `wp --info`:

```
$ wp --info
OS:     Linux 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64
Shell:  /usr/bin/zsh
PHP binary:     /usr/bin/php8.1
PHP version:    8.1.0
php.ini used:   /etc/php/8.1/cli/php.ini
MySQL binary:   /usr/bin/mysql
MySQL version:  mysql  Ver 8.0.27-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu))
SQL modes:
WP-CLI root dir:        /home/wp-cli/
WP-CLI vendor dir:      /home/wp-cli/vendor
WP_CLI phar path:
WP-CLI packages dir:    /home/wp-cli/.wp-cli/packages/
WP-CLI global config:
WP-CLI project config:  /home/wp-cli/wp-cli.yml
WP-CLI version: 2.12.0
```

### Updating

[](#updating)

You can update WP-CLI with `wp cli update` ([doc](https://developer.wordpress.org/cli/commands/cli/update/)), or by repeating the installation steps.

If WP-CLI is owned by root or another system user, you'll need to run `sudo wp cli update`.

Want to live life on the edge? Run `wp cli update --nightly` to use the latest nightly build of WP-CLI. The nightly build is more or less stable enough for you to use in your development environment, and always includes the latest and greatest WP-CLI features.

### Tab completions

[](#tab-completions)

WP-CLI also comes with a tab completion script for Bash and ZSH. Just download [wp-completion.bash](https://raw.githubusercontent.com/wp-cli/wp-cli/v2.6.0/utils/wp-completion.bash) and source it from `~/.bash_profile`:

```
source /FULL/PATH/TO/wp-completion.bash
```

Don't forget to run `source ~/.bash_profile` afterwards.

If using zsh for your shell, you may need to load and start `bashcompinit` before sourcing. Put the following in your `.zshrc`:

```
autoload bashcompinit
bashcompinit
source /FULL/PATH/TO/wp-completion.bash
```

Support
-------

[](#support)

WP-CLI's maintainers and contributors have limited availability to address general support questions. The [current version of WP-CLI](https://make.wordpress.org/cli/handbook/roadmap/) is the only officially supported version.

When looking for support, please first search for your question in these venues:

- [Common issues and their fixes](https://make.wordpress.org/cli/handbook/common-issues/)
- [WP-CLI handbook](https://make.wordpress.org/cli/handbook/)
- [Open or closed issues in the WP-CLI GitHub organization](https://github.com/issues?utf8=%E2%9C%93&q=sort%3Aupdated-desc+org%3Awp-cli+is%3Aissue)
- [Threads tagged 'WP-CLI' in the WordPress.org support forum](https://wordpress.org/support/topic-tag/wp-cli/)
- [Questions tagged 'WP-CLI' in the WordPress StackExchange](https://wordpress.stackexchange.com/questions/tagged/wp-cli)

If you didn't find an answer in one of the venues above, you can:

- Join the `#cli` channel in the [WordPress.org Slack](https://make.wordpress.org/chat/) to chat with whomever might be available at the time. This option is best for quick questions.
- [Post a new thread](https://wordpress.org/support/forum/wp-advanced/#new-post) in the WordPress.org support forum and tag it 'WP-CLI' so it's seen by the community.

GitHub issues are meant for tracking enhancements to and bugs of existing commands, not general support. Before submitting a bug report, please [review our best practices](https://make.wordpress.org/cli/handbook/bug-reports/) to help ensure your issue is addressed in a timely manner.

Please do not ask support questions on Twitter. Twitter isn't an acceptable venue for support because: 1) it's hard to hold conversations in under 280 characters, and 2) Twitter isn't a place where someone with your same question can search for an answer in a prior conversation.

Remember, libre != gratis; the open source license grants you the freedom to use and modify, but not commitments of other people's time. Please be respectful, and set your expectations accordingly.

Extending
---------

[](#extending)

A **command** is the atomic unit of WP-CLI functionality. `wp plugin install` ([doc](https://developer.wordpress.org/cli/commands/plugin/install/)) is one command. `wp plugin activate` ([doc](https://developer.wordpress.org/cli/commands/plugin/activate/)) is another.

WP-CLI supports registering any callable class, function, or closure as a command. It reads usage details from the callback's PHPdoc. `WP_CLI::add_command()` ([doc](https://make.wordpress.org/cli/handbook/internal-api/wp-cli-add-command/)) is used for both internal and third-party command registration.

```
/**
 * Delete an option from the database.
 *
 * Returns an error if the option didn't exist.
 *
 * ## OPTIONS
 *
 *
 * : Key for the option.
 *
 * ## EXAMPLES
 *
 *     $ wp option delete my_option
 *     Success: Deleted 'my_option' option.
 */
$delete_option_cmd = function( $args ) {
	list( $key ) = $args;

	if ( ! delete_option( $key ) ) {
		WP_CLI::error( "Could not delete '$key' option. Does it exist?" );
	} else {
		WP_CLI::success( "Deleted '$key' option." );
	}
};
WP_CLI::add_command( 'option delete', $delete_option_cmd );
```

WP-CLI comes with dozens of commands. It's easier than it looks to create a custom WP-CLI command. Read the [commands cookbook](https://make.wordpress.org/cli/handbook/commands-cookbook/) to learn more. Browse the [internal API docs](https://make.wordpress.org/cli/handbook/internal-api/) to discover a variety of helpful functions you can use in your custom WP-CLI command.

Contributing
------------

[](#contributing)

We appreciate you taking the initiative to contribute to WP-CLI. It’s because of you, and the community around you, that WP-CLI is such a great project.

**Contributing isn’t limited to just code.** We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.

Read through our [contributing guidelines in the handbook](https://make.wordpress.org/cli/handbook/contributing/) for a thorough introduction to how you can get involved. Following these guidelines helps to communicate that you respect the time of other contributors on the project. In turn, they’ll do their best to reciprocate that respect when working with you, across timezones and around the world.

Leadership
----------

[](#leadership)

WP-CLI has one project maintainer: [schlessera](http://github.com/schlessera).

On occasion, we [grant write access to contributors](https://make.wordpress.org/cli/handbook/committers-credo/) who have demonstrated, over a period of time, that they are capable and invested in moving the project forward.

Read the [governance document in the handbook](https://make.wordpress.org/cli/handbook/governance/) for more operational details about the project.

Credits
-------

[](#credits)

Besides the libraries defined in [composer.json](composer.json), we have used code or ideas from the following projects:

- [Drush](https://github.com/drush-ops/drush) for... a lot of things
- [wpshell](https://code.trac.wordpress.org/browser/wpshell) for `wp shell`
- [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/) for `wp media regenerate`
- [Search-Replace-DB](https://github.com/interconnectit/Search-Replace-DB) for `wp search-replace`
- [WordPress-CLI-Exporter](https://github.com/Automattic/WordPress-CLI-Exporter) for `wp export`
- [WordPress-CLI-Importer](https://github.com/Automattic/WordPress-CLI-Importer) for `wp import`
- [wordpress-plugin-tests](https://github.com/benbalter/wordpress-plugin-tests/) for `wp scaffold plugin-tests`

###  Health Score

78

—

ExcellentBetter than 100% of packages

Maintenance77

Regular maintenance activity

Popularity79

Solid adoption and visibility

Community63

Healthy contributor diversity

Maturity85

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~70 days

Recently: every ~175 days

Total

65

Last Release

377d ago

Major Versions

v0.25.0 → v1.0.02016-11-29

v1.5.1 → v2.0.02018-08-08

PHP version history (6 changes)v0.8.0PHP &gt;=5.3

v0.10.0PHP &gt;=5.3.2

v0.24.0PHP &gt;=5.3.29

v2.0.0PHP &gt;=5.4

v2.2.0PHP ^5.4 || ^7.0

v2.5.0PHP ^5.6 || ^7.0 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2439e3f2481a972350cdb74bdeaef11d15082a3b8fca1dbf33e8bbe3fbdcd3a7?d=identicon)[scribu](/maintainers/scribu)

![](https://www.gravatar.com/avatar/4b5740d002b5556abcceed36e016c8f8ba6f533eefef6107b3c60a830704993b?d=identicon)[danielbachhuber](/maintainers/danielbachhuber)

![](https://www.gravatar.com/avatar/6dde7f578e5530884238e7173f768ae3a890b6d66eb99262a82f2c494a1b67d4?d=identicon)[schlessera](/maintainers/schlessera)

![](https://www.gravatar.com/avatar/8cb417d1d61b7c3b4e69ff7ea9328f7d4f7e0af38b4fd92d82167a9904e93ac5?d=identicon)[andreascreten](/maintainers/andreascreten)

---

Top Contributors

[![danielbachhuber](https://avatars.githubusercontent.com/u/36432?v=4)](https://github.com/danielbachhuber "danielbachhuber (1735 commits)")[![schlessera](https://avatars.githubusercontent.com/u/83631?v=4)](https://github.com/schlessera "schlessera (1158 commits)")[![scribu](https://avatars.githubusercontent.com/u/225715?v=4)](https://github.com/scribu "scribu (954 commits)")[![swissspidy](https://avatars.githubusercontent.com/u/841956?v=4)](https://github.com/swissspidy "swissspidy (498 commits)")[![scribu-commits](https://avatars.githubusercontent.com/u/282080004?v=4)](https://github.com/scribu-commits "scribu-commits (249 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (207 commits)")[![gitlost](https://avatars.githubusercontent.com/u/481982?v=4)](https://github.com/gitlost "gitlost (174 commits)")[![miya0001](https://avatars.githubusercontent.com/u/309946?v=4)](https://github.com/miya0001 "miya0001 (101 commits)")[![GaryJones](https://avatars.githubusercontent.com/u/88371?v=4)](https://github.com/GaryJones "GaryJones (55 commits)")[![jrfnl](https://avatars.githubusercontent.com/u/663378?v=4)](https://github.com/jrfnl "jrfnl (55 commits)")[![thrijith](https://avatars.githubusercontent.com/u/13589980?v=4)](https://github.com/thrijith "thrijith (44 commits)")[![mrsdizzie](https://avatars.githubusercontent.com/u/1669571?v=4)](https://github.com/mrsdizzie "mrsdizzie (40 commits)")[![ernilambar](https://avatars.githubusercontent.com/u/2098823?v=4)](https://github.com/ernilambar "ernilambar (37 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (29 commits)")[![wojsmol](https://avatars.githubusercontent.com/u/4176111?v=4)](https://github.com/wojsmol "wojsmol (26 commits)")[![johnbillion](https://avatars.githubusercontent.com/u/208434?v=4)](https://github.com/johnbillion "johnbillion (25 commits)")[![rodrigoprimo](https://avatars.githubusercontent.com/u/77215?v=4)](https://github.com/rodrigoprimo "rodrigoprimo (23 commits)")[![nyordanov](https://avatars.githubusercontent.com/u/192220?v=4)](https://github.com/nyordanov "nyordanov (18 commits)")[![aaemnnosttv](https://avatars.githubusercontent.com/u/1621608?v=4)](https://github.com/aaemnnosttv "aaemnnosttv (17 commits)")[![BrianHenryIE](https://avatars.githubusercontent.com/u/4720401?v=4)](https://github.com/BrianHenryIE "BrianHenryIE (12 commits)")

---

Tags

cliframeworkhacktoberfestphpwordpresswp-clicliwordpress

### Embed Badge

![Health badge](/badges/wp-cli-wp-cli/health.svg)

```
[![Health](https://phpackages.com/badges/wp-cli-wp-cli/health.svg)](https://phpackages.com/packages/wp-cli-wp-cli)
```

###  Alternatives

[wp-cli/wp-cli-bundle

WP-CLI bundle package with default commands.

896.3M131](/packages/wp-cli-wp-cli-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
