forked from wp-cli/wp-cli.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
237 lines (171 loc) · 6.35 KB
/
index.html
File metadata and controls
237 lines (171 loc) · 6.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
---
layout: default
title: Command line interface for WordPress
---
**wp-cli** is a set of command-line tools for managing [WordPress](http://wordpress.org) installations. You can update plugins, set up multisite installs, create posts and much more.
Requirements
============
* PHP >= 5.3
* WordPress >= 3.3
Installing
==========
**Via PEAR:**
<pre>
sudo pear channel-discover wp-cli.org/pear
sudo pear install wpcli/wpcli
</pre>
**Via GIT:**
<pre>
git clone --recursive git://github.com/wp-cli/wp-cli.git ~/git/wp-cli
cd ~/git/wp-cli
sudo utils/dev-build
</pre>
You can replace `~/git/wp-cli` with whatever you want.
MAMP, XAMP, etc.
-----------
If the `php` command is not available, you can try finding an appropriate binary:
<pre>
./utils/find-php
</pre>
Then, create an environment variable called `WP_CLI_PHP` with the path found by `find-php`.
In a UNIX environment, you would do this by adding the following line to your `.bashrc` file:
<pre>
WP_CLI_PHP=/path/to/php-binary
</pre>
Using
=====
Go into a WordPress root folder:
<pre>
cd /var/www/wp/
</pre>
Typing `wp` should show you output similar to this:
<pre>
Available commands:
wp blog create|delete
wp cache add|decr|delete|flush|get|incr|replace|set|type
wp comment create|delete|trash|untrash|spam|unspam|approve|unapprove|count|status|last
wp core download|config|is-installed|install|install-network|version|update|update-db
wp db create|drop|reset|optimize|repair|connect|cli|query|export|import
wp eval-file
...
See 'wp help <command>' for more information on a specific command.
</pre>
Let's try to install the Hello Dolly plugin from wordpress.org:
<pre>
wp plugin install hello-dolly
</pre>
Output:
<pre>
Installing Hello Dolly (1.5)
Downloading install package from http://downloads.WordPress.org/plugin/hello-dolly.1.5.zip ...
Unpacking the package ...
Installing the plugin ...
Plugin installed successfully.
</pre>
Multisite
---------
On a multisite installation, you need to pass a `--url` parameter, so that wp-cli knows which site it's supposed to be operating on:
<pre>
wp theme status --url=localhost/wp/test
</pre>
If you have a subdomain installation, it would look like this:
<pre>
wp theme status --url=test.example.com
</pre>
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:
<pre>
echo 'test.example.com' > wp-cli-blog
</pre>
Then, you can call `wp` without the `--url` parameter again:
<pre>
wp theme status
</pre>
Adding commands
===============
Adding commands to wp-cli is very easy. You can even add them from within your own plugin.
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.
**Please share the commands you make, issue a pull request to get them included in wp-cli by default.**
Changelog
=========
### [0.7](https://github.com/wp-cli/wp-cli/issues?milestone=5&state=closed)
Commands:
- added [wp shell](/blog/wp-shell.html)
- added `wp cache`, props [tollmanz](http://github.com/tollmanz)
- added `wp comment`, props [ozh](http://github.com/ozh)
- added `wp rewrite`, props [goldenapples](http://github.com/goldenapples)
- added `wp user import-csv`, props [danielbachhuber](http://github.com/danielbachhuber)
- added `wp user set-role` and `wp user remove-role`, props danielbachhuber
- added `wp core is-installed`
- added `wp blog delete`
- added `wp post list`
- made `wp post delete` accept a list of IDs
- added `--dry-run` option `wp plugin update-all`
- improved `wp export`, props danielbachhuber
Breaking changes:
- converted `wp plugin update --all` to `wp plugin update-all`
- converted `wp theme update --all` to `wp theme update-all`
- converted `wp generate posts` to `wp post generate`
- converted `wp generate users` to `wp user generate`
- renamed `wp core install_network` to `wp core install-network`
- renamed `--path` option to `--dir` in `wp export`
Internals:
- removed support for default subcommands
- introduced `@synopsis` docblock tag
- introduced `@subcommand` docblock tag
- introduced `@alias` docblock tag
- introduced `WP_CLI::add_man_dir()`
### [0.6](https://github.com/wp-cli/wp-cli/issues?milestone=4&state=closed)
Commands:
- added `wp post` and `wp post-meta`
- added `wp user-meta`, props [mwilliamson-red-gate](http://github.com/mwilliamson-red-gate)
- added `wp blog create`, props [kidfiction](http://github.com/kidfiction)
- added `wp export`, props [tott](http://github.com/tott)
- added `wp theme install` and `wp theme update`, props [getsource](http://github.com/getsource)
- added `wp transient`, props [tollmanz](http://github.com/tollmanz)
- added `wp db optimize` and `wp db repair`, props getsource
- added `wp db create`, `wp db drop` and `wp db reset`
- added `wp db import`, props [svaj](http://github.com/svaj)
- added `wp core install_network`
- added `wp core update_db`, props mwilliamson-red-gate
- added `--json` option to several subcommands
- added `--network` option to `wp plugin activate`
- fixed `wp plugin update`
Internals:
- added `--require` global parameter
- fixed "out of memory" error
- misc bugfixes and optimizations
- man pages (not in PEAR package)
### [0.5](https://github.com/wp-cli/wp-cli/issues?milestone=3&state=closed)
Commands:
- added `wp user`, props [wopr42](http://github.com/wopr42)
- added `wp core download`, props [ericandrewlewis](http://github.com/ericandrewlewis)
- added `wp core config`
- added `wp plugin update --all`, props [getsource](http://github.com/getsource)
Internals:
- added `--url` `--path` and `--user` global parameters
- various bugfixes
### [0.4](https://github.com/wp-cli/wp-cli/issues?milestone=2&state=closed)
- added `wp eval` and `wp eval-file`
- added `wp export`
- added `wp core install`
- fixed `wp core update`
- added `--dev` flag to `wp plugin install`
- added `wp plugin uninstall`
- fixed `wp plugin install` and `wp plugin update`
### 0.3
- added `wp sql`
- improved `wp option`
- pear installer
### 0.2
- added multisite support
- improved `wp plugin` and `wp theme`
- added `wp generate`
- added `wp core version`
- added `wp --version`
- added bash completion script
### 0.1
- initial release
Contributors
------------
- [Contributor list](https://github.com/wp-cli/wp-cli/contributors)
- [Contributor guide](https://github.com/wp-cli/wp-cli/wiki/Commands-Cookbook)