The command line interface for WordPress

This seems to me useful and easy in use. Just in 5 minutes you’ll have this ability.
From GitHub:
WP-CLI is a set of command-line tools for managing WordPress installations. You can update plugins, configure multisite installs and much more, without using a web browser.
From WordPress.org:
WP-CLI is a command line interface for WordPress. The project’s goal is to offer a complete alternative to the WordPress admin; for any action you might want to perform in the WordPress admin, there should be an equivalent WP-CLI command.
Installing:

Once you’ve verified requirements, download the wp-cli.phar file using wget or curl:

$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

Next, check if it is working:

$ php wp-cli.phar --info

To use WP-CLI from the command line by typing wp, make the file executable and move it to somewhere in your PATH. For example:

$ chmod +x wp-cli.phar
$ sudo mv wp-cli.phar /usr/local/bin/wp

If WP-CLI was installed successfully, you should see something like this when you run wp --info:

$ wp --info
PHP binary:    /usr/bin/php5
PHP version:    5.5.9-1ubuntu4.14
php.ini used:   /etc/php5/cli/php.ini
WP-CLI root dir:        /home/wp-cli/.wp-cli
WP-CLI packages dir:    /home/wp-cli/.wp-cli/packages/
WP-CLI global config:   /home/wp-cli/.wp-cli/config.yml
WP-CLI project config:
WP-CLI version: 1.1.0

Download the latest version of WordPress with wp core download (doc).

$ wp core download --path=wpclidemo.dev
Creating directory '/srv/www/wpclidemo.dev/'.
Downloading WordPress 4.6.1 (en_US)...
Using cached file '/home/vagrant/.wp-cli/cache/core/wordpress-4.6.1-en_US.tar.gz'...
Success: WordPress downloaded.

Create a new wp-config.php file with wp core config (doc).

$ cd wpclidemo.dev
$ wp core config --dbname=wpclidemo --dbuser=root
Success: Generated 'wp-config.php' file.

etc …
Wonderful attached song. I’m sad that understand nothing in Spanish. In any case I’m  trying to make my site pleasant for visitors.

2 thoughts on “The command line interface for WordPress”

Leave a Reply

Your email address will not be published. Required fields are marked *