OSDN Git Service

Merge docs branch. see #24
[wvm/wvm.git] / README.md
1 What is wp-cli?
2 --------------
3
4 A set of tools for controlling WordPress installations from the command line.
5
6 Requirements
7 ------------
8
9 * PHP >= 5.3
10 * WP >= 3.3
11
12 Installing
13 ----------
14
15 **Via PEAR:**
16
17 ```sh
18 pear config-set auto_discover 1
19 sudo pear install wp-cli.github.com/pear/wpcli
20 ```
21
22 **Via GIT:**
23
24 ```sh
25 git clone --recurse-submodules git://github.com/wp-cli/wp-cli.git ~/git/wp-cli
26 cd ~/git/wp-cli
27 sudo utils/build-dev
28 ```
29
30 You can replace `~/git/wp-cli` with whatever you want.
31
32
33 Using
34 -----
35
36 Go into a WordPress root folder:
37
38 ```
39 cd /var/www/wp/
40 ```
41
42 Typing `wp help` should show you an output similar to this:
43
44 ```
45 Example usage:
46         wp google-sitemap [build|help] ...
47         wp core [update|help] ...
48         wp home [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] ...
52 ```
53
54 So this tells us which commands are installed: eg. google-sitemap, core, home, ...
55 Between brackets you can see their sub commands. 
56
57 Let's for example try to install the hello dolly plugin from wordpress.org:
58
59 ```
60 wp plugin install hello-dolly
61 ```
62
63 Output:
64
65 ```
66 Installing Hello Dolly (1.5)
67
68 Downloading install package from http://downloads.WordPress.org/plugin/hello-dolly.1.5.zip ...
69 Unpacking the package ...
70 Installing the plugin ...
71
72 Success: The plugin is successfully installed
73 ```
74
75 Multisite
76 ---------
77
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:
79
80 ```
81 wp theme status --blog=localhost/wp/test
82 ```
83
84 If you have a subdomain installation, it would look like this:
85
86 ```
87 wp theme status --blog=test.example.com
88 ```
89
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:
91
92 ```
93 echo 'test.example.com' > wp-cli-blog
94 ```
95
96 Then, you can call `wp` without the --blog parameter again:
97
98 ```
99 wp theme status
100 ```
101
102 Adding commands
103 ---------------
104
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.
107
108 **Please share the commands you make, issue a pull request to get them included in wp-cli by default.**
109
110 Changelog
111 ---------------
112
113 **0.5**
114
115 - added `wp user`
116 - added `wp core download`
117 - added `wp core config`
118 - added `wp plugin update --all`
119 - added `wp theme update`
120 - added `wp db import`
121 - added `--url` `--path` and `--user` global parameters
122 - various bugfixes
123
124 **0.4**
125
126 - added `wp eval` and `wp eval-file`
127 - added `wp export`
128 - added `wp core install`
129 - fixed `wp core update`
130 - added `--dev` flag to `wp plugin install`
131 - added `wp plugin uninstall`
132 - fixed `wp plugin install` and `wp plugin update`
133
134 **0.3**
135
136 - added `wp sql`
137 - improved `wp option`
138 - pear installer
139
140 **0.2**
141
142 - added multisite support
143 - improved `wp plugin` and `wp theme`
144 - added `wp generate`
145 - added `wp core version`
146 - added `wp --version`
147 - added bash completion script
148
149 **0.1**
150
151 - initial release
152
153 Contributors
154 ------------
155
156 - [Contributor list](https://github.com/wp-cli/wp-cli/contributors)
157 - [Contributor guide](https://github.com/wp-cli/wp-cli/wiki/Commands-Cookbook)