playing with wp-cli (wordpress command line interface)
DESCRIPTION
WP-CLI, WordPress Command Line Interface is the newer and faster way to interact with WordPress, and anything related to it. It's fun and easy. This presentation gives a good idea on Wordpress CLI and It's usagesTRANSCRIPT
![Page 1: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/1.jpg)
./WP-CLIhttp://wp-cli.org
![Page 2: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/2.jpg)
CLI? What is it anyways?
![Page 3: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/3.jpg)
Command Line Interface
![Page 4: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/4.jpg)
So, WP-CLI is,
● A way to interact with WordPress using command line.
● Alternatively, a set of command line tools, to interact with WordPress
![Page 5: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/5.jpg)
Requirements
● *nix environment (Linux, Mac OSX, BSD)● Windows user? Use Cygwin● PHP 5.3.2+ (with php cli)● WordPress 3.4+
![Page 6: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/6.jpg)
Installation#download from server
>curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
#make executable
>chmod +x wp-cli.phar
#move inside search path, now has alias “wp”
>sudo mv wp-cli.phar /usr/local/bin/wp
![Page 7: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/7.jpg)
Access it from command line
wp --info
PHP binary: /usr/bin/php5PHP version: 5.5.3-1ubuntu2.6php.ini used: /etc/php5/cli/php.iniWP-CLI root dir: phar://wp-cli.pharWP-CLI global config:WP-CLI project config:WP-CLI version: 0.15.1
Good news! If you get something like this :
![Page 8: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/8.jpg)
So, What can it do for me?
● Almost anything● Sorry, It can't make you coffee ( - ryanduff)
![Page 9: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/9.jpg)
What's the point then?
![Page 10: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/10.jpg)
The main point is:
![Page 11: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/11.jpg)
![Page 12: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/12.jpg)
New Installation
wp core download
it just downloads WordPress.
For installation, read the documentation
![Page 13: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/13.jpg)
Documentation at
http://wp-cli.org/commands/
![Page 14: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/14.jpg)
Search and replace
wp search-replace "WordPress" "Awesome WordPress" wp_posts
![Page 15: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/15.jpg)
Export and import
#export
wp export --dir=backup
#import
wp import backup/hello.wordpress.2014-07-17.0.xml --authors=create
![Page 16: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/16.jpg)
Installing and activating plugins
wp plugin install wp-user-frontend --activate
![Page 17: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/17.jpg)
Other thing with plugins
● Listing● Searching● Deleting● Activate/Deactivate/Toggle
● update
![Page 18: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/18.jpg)
Themes
● Yes!
![Page 19: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/19.jpg)
And some other features
● User management● Comments● Media● Options● …......
![Page 20: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/20.jpg)
Multi Site?
Yes.
![Page 21: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/21.jpg)
Extending?
![Page 22: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/22.jpg)
Yeah sure!
https://github.com/wp-cli/wp-cli/wiki/Commands-Cookbook
![Page 23: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/23.jpg)
![Page 24: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/24.jpg)
Questions?
![Page 25: Playing with WP-CLI (WordPress Command Line Interface)](https://reader034.vdocuments.net/reader034/viewer/2022052310/53fdb4f38d7f72a81c8b4a8d/html5/thumbnails/25.jpg)
A bit about myself
Anam Ahmedhttp://anam.co
fb.me/theanam
@mranam