4 A set of tools for controlling WordPress installations from the command line.
17 pear config-set auto_discover 1
18 sudo pear install wp-cli.github.com/pear/wpcli
24 git clone --recurse-submodules git://github.com/wp-cli/wp-cli.git ~/git/wp-cli
29 You can replace `~/git/wp-cli` with whatever you want.
35 Go into a WordPress root folder:
41 Typing `wp help` should show you an output similar to this:
45 wp google-sitemap [build|help] ...
46 wp core [update|help] ...
48 wp option [add|update|delete|get|help] ...
49 wp plugin [status|activate|deactivate|install|delete|update|help] ...
50 wp theme [status|details|activate|help] ...
53 So this tells us which commands are installed: eg. google-sitemap, core, home, ...
54 Between brackets you can see their sub commands.
56 Let's for example try to install the hello dolly plugin from wordpress.org:
59 wp plugin install hello-dolly
65 Installing Hello Dolly (1.5)
67 Downloading install package from http://downloads.WordPress.org/plugin/hello-dolly.1.5.zip ...
68 Unpacking the package ...
69 Installing the plugin ...
71 Success: The plugin is successfully installed
77 On a multisite installation, you need to pass a --blog parameter, so that WP knows which site it's supposed to be operating on:
80 wp theme status --blog=localhost/wp/test
83 If you have a subdomain installation, it would look like this:
86 wp theme status --blog=test.example.com
89 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:
92 echo 'test.example.com' > wp-cli-blog
95 Then, you can call `wp` without the --blog parameter again:
104 Adding commands to wp-cli is very easy. You can even add them from within your own plugin.
105 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.
107 **Please share the commands you make, issue a pull request to get them included in wp-cli by default.**
114 - added `wp eval` and `wp eval-file`
116 - added `wp core install`
117 - fixed `wp core update`
118 - added `--dev` flag to `wp plugin install`
119 - added `wp plugin uninstall`
120 - fixed `wp plugin install` and `wp plugin update`
125 - improved `wp option`
130 - added multisite support
131 - improved `wp plugin` and `wp theme`
132 - added `wp generate`
133 - added `wp core version`
134 - added `wp --version`
135 - added bash completion script
144 - [Contributor list](https://github.com/wp-cli/wp-cli/contributors)
145 - [Contributor impact](https://github.com/wp-cli/wp-cli/graphs/impact)