OSDN Git Service

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