1 WP-CLI: WordPress Command Line Tools
2 ============================
7 A tool to control WordPress installations from the command line.
15 pear config-set auto_discover 1
16 sudo pear install andreascreten.github.com/wp-cli/wpcli
22 git clone --recurse-submodules git://github.com/andreascreten/wp-cli.git ~/git/wp-cli
27 You can replace `~/git/wp-cli` with whatever you want.
33 Go into a WordPress root folder:
39 Typing `wp help` should show you an output similar to this:
43 wp google-sitemap [build|help] ...
44 wp core [update|help] ...
46 wp option [add|update|delete|get|help] ...
47 wp plugin [status|activate|deactivate|install|delete|update|help] ...
48 wp theme [status|details|activate|help] ...
51 So this tells us which commands are installed: eg. google-sitemap, core, home, ...
52 Between brackets you can see their sub commands.
54 Let's for example try to install the hello dolly plugin from wordpress.org:
57 wp plugin install hello-dolly
63 Installing Hello Dolly (1.5)
65 Downloading install package from http://downloads.WordPress.org/plugin/hello-dolly.1.5.zip ...
66 Unpacking the package ...
67 Installing the plugin ...
69 Success: The plugin is successfully installed
75 On a multisite installation, you need to pass a --blog parameter, so that WP knows which site it's supposed to be operating on:
78 wp theme status --blog=localhost/wp/test
81 If you have a subdomain installation, it would look like this:
84 wp theme status --blog=test.example.com
87 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:
90 echo 'test.example.com' > wp-cli-blog
93 Then, you can call `wp` without the --blog parameter again:
102 Adding commands to wp-cli is very easy. You can even add them from within your own plugin.
103 You can find more information about adding commands in the [Commands Cookbook](https://github.com/andreascreten/wp-cli/wiki/Commands-Cookbook) on our Wiki.
105 **Please share the commands you make, issue a pull request to get them included in wp-cli by default.**
113 - improved `wp option`
118 - added multisite support
119 - improved `wp plugin` and `wp theme`
120 - added `wp generate`
121 - added `wp core version`
122 - added `wp --version`
123 - added bash completion script
132 - [Contributor list](https://github.com/andreascreten/wp-cli/contributors)
133 - [Contributor impact](https://github.com/andreascreten/wp-cli/graphs/impact)