4 A set of tools for controlling WordPress installations from the command line.
18 pear config-set auto_discover 1
19 sudo pear install wp-cli.github.com/pear/wpcli
25 git clone --recursive git://github.com/wp-cli/wp-cli.git ~/git/wp-cli
30 You can replace `~/git/wp-cli` with whatever you want.
36 Go into a WordPress root folder:
42 Typing `wp help` should show you an output similar to this:
46 wp google-sitemap [build|help] ...
47 wp core [update|help] ...
49 wp option [add|update|delete|get|help] ...
50 wp plugin [status|activate|deactivate|install|delete|update|help] ...
51 wp theme [status|details|activate|help] ...
54 So this tells us which commands are installed: eg. google-sitemap, core, home, ...
55 Between brackets you can see their sub commands.
57 Let's for example try to install the hello dolly plugin from wordpress.org:
60 wp plugin install hello-dolly
66 Installing Hello Dolly (1.5)
68 Downloading install package from http://downloads.WordPress.org/plugin/hello-dolly.1.5.zip ...
69 Unpacking the package ...
70 Installing the plugin ...
72 Success: The plugin is successfully installed
78 On a multisite installation, you need to pass a --blog parameter, so that WP knows which site it's supposed to be operating on:
81 wp theme status --blog=localhost/wp/test
84 If you have a subdomain installation, it would look like this:
87 wp theme status --blog=test.example.com
90 If you're usually working on the same site most of the time, you can put the url of that site in a file called 'wp-cli-blog' in your root WP dir:
93 echo 'test.example.com' > wp-cli-blog
96 Then, you can call `wp` without the --blog parameter again:
105 Adding commands to wp-cli is very easy. You can even add them from within your own plugin.
106 You can find more information about adding commands in the [Commands Cookbook](https://github.com/wp-cli/wp-cli/wiki/Commands-Cookbook) on our Wiki.
108 **Please share the commands you make, issue a pull request to get them included in wp-cli by default.**
115 - added `wp post` and `wp post-meta`
116 - added `wp user-meta`
117 - added `wp blog create`
119 - added `wp transient`
120 - added `wp db optimize` and `wp db repair`
121 - added `wp db create`, `wp db drop` and `wp db reset`
122 - added `wp db import`
123 - added `wp theme install` and `wp theme update`
124 - added `wp core install_network`
125 - added `--json` option to several subcommands
126 - added `--network` option to `wp plugin activate`
127 - added `--require` global parameter
128 - fixed `wp plugin update`
129 - fixed "out of memory" error
130 - misc bugfixes and optimizations
131 - man pages (not in PEAR package)
136 - added `wp core download`
137 - added `wp core config`
138 - added `wp plugin update --all`
139 - added `wp theme update`
140 - added `wp db import`
141 - added `--url` `--path` and `--user` global parameters
146 - added `wp eval` and `wp eval-file`
148 - added `wp core install`
149 - fixed `wp core update`
150 - added `--dev` flag to `wp plugin install`
151 - added `wp plugin uninstall`
152 - fixed `wp plugin install` and `wp plugin update`
157 - improved `wp option`
162 - added multisite support
163 - improved `wp plugin` and `wp theme`
164 - added `wp generate`
165 - added `wp core version`
166 - added `wp --version`
167 - added bash completion script
176 - [Contributor list](https://github.com/wp-cli/wp-cli/contributors)
177 - [Contributor guide](https://github.com/wp-cli/wp-cli/wiki/Commands-Cookbook)