WP-CLI

just another command line tool

 

Jeffry Ghazally

@jghazally 

 

What is WP-CLI ?

WordPress Command Line Interface

Command Line for WP-Admin

 
  • Add Users / Posts / Pages
  • Interact with Database
  • Manage Plugins and Themes

# Create an admin user of johndoe with an email of johndoe@example.com
> wp user create johndoe johndoe@example.com --role=administrator --user_pass=password

# Export the database of the website to the current directory as db.sql
> wp db export ./db.sql

# Import the db.sql to the current WordPress database
> wp db import ./db.sql

# Install Plugin
> wp plugin install hello-dolly

# Activate Plugin
> wp plugin activate hello-dolly

Command Line for Plugins

 
  • WP Super Cache - Enable | Preload | Flush
  • WooCommerce - Orders | Settings | Product

Why WP-CLI ?

  • Less human error
  • Less bootstrapping
  • Ability to manage multiple sites faster  
  • All the cool kids have one. (Ruby on Rails, Laravel, Symfony)

Install, Play and find out more

  • wp-cli.org
  • Dreamhost, Bluehost, WP Engine, SiteGround
  • #cli channel on WordPress Slack
  • Ping me on slack @jghazally