Title: WP-CLI – Page 15 – The command line interface for WordPress

---

 [  ](https://profiles.wordpress.org/danielbachhuber/) [Daniel Bachhuber](https://profiles.wordpress.org/danielbachhuber/)
12:00 am _on_ April 29, 2014      

# 󠀁[What the survey said](https://make.wordpress.org/cli/2014/04/29/survey-results/)󠁿

Many thanks to the 56 people who took our first user survey. We appreciate your 
time in helping us understand how WP-CLIWP-CLI WP-CLI is the Command Line Interface
for WordPress, used to do administrative and development tasks in a programmatic
way. The project page is [http://wp-cli.org/](http://wp-cli.org/) [https://make.wordpress.org/cli/](https://make.wordpress.org/cli/)
is being adopted by the community.

### By the numbers

**Almost 3/4 of respondents use WP-CLI actively**

53% use WP-CLI multiple times per day, 20% use it a couple or few times per week,
and 26% use it infrequently or rarely. 46% of respondents use WP-CLI interactively
at the command line, 34% have incorporated it into bash scripts, and 18% are using
WP-CLI with Puppet, Chef, or another provisioning system.

**WP-CLI is largely used to install and update**

Even with its variety of commands, WP-CLI is largely used to install and update.
37.5% of respondents reported using WP-CLI to install WordPress (with 30.36% using
it to update WordPress), and 32.14% reported using it to update plugins and themes.

After code management, WP-CLI is popularly used (23.21%) to perform migrations. 
Respondents reported using [`wp db export`](http://wp-cli.org/commands/db/export/)
and [`wp db import`](http://wp-cli.org/commands/db/import/) in conjunction with 
[`wp search-replace`](http://wp-cli.org/commands/search-replace/), or [`wp export`](http://wp-cli.org/commands/export/)
and [`wp import`](http://wp-cli.org/commands/import/).

A subset of respondents reported using WP-CLI to perform specialized tasks, including:

 * Creating users with [`wp user create`](http://wp-cli.org/commands/user/create/)
   and [`wp user import-csv`](http://wp-cli.org/commands/user/import-csv/).
 * [Deleting options](http://wp-cli.org/commands/option/delete/).
 * [Resizing images](http://wp-cli.org/commands/media/regenerate/).
 * [Creating posts / pages](http://wp-cli.org/commands/post/create/).
 * Quick code execution via [`wp eval`](http://wp-cli.org/commands/eval/), [`wp eval-file`](http://wp-cli.org/commands/eval-file/),
   and [`wp shell`](http://wp-cli.org/commands/shell/).
 * [Writing custom commands](https://github.com/wp-cli/wp-cli/wiki/Commands-Cookbook).

**Only 38% have used community packages**

WP-CLI now has 24 community packages listed in its [Package Index](http://wp-cli.org/package-index/).
A good 62% percent of respondents will have the good fortune in the future to discover
a helpful community package.

### Feature requests

**Remotely manage WordPress instances**

The most common thread amongst respondents is the desire to run WP-CLI commands 
in one place across multiple machines. Depending on what you have access to, there
are a couple of current ways to do this:

 1. If you have SSHSSH Secure SHell - a protocol for securely connecting to a remote
    system in addition to or in place of a password. access, X-Team’s [WP-CLI SSH](https://github.com/x-team/wp-cli-ssh)
    uses your SSH connection to run WP-CLI commands on a remote machine.
 2. The [WP Remote CLI](https://github.com/humanmade/wp-remote-cli) project proxies
    a subset of WP-CLI commands through WP Remote.

**Better documentation**

A substantial number of users requested better examples for the website. Let this
be a call for contributions! Because all of the command docs are generated from 
the source code, adding examples or clarifying usage notes is just a pull request
away.

Alternatively, you can [share your shell tips](https://github.com/wp-cli/wp-cli/wiki/Shell-Tips),
or contribute a blog post on how you’ve integrated WP-CLI into your workflow.

**Grab bag of enhancements**

If you have time to put together a pull request or community package, here’s a short
list of requested enhancements:

 * GitGit Git is a free and open source distributed version control system designed
   to handle everything from small to very large projects with speed and efficiency.
   Git is easy to learn and has a tiny footprint with lightning fast performance.
   Most modern plugin and theme development is being done with this version control
   system. [https://git-scm.com/](https://git-scm.com/) awareness: have pluginPlugin
   A plugin is a piece of software containing a group of functions that can be added
   to a WordPress website. They can extend functionality or add new features to 
   your WordPress websites. WordPress plugins are written in the PHP programming
   language and integrate seamlessly with WordPress. These can be free in the WordPress.
   org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
   or can be cost-based plugin from a third-party./coreCore Core is the set of software
   required to run WordPress. The Core Development Team builds WordPress. updates
   result in git commits (with automatically-generated messages).
 * Yum integration for `yum install wp-cli`, `yum check-update` and `yum update 
   wp-cli`.
 * Faster algorithm for the search-replace command when dealing with large databases.
 * Manage file and folder permissions for WordPress installs.
 * Reset all users passwords.
 * “Break in Windows less.”

**WP-CLI commands to prepare meals**

A good 7% of you think WP-CLI is capable of making your meals, asking for it to “
make breakfast”, “make coffee ;-)”, or “dishes?”. While we can’t make any promises,
we’ll continue to think about WP-CLI over breakfast and see if we get inspired.

 * [Login to Reply](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fmake.wordpress.org%2Fcli%2F2014%2F04%2F29%2Fsurvey-results%2F%23respond&locale=en_US)

 [  ](https://profiles.wordpress.org/scribu/) [scribu](https://profiles.wordpress.org/scribu/)
12:00 am _on_ April 17, 2014      

# 󠀁[New maintainer: Daniel Bachhuber](https://make.wordpress.org/cli/2014/04/17/new-maintainer-daniel-bachhuber/)󠁿

Good news everyone! [Daniel Bachhuber](https://github.com/danielbachhuber) is the
new maintainer of the WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress,
used to do administrative and development tasks in a programmatic way. The project
page is [http://wp-cli.org/](http://wp-cli.org/) [https://make.wordpress.org/cli/](https://make.wordpress.org/cli/)
project, which means he will be in charge of merging pull requests, releasing new
versions and generally making things better.

When I [started](https://github.com/wp-cli/wp-cli/commit/b481335b4ec1ac31f710567a286fc911b18666e7)
contributing to WP-CLI three years ago, it was because I had an itch to scratch.
That’s no longer the case, since I’ve stopped using WordPress altogether.

Unlike me, Daniel is using WordPress and WP-CLI professionally every day, so he 
has a much better sense of what the pain points are. Besides that, he’s a long time
contributor and has been leading many other open-source projects in the WordPress
ecosystem. Therefore, I’m confident that WP-CLI is in good hands.

Please join me in welcoming him to this new role 🙂

 * [Login to Reply](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fmake.wordpress.org%2Fcli%2F2014%2F04%2F17%2Fnew-maintainer-daniel-bachhuber%2F%23respond&locale=en_US)

 [  ](https://profiles.wordpress.org/scribu/) [scribu](https://profiles.wordpress.org/scribu/)
12:00 am _on_ April 15, 2014      

# 󠀁[Version 0.15 released](https://make.wordpress.org/cli/2014/04/15/version-0-15/)󠁿

A new version of WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress,
used to do administrative and development tasks in a programmatic way. The project
page is [http://wp-cli.org/](http://wp-cli.org/) [https://make.wordpress.org/cli/](https://make.wordpress.org/cli/)
is here. The highlights:

### Manage more things

There are brand new top-level commands for dealing with more types of objects in
a WordPress install:

 * `wp super-admin` for managing caped admins on multisiteMultisite Multisite is
   a WordPress feature which allows users to create a network of sites on a single
   WordPress installation. Available since WordPress version 3.0, Multisite is a
   continuation of WPMU or WordPress Multiuser project. WordPress MultiUser project
   was discontinued and its features were included into WordPress core. [Advanced Administration Handbook -> Create A Network.](https://developer.wordpress.org/advanced-administration/multisite/create-network/)
 * `wp menu` for managing navigation menus
 * `wp widget` and `wp sidebar` for managing widgets and sidebars
 * `wp theme mod` for managing theme mods

### Exporting only particular database tables

With the new `wp db tables` subcommand, you can generate a list of database tables,
which you can pass to the `wp db export` command, like so:

    ```
    wp db export --tables=$(wp db tables --url=sub.example.com | tr 'n' ',')
    ```

Composability is beautiful.

### Arbitrary command nesting

Up until now, you could only have top-level commands, like `wp search-replace` and
second-level subcommands, like `wp core install`. Now, you can have commands at 
any depth, such as `wp post meta update`.

This capability is especially useful to third-party commands, such as [wp-cli-buddypress](https://github.com/boonebgorges/wp-cli-buddypress).

### Revamped bash completions

Bash completions are now a bit smarter: besides auto-completing positional parameters
like `--dbname=`, it will also suggest file names, if the subcommand you’re writing
out expects a file name.

Note that after updating `wp-cli.phar`, you will also have to update the [wp-completion.bash](https://raw.githubusercontent.com/wp-cli/wp-cli/master/utils/wp-completion.bash)
file.

### Other changes

 * added support for WordPress 3.9 and bumped minimum required version to 3.5
 * disable KSES filtering when a user is not explicitly set
 * allow defining `skip-plugins` and `wp core config --extra-php` in the `wp-cli.
   yml` file
 * added `wp role reset` subcommand
 * added `wp transient delete-all` and `wp transient delete-expired` subcommands
 * `wp core config`: added `--skip-check` flag
 * `wp core is-installed`: added `--network` flag
 * `wp user create`: added `--send-email` flag
 * `wp user delete`: added `--network` flag
 * `wp option add`: added `--autoload=` parameter
 * `wp search-replace`: now works with tables that have a composite primary key
 * `wp post create`: fixed handling of `--post_category=` parameter
 * `wp eval-file`: allow passing arbitrary arguments to the file

You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=21&page=1&state=closed)
on GithubGitHub GitHub is a website that offers online implementation of git repositories
that can easily be shared, copied and modified by other developers. Public repositories
are free to host, private repositories require a paid subscription. GitHub introduced
the concept of the ‘pull request’ where code changes done in branches by contributors
can be reviewed and discussed before being merged by the repository owner. [https://github.com/](https://github.com/).

Contributors to this release: [clemens-tolboom](https://github.com/clemens-tolboom),
[danielbachhuber](https://github.com/danielbachhuber), [francescolaffi](https://github.com/francescolaffi),
[itsananderson](https://github.com/itsananderson), [johnpbloch](https://github.com/johnpbloch),
[mattheu](https://github.com/mattheu), [nyordanov](https://github.com/nyordanov),
[Rarst](https://github.com/Rarst), [robertboloc](https://github.com/robertboloc),
[rodrigoprimo](https://github.com/rodrigoprimo), [sboisvert](https://github.com/sboisvert),
[scribu](https://github.com/scribu), [szepeviktor](https://github.com/szepeviktor),
[trepmal](https://github.com/trepmal).

### Survey

We’d like to know how people are using WP-CLI so we set up a [quick survey](https://docs.google.com/forms/d/1oW7GHAoE4e1YMVWvbQlz3n_lziDdHQUlKeMm4x0_6XA/viewform)(
just 5 questions). We’d appreciate it if you would fill it out. The results will
be posted here, in a separate blog post.

 * [Login to Reply](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fmake.wordpress.org%2Fcli%2F2014%2F04%2F15%2Fversion-0-15%2F%23respond&locale=en_US)

 [  ](https://profiles.wordpress.org/scribu/) [scribu](https://profiles.wordpress.org/scribu/)
12:00 am _on_ February 6, 2014      

# 󠀁[Version 0.14 released](https://make.wordpress.org/cli/2014/02/06/version-0-14/)󠁿

I’m pleased to present the first release of WP-CLIWP-CLI WP-CLI is the Command Line
Interface for WordPress, used to do administrative and development tasks in a programmatic
way. The project page is [http://wp-cli.org/](http://wp-cli.org/) [https://make.wordpress.org/cli/](https://make.wordpress.org/cli/)
in 2014, coincidentally called 0.14.0. Let’s get right into it.

### Automatically detect WordPress in a subdirectory

Having [WordPress in a subdirectory](https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory)
is a great way keep your code repository clean.

Until now, you had to explicitly tell WP-CLI how to find it, either by using the`--
path=` parameter, or by creating a `wp-cli.yml` file in the root directory. With
version 0.14, it will find it automatically.

To make this not-common-enough scenario work, we had to once again call upon the
[dark powers of `eval()`](https://github.com/wp-cli/wp-cli/blob/v0.14.0/php/WP_CLI/Runner.php#L76-95).

### Protection against running as root

If you try to run a WP-CLI command as the superuser, WP-CLI will refuse to run. 
In production environemnts, most of the commands should actually be run under the
same user as the web server. But, in general, running commands as root is a bad 
idea.

For example, if you run `wp media regenerate` as `root`, then the newly created 
thumbnail files will naturally be owned by `root`. If the web server is running 
under the `www-data` user, it won’t be able to change these files (unless they’re
globally writable, which is less secure). So, the correct command would be `sudo-
u www-data wp media regenerate`.

If you trigger this protection, you will also receive instructions about how to 
disable it.

### `--skip-plugins` global flag

Ever used WP-CLI to install a pluginPlugin A plugin is a piece of software containing
a group of functions that can be added to a WordPress website. They can extend functionality
or add new features to your WordPress websites. WordPress plugins are written in
the PHP programming language and integrate seamlessly with WordPress. These can 
be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
or can be cost-based plugin from a third-party. that broke WP-CLI? Well, now there’s
a 100% sure way to deactivate it: `wp --skip-plugins plugin deactivate naughty-plugin`.

You can also skip only particular plugins: `wp --skip-plugins=admin-blocker,complex-
beast`.

###  Breaking changes

 * `wp term create`, `wp term update`, `wp term get` and `wp term delete` now accept
   the taxonomyTaxonomy A taxonomy is a way to group things together. In WordPress,
   some common taxonomies are category, link, tag, or post format. [https://codex.wordpress.org/Taxonomies#Default_Taxonomies](https://codex.wordpress.org/Taxonomies#Default_Taxonomies).
   as the first parameter, just like all the other term subcommands

###  Other changes

 * added `wp post url`, `wp comment url` and `wp site url` subcommands
 * added `wp theme enable` and `wp theme disable` subcommands for multisiteMultisite
   Multisite is a WordPress feature which allows users to create a network of sites
   on a single WordPress installation. Available since WordPress version 3.0, Multisite
   is a continuation of WPMU or WordPress Multiuser project. WordPress MultiUser
   project was discontinued and its features were included into WordPress core. 
   [Advanced Administration Handbook -> Create A Network.](https://developer.wordpress.org/advanced-administration/multisite/create-network/)
   installs
 * added `wp term generate` subcommand
 * added `--recurse-objects` flag to `wp search-replace`
 * added `--locale` flag to `wp core update`
 * `wp core download` now caches WordPress archives
 * all `wp user` subcommands now accept user emails as parameters (besides IDs and
   usernames)
 * `wp option` and `wp *-meta` subcommands can now read values from STDIN
 * `wp import` now accepts multiple files
 * `wp db export` now accepts all parameters that `mysqldump` accepts
 * `wp export` now uses a better backend developed by [Nikolay Bachiyski](https://github.com/nb/)(
   see [#525](https://github.com/wp-cli/wp-cli/pull/525))
 * plugin slugs passed to `wp plugin` subcommands are now always case-sensitive
 * fixed JetPack activation
 * fixed `wp core is-installed` for multisite
 * fixed `--max_depth` parameter for `wp post generate`
 * fixed `--role` parameter for `wp user generate`
 * fixed issue where `wp user import-csv` would pick up previous user IDs
 * fixed issue with progress bar calling `tput` too often
 * execution is now aborted if too many positional parameters are passed or if an
   unknown associative parameter is passed

You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=20&state=closed)
on GithubGitHub GitHub is a website that offers online implementation of git repositories
that can easily be shared, copied and modified by other developers. Public repositories
are free to host, private repositories require a paid subscription. GitHub introduced
the concept of the ‘pull request’ where code changes done in branches by contributors
can be reviewed and discussed before being merged by the repository owner. [https://github.com/](https://github.com/).

Contributors to this release: [bartaakos](https://github.com/bartaakos), [boonebgorges](https://github.com/boonebgorges),
[danielbachhuber](https://github.com/danielbachhuber), [eliorivero](https://github.com/eliorivero),
[francescolaffi](https://github.com/francescolaffi), [itsananderson](https://github.com/itsananderson),
[Japh](https://github.com/Japh), [jmslbam](https://github.com/jmslbam), [johnbillion](https://github.com/johnbillion),
[mboynes](https://github.com/mboynes), [mgburns](https://github.com/mgburns), [nb](https://github.com/nb),
[rodrigoprimo](https://github.com/rodrigoprimo), [scribu](https://github.com/scribu),
[sibprogrammer](https://github.com/sibprogrammer), [simonwheatley](https://github.com/simonwheatley),
[SpikesDivZero](https://github.com/SpikesDivZero), [westonruter](https://github.com/westonruter),
[ziz](https://github.com/ziz)

 * [Login to Reply](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fmake.wordpress.org%2Fcli%2F2014%2F02%2F06%2Fversion-0-14%2F%23respond&locale=en_US)

 [  ](https://profiles.wordpress.org/scribu/) [scribu](https://profiles.wordpress.org/scribu/)
12:00 am _on_ November 30, 2013      

# 󠀁[Version 0.13 released](https://make.wordpress.org/cli/2013/11/30/version-0-13/)󠁿

It’s been less than two months since the last major releaseMajor Release A set of
releases or versions having the same major version number may be collectively referred
to as “X.Y” -- for example version 5.2.x to refer to versions 5.2, 5.2.1, and all
other versions in the 5.2. (five dot two dot) branch of that software. Major Releases
often are the introduction of new major features and functionality. of WP-CLIWP-
CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative
and development tasks in a programmatic way. The project page is [http://wp-cli.org/](http://wp-cli.org/)
[https://make.wordpress.org/cli/](https://make.wordpress.org/cli/), and already 
we have a lot of goodies to show you.

### Global config files

If you create a `~/.wp-cli/config.yml` file, WP-CLI will read config values from
that file, regardless of where you’re running it from.

You can change the path to the global config file by setting the `WP_CLI_CONFIG_PATH`
environment variable. That means that you can also disable the global config, like
so:

    ```
    WP_CLI_CONFIG_PATH=/dev/null wp core install ...
    ```

The old `--config` global parameter is now deprecated.

### Setting command parameter values in config files

What’s more, you can now define per-command config values. For example, if my config
file looks like this:

    ```
    core install:
        admin_user: billy
        admin_email: billy@example.com
    ```

… when I run `wp core install`, I don’t have to pass the `--admin_user` and `--admin_email`
parameters again; they are read from the config file.

### Improved pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory 󠀁[https://wordpress.org/plugins/](https://wordpress.org/plugins/)󠁿 or can be cost-based plugin from a third-party. test templates

We have simplified the process of [setting up and running plugin tests](https://github.com/wp-cli/wp-cli/wiki/Plugin-Unit-Tests)
locally.

It fetches the test library from the new `develop.svn.wordpress.org` repository.

Also, the Travis build no longer depends on the GithubGitHub GitHub is a website
that offers online implementation of git repositories that can easily be shared,
copied and modified by other developers. Public repositories are free to host, private
repositories require a paid subscription. GitHub introduced the concept of the ‘
pull request’ where code changes done in branches by contributors can be reviewed
and discussed before being merged by the repository owner. [https://github.com/](https://github.com/)
mirror of WordPress.

### Improved downloads

Firstly, all HTTPSHTTPS HTTPS is an acronym for Hyper Text Transfer Protocol Secure.
HTTPS is the secure version of HTTP, the protocol over which data is sent between
your browser and the website that you are connected to. The 'S' at the end of HTTPS
stands for 'Secure'. It means all communications between your browser and the website
are encrypted. This is especially helpful for protecting sensitive data like banking
information. requests now use the more up-to-date SSLSSL Secure Socket Layer - Encryption
from the server to the browser and back. Prevents prying eyes from seeing what you
are sending between your browser and the server. CA bundle from the Requests library,
which should fix most certificate warnings.

Secondly, the timeout for `wp core download` has been increased to 10 minutes.

Thirdly, to extract the tarball, `wp core download` now uses the [PharData](http://us3.php.net/manual/en/class.phardata.php)
class, instead of the `tar` binary. This should make it work in more environments,
such as MinGW.

Finally, plugin and theme downloads are now cached. So, the first time you run `
wp plugin install bbpress`, it will save the zip locally. The second time you run
it, it won’t download the zip again.

### Other improvements

Additions:

 * added `--all` flag to `wp plugin deactivate`
 * added `wp comment-meta` command
 * added filtering to `wp plugin list` and `wp theme list`
 * added `--match` and `--source` parameters to `wp rewrite list`
 * added `--post_content` flag to `wp post generate`
 * added `--skip-tests` flag to `wp scaffold plugin`
 * added `--skip=image_resize` to `wp import`

Bug fixes:

 * `wp core config` no longer escapes HTMLHTML HTML is an acronym for Hyper Text
   Markup Language. It is a markup language that is used in the development of web
   pages and websites. characters in passwords
 * `wp user create` no longer ignores the `--role` parameter
 * `wp rewrite structure` correctly flushes rewrite rules
 * `wp theme delete` now refuses to delete the active theme
 * `wp scaffold post-type` now generates correct capitalization
 * `wp plugin activate` now works correctly for network-only plugins
 * `wp shell` now works correctly even if a plugin starts output buffering
 * `wp core install --prompt` now correctly handles the `--url` parameter

Misc:

 * removed `wp core init-tests` command ([context](https://github.com/wp-cli/wp-cli/pull/885))
 * renamed `WP_CLI::add_action()` to `WP_CLI::add_hook()` ([context](https://github.com/wp-cli/wp-cli/pull/845))

You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=19&page=1&state=closed)
on Github.

Contributors to this release: [BoiteAWeb](https://github.com/BoiteAWeb), [ctayloroomphinc](https://github.com/ctayloroomphinc),
[danielbachhuber](https://github.com/danielbachhuber), [dd32](https://github.com/dd32),
[francescolaffi](https://github.com/francescolaffi), [jonathanbardo](https://github.com/jonathanbardo),
[Kevinlearynet](https://github.com/Kevinlearynet), [leewillis77](https://github.com/leewillis77),
[nickdaugherty](https://github.com/nickdaugherty), [QWp6t](https://github.com/QWp6t),
[rodrigoprimo](https://github.com/rodrigoprimo), [ryanduff](https://github.com/ryanduff),
[scribu](https://github.com/scribu), [simonwheatley](https://github.com/simonwheatley),
[tiagohillebrandt](https://github.com/tiagohillebrandt), [tlovett1](https://github.com/tlovett1),
[wojsmol](https://github.com/wojsmol).

 * [Login to Reply](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fmake.wordpress.org%2Fcli%2F2013%2F11%2F30%2Fversion-0-13%2F%23respond&locale=en_US)

 [  ](https://profiles.wordpress.org/scribu/) [scribu](https://profiles.wordpress.org/scribu/)
12:00 am _on_ October 24, 2013      

# 󠀁[How WP-CLI loads WordPress](https://make.wordpress.org/cli/2013/10/24/how-wp-cli-loads-wordpress/)󠁿

Shelly Bashful loves the command line. Since she’s been using it daily at work, 
she knows all the little tricks that make typing at the console a breeze.

She’d been put in charge of a WordPress site a few weeks ago and was sorely missing
a CLICLI Command Line Interface. Terminal (Bash) in Mac, Command Prompt in Windows,
or WP-CLI for WordPress. management tool. All modern web frameworks have one and
Drupal has Drush. For cron jobs, she could trigger HTTPHTTP HTTP is an acronym for
Hyper Text Transfer Protocol. HTTP is the underlying protocol used by the World 
Wide Web and this protocol defines how messages are formatted and transmitted, and
what actions Web servers and browsers should take in response to various commands.
requests, but that seemed like a really roundabout way of doing things.

She figures that if she manages to load the WP environment from a CLI script, the
rest would be easy. After a bit of trial-and-error, she comes up with a few lines
of codeLines of Code Lines of code. This is sometimes used as a poor metric for 
developer productivity, but can also have other uses.:

    ```
    $_SERVER['HTTP_HOST'] = 'example.com';
    define('WP_ADMIN', true);
    require('wordpress/wp-load.php');
    ```

Shelly is pleased; her script even works on multisiteMultisite Multisite is a WordPress
feature which allows users to create a network of sites on a single WordPress installation.
Available since WordPress version 3.0, Multisite is a continuation of WPMU or WordPress
Multiuser project. WordPress MultiUser project was discontinued and its features
were included into WordPress core. [Advanced Administration Handbook -> Create A Network.](https://developer.wordpress.org/advanced-administration/multisite/create-network/)
installs. Both the host name and the path to the WordPress install are hardcoded,
but she can figure ways around that later.

With her geeky curiosity satisfied, she lazily types in a google search, to check
if anyone else has solved this problem. The first result is a project called WP-
CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative
and development tasks in a programmatic way. The project page is [http://wp-cli.org/](http://wp-cli.org/)
[https://make.wordpress.org/cli/](https://make.wordpress.org/cli/). She installs
it and tries out a few commands – it seems to work pretty well.

She then goes to the WP-CLI source and searches for ‘wp-load.php’, to see how it
handles the WordPress bootstrapping – 0 results. Puzzled, she starts going through
the first file that gets executed and eventually reaches one called `wp-setting-
cli.php`. This strikes Shelly as peculiar, since she encountered a similar file 
in WordPress CoreCore Core is the set of software required to run WordPress. The
Core Development Team builds WordPress.. She signs into the project’s IRC channel.

shelly: “Why does WP-CLI use a modified copy of the wp-settings.php file?”

After a while, someone responds:

scribu: “Because WordPress does several things that don’t make sense in a CLI context.
For example, if the database tables are not installed, it prints out an HTMLHTML
HTML is an acronym for Hyper Text Markup Language. It is a markup language that 
is used in the development of web pages and websites. page with a link to the setup
screen.”

shelly: “Ok, but won’t that break when WordPress adds or removes files?”

scribu: “Yes, it would, but keeping our copy up-to-date hasn’t been too difficult
so far and the control it gives us is worth it. In particular, it would be tricky
to avoid loading the `advanced-cache.php` drop-in otherwise.”

shelly: “Wouldn’t the caching problem be solved by setting `WP_ADMIN` to true?”

scribu: “We tried that, but it turns out there are a lot of plugins that attempt
to blockBlock Block is the abstract term used to describe units of markup that, 
composed together, form the content or layout of a webpage using the WordPress editor.
The idea combines concepts of what in the past may have achieved with shortcodes,
custom HTML, and embed discovery into a single consistent API and user experience.
wp-admin access, by calling `wp_redirect()` and then `exit()`. So now we load the
admin-specific code explicitly.”

shelly: “Fair enough.”

 * [Login to Reply](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fmake.wordpress.org%2Fcli%2F2013%2F10%2F24%2Fhow-wp-cli-loads-wordpress%2F%23respond&locale=en_US)

 [  ](https://profiles.wordpress.org/scribu/) [scribu](https://profiles.wordpress.org/scribu/)
12:00 am _on_ October 11, 2013      

# 󠀁[Version 0.12.1 released](https://make.wordpress.org/cli/2013/10/11/version-0-12-1/)󠁿

Hot on the heels of the [0.12 release](https://make.wordpress.org/blog/version-0.12.html?output_format=md)
comes a minor releaseMinor Release A set of releases or versions having the same
minor version number may be collectively referred to as .x , for example version
5.2.x to refer to versions 5.2, 5.2.1, 5.2.3, and all other versions in the 5.2 (
five dot two) branch of that software. Minor Releases often make improvements to
existing features and functionality. with a few fixes:

 * fixed `wp plugin delete` when pluginPlugin A plugin is a piece of software containing
   a group of functions that can be added to a WordPress website. They can extend
   functionality or add new features to your WordPress websites. WordPress plugins
   are written in the PHP programming language and integrate seamlessly with WordPress.
   These can be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
   or can be cost-based plugin from a third-party. is not in its own directory
 * show warning when an HTTPSHTTPS HTTPS is an acronym for Hyper Text Transfer Protocol
   Secure. HTTPS is the secure version of HTTP, the protocol over which data is 
   sent between your browser and the website that you are connected to. The 'S' 
   at the end of HTTPS stands for 'Secure'. It means all communications between 
   your browser and the website are encrypted. This is especially helpful for protecting
   sensitive data like banking information. request fails
 * added `--field=` parameter to `wp plugin search` and `wp theme search`
 * made the `--post__in=` parameter in `wp post list` work
 * added `--match=` argument for `wp rewrite list` + other improvements

You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=18&page=1&state=closed)
on GithubGitHub GitHub is a website that offers online implementation of git repositories
that can easily be shared, copied and modified by other developers. Public repositories
are free to host, private repositories require a paid subscription. GitHub introduced
the concept of the ‘pull request’ where code changes done in branches by contributors
can be reviewed and discussed before being merged by the repository owner. [https://github.com/](https://github.com/).

Contributors to this release: [danielbachhuber](https://github.com/danielbachhuber),
[mattes](https://github.com/mattes), [scribu](https://github.com/scribu)

 * [Login to Reply](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fmake.wordpress.org%2Fcli%2F2013%2F10%2F11%2Fversion-0-12-1%2F%23respond&locale=en_US)

 [  ](https://profiles.wordpress.org/scribu/) [scribu](https://profiles.wordpress.org/scribu/)
12:00 am _on_ October 4, 2013      

# 󠀁[Version 0.12 released](https://make.wordpress.org/cli/2013/10/04/version-0-12/)󠁿

It’s been almost two months since the last major releaseMajor Release A set of releases
or versions having the same major version number may be collectively referred to
as “X.Y” -- for example version 5.2.x to refer to versions 5.2, 5.2.1, and all other
versions in the 5.2. (five dot two dot) branch of that software. Major Releases 
often are the introduction of new major features and functionality.. We have a few
neat features to show you:

### `wp site list` command

I predict that this will turn out to be the most useful command for managing multisiteMultisite
Multisite is a WordPress feature which allows users to create a network of sites
on a single WordPress installation. Available since WordPress version 3.0, Multisite
is a continuation of WPMU or WordPress Multiuser project. WordPress MultiUser project
was discontinued and its features were included into WordPress core. [Advanced Administration Handbook -> Create A Network.](https://developer.wordpress.org/advanced-administration/multisite/create-network/)
installs, because you can use it to loopLoop The Loop is PHP code used by WordPress
to display posts. Using The Loop, WordPress processes each post to be displayed 
on the current page, and formats it according to how it matches specified criteria
within The Loop tags. Any HTML or PHP code in the Loop will be processed on each
post. [https://codex.wordpress.org/The_Loop](https://codex.wordpress.org/The_Loop)
through all of them, directly from bash even:

    ```
    for url in $(wp site list --field=url)
    do
        echo "$url:"
        wp --url=$url post list
    done
    ```

### New `--field=` parameter

Notice the `--field=url` parameter I used above? It’s available for all commands
that display some information. A few examples:

    ```
    wp post get 123 --field=content

    wp user list --field=username
    ```

This will retrieve only the content of the post with ID 123 and nothing else.

### Experimental `--prompt` global parameter

This nifty little parameter changes the behaviour of commands when required arguments
are not passed to a command. Instead of showing an error and exiting, it prompts
you for the value of each argument. Try it out:

    ```
    wp theme scaffold --prompt
    ```

### Phar archives are back

They were originally introduced in [version 0.9](http://wp-cli.org/blog/version-0.9.html)
and… ahem, naively abandoned in the next release with the introduction of the installer
script.

The installer uses Composer, which has its own environmental requirements, but, 
more importantly, it has to fetch all of the packages WP-CLIWP-CLI WP-CLI is the
Command Line Interface for WordPress, used to do administrative and development 
tasks in a programmatic way. The project page is [http://wp-cli.org/](http://wp-cli.org/)
[https://make.wordpress.org/cli/](https://make.wordpress.org/cli/) depends on, which
is both less reliable and slower than downloading a single file that contains everything.

This is particularly important in a continuous integration environment, like Travis
CI, where you want to have your builds run as fast as possible and fail only due
to failing tests, not due to a faulty internet connection.

So, phar archives can be downloaded from the [wp-cli/builds](https://github.com/wp-cli/builds/tree/gh-pages/phar)
repository.

### Breaking changes

 * `wp post get --format=content` was replaced with `wp post get --field=content`
 * the `wp rewrite dump` command was replaced with `wp rewrite list`
 * the `wp comment last` command was removed (use `wp comment list` instead)

### Other non-obvious changes

 * `wp search-replace` no longer touches serialized objects ([#792](https://github.com/wp-cli/wp-cli/issues/792#issuecomment-25376430))
 * WP-CLI will display PHPPHP PHP (recursive acronym for PHP: Hypertext Preprocessor)
   is a widely-used open source general-purpose scripting language that is especially
   suited for web development and can be embedded into HTML. [https://www.php.net/manual/en/index.php](https://www.php.net/manual/en/index.php)
   errors on STDERR, even if XDebug is not installed ([#786](https://github.com/wp-cli/wp-cli/pull/786))

### New commands

 * `wp comment get`, `wp comment update` and `wp comment exists`
 * `wp plugin get` and `wp theme get`
 * `wp plugin search` and `wp theme search`
 * `wp plugin is-installed` and `wp theme is-installed`
 * `wp user add-cap`, `wp user remove-cap` and `wp user list-caps`

You can browse the full list of [resolved issues](https://github.com/WP-CLI/WP-CLI/issues?milestone=14&state=closed)
on GithubGitHub GitHub is a website that offers online implementation of git repositories
that can easily be shared, copied and modified by other developers. Public repositories
are free to host, private repositories require a paid subscription. GitHub introduced
the concept of the ‘pull request’ where code changes done in branches by contributors
can be reviewed and discussed before being merged by the repository owner. [https://github.com/](https://github.com/).

Contributors to this release: [c10b10](https://github.com/c10b10), [danielbachhuber](https://github.com/danielbachhuber),
[getsource](https://github.com/getsource), [goldenapples](https://github.com/goldenapples),
[jmslbam](https://github.com/jmslbam), [johnbillion](https://github.com/johnbillion),
[joshbetz](https://github.com/joshbetz), [jtsternberg](https://github.com/jtsternberg),
[mattes](https://github.com/mattes), [MattiaG](https://github.com/MattiaG), [mpeshev](https://github.com/mpeshev),
[nikolay](https://github.com/nikolay), [nullvariable](https://github.com/nullvariable),
[oknoway](https://github.com/oknoway), [Rarst](https://github.com/Rarst), [scribu](https://github.com/scribu),
[smhmic](https://github.com/smhmic), [stianlik](https://github.com/stianlik), [thisislawatts](https://github.com/thisislawatts),
[trepmal](https://github.com/trepmal), [westonruter](https://github.com/westonruter).

 * [Login to Reply](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fmake.wordpress.org%2Fcli%2F2013%2F10%2F04%2Fversion-0-12%2F%23respond&locale=en_US)

 [  ](https://profiles.wordpress.org/scribu/) [scribu](https://profiles.wordpress.org/scribu/)
12:00 am _on_ August 22, 2013      

# 󠀁[Version 0.11.2 is out](https://make.wordpress.org/cli/2013/08/22/version-0-11-2/)󠁿

This is a minor releaseMinor Release A set of releases or versions having the same
minor version number may be collectively referred to as .x , for example version
5.2.x to refer to versions 5.2, 5.2.1, 5.2.3, and all other versions in the 5.2 (
five dot two) branch of that software. Minor Releases often make improvements to
existing features and functionality., which contains a single change that fixes 
[many issues](https://github.com/wp-cli/wp-cli/issues?milestone=16&state=closed).

### Changelog

Internals:

 * don’t set `WP_ADMIN` to true and don’t fire the `'admin_init'` hook.

 * [Login to Reply](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fmake.wordpress.org%2Fcli%2F2013%2F08%2F22%2Fversion-0-11-2%2F%23respond&locale=en_US)

 [  ](https://profiles.wordpress.org/scribu/) [scribu](https://profiles.wordpress.org/scribu/)
12:00 am _on_ August 8, 2013      

# 󠀁[Version 0.11.1 released](https://make.wordpress.org/cli/2013/08/08/version-0-11-1/)󠁿

This is a minor releaseMinor Release A set of releases or versions having the same
minor version number may be collectively referred to as .x , for example version
5.2.x to refer to versions 5.2, 5.2.1, 5.2.3, and all other versions in the 5.2 (
five dot two) branch of that software. Minor Releases often make improvements to
existing features and functionality., which fixes a few regressions.

### Changelog

Commands:

 * made `search-replace` work with tables that have reserved column names, such 
   as ‘default’
 * made `option update` work correctly for `blog_public`
 * fixed notice in `scaffold post-type`
 * fixed colorization on `wp plugin update-all --dry-run`

Internals:

 * fixed bug where `wp help` would not display commands defined in plugins
 * fixed synopsis parser bug where arguments with vertical bars would be ignored
 * added support for `WP_CLI_PHP_ARGS` environment variable

You can also browse the list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=15&state=closed)
on GithubGitHub GitHub is a website that offers online implementation of git repositories
that can easily be shared, copied and modified by other developers. Public repositories
are free to host, private repositories require a paid subscription. GitHub introduced
the concept of the ‘pull request’ where code changes done in branches by contributors
can be reviewed and discussed before being merged by the repository owner. [https://github.com/](https://github.com/).

Contributors to this release: [c10b10](https://github.com/c10b10), [jmslbam](https://github.com/jmslbam),
[scribu](https://github.com/scribu).

 * [Login to Reply](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fmake.wordpress.org%2Fcli%2F2013%2F08%2F08%2Fversion-0-11-1%2F%23respond&locale=en_US)

## Post navigation

[← Older posts](https://make.wordpress.org/cli/page/16/?output_format=md)

[Newer posts →](https://make.wordpress.org/cli/page/14/?output_format=md)