OSDN Git Service

add build-dev script
[wvm/wvm.git] / README.md
1 WP-CLI: WordPress Command Line Tools
2 ============================
3
4 What is wp-cli
5 --------------
6
7 A tool to control WordPress installations from the command line.
8
9 Installing
10 ----------
11
12 **Via PEAR:**
13
14 ```sh
15 pear config-set auto_discover 1
16 sudo pear install andreascreten.github.com/wp-cli/wpcli
17 ```
18
19 **Via GIT:**
20
21 ```sh
22 git clone --recurse-submodules git://github.com/andreascreten/wp-cli.git ~/git/wp-cli
23 cd ~/git/wp-cli
24 sudo utils/build-dev
25 ```
26
27 You can replace `~/git/wp-cli` with whatever you want.
28
29
30 Using
31 -----
32
33 Go into a WordPress root folder:
34
35 ```
36 cd /var/www/wp/
37 ```
38
39 Typing `wp help` should show you an output similar to this:
40
41 ```
42 Example usage:
43         wp google-sitemap [build|help] ...
44         wp core [update|help] ...
45         wp home [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] ...
49 ```
50
51 So this tells us which commands are installed: eg. google-sitemap, core, home, ...
52 Between brackets you can see their sub commands. 
53
54 Let's for example try to install the hello dolly plugin from wordpress.org:
55
56 ```
57 wp plugin install hello-dolly
58 ```
59
60 Output:
61
62 ```
63 Installing Hello Dolly (1.5)
64
65 Downloading install package from http://downloads.WordPress.org/plugin/hello-dolly.1.5.zip ...
66 Unpacking the package ...
67 Installing the plugin ...
68
69 Success: The plugin is successfully installed
70 ```
71
72 Multisite
73 ---------
74
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:
76
77 ```
78 wp theme status --blog=localhost/wp/test
79 ```
80
81 If you have a subdomain installation, it would look like this:
82
83 ```
84 wp theme status --blog=test.example.com
85 ```
86
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:
88
89 ```
90 echo 'test.example.com' > wp-cli-blog
91 ```
92
93 Then, you can call `wp` without the --blog parameter again:
94
95 ```
96 wp theme status
97 ```
98
99 Adding commands
100 ---------------
101
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.
104
105 **Please share the commands you make, issue a pull request to get them included in wp-cli by default.**
106
107 Changelog
108 ---------------
109
110 **0.3**
111
112 - added `wp sql`
113 - improved `wp option`
114 - pear installer
115
116 **0.2**
117
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
124
125 **0.1**
126
127 - initial release
128
129 Contributors
130 ------------
131
132 - [Contributor list](https://github.com/andreascreten/wp-cli/contributors)
133 - [Contributor impact](https://github.com/andreascreten/wp-cli/graphs/impact)