Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 7 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,15 @@ A command line tool to do maintenance work on a WordPress install from the comma
Installing
----------

Installing wp-cli is extremely simple:

1. Place the `wp-cli` folder in your WordPress root (on the same level as `wp-admin` and `wp-content`).
1. That's it!

Commands
--------

- `wp core` - Update the WordPress core
- `wp home` - Open the wp-cli project on Github
- `wp option ...` - Manipulate the WordPress options
- `wp plugin ...` - Do cool things with the installed plugins
- `wp theme ...` - Get details on the installed and current theme
1. Clone the project: `git clone https://github.com/andreascreten/wp-cli.git`
1. Make a symlink to the executable: `sudo ln -s /path-to-wp-cli-dir/wp /usr/local/bin/`

Usage
-----

In your terminal, go into the wp-cli folder.
In your terminal, go into the WordPress root folder.

Typing the following command: `./wp help`, will show you an output similar to this:
Typing the following command: `wp help`, will show you an output similar to this:

```
Example usage:
Expand All @@ -43,7 +32,8 @@ Example usage:
So this tells us which commands are installed: eg. google-sitemap, core, home, ...
Between brackets you can see their sub commands.

Let's for example try to install the hello dolly plugin from WordPress: `./wp plugins install hello-dolly`.
Let's for example try to install the hello dolly plugin from wordpress.org: `wp plugin install hello-dolly`.

Output:

```
Expand Down Expand Up @@ -126,7 +116,7 @@ Contributors
------------

- Andreas Creten ([@andreascreten](http://twitter.com/andreascreten))
- Silviu-Cristian Burcă ([@scribu](http://twitter.com/scribu))
- Cristi Burcă ([@scribu](http://twitter.com/scribu))

Requirements
------------
Expand Down
24 changes: 24 additions & 0 deletions class-wp-cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,30 @@ static function generalHelp() {
}
self::line(' ...');
}

self::block( <<<EOB

Built-in commands:
core Update the WordPress core
home Open the wp-cli project on Github
option Manipulate the WordPress options
plugin Do cool things with the installed plugins
theme Do cool things with the installed themes

See 'wp <command> help' for more information on a specific command.
EOB
);
}

/**
* Display multiple lines of content
*
* @param string $content
* @return void
*/
function block( $content ) {
foreach ( explode( "\n", $content ) as $line )
self::line( $line );
}

/**
Expand Down