ExtendingYour
WordPress Toolbelt
with WP-CLI	

WordCamp Austin 2014	

Ryan Duff
# whoami
• WordPress Developer	

• Open Source Contributor	

• Sysadmin (sort of)
What is WP-CLI?
WP-CLI is a set of command-line tools
for managing WordPress installations.
WP-CLI is a set of command-line tools
for managing WordPress installations.
So Let’s Get Started
Requirements
• UNIX-like environment (OS X, Linux,
FreeBSD, Cygwin)	

• PHP 5.3.2 or later	

• WordPress 3.5.2 or later	

!
• Basic kno...
What Does It Do?
What Does It Do?
Everything... almost	

!
!
!
!
!
What Does It Do?
Everything... almost	

!
!
!
!
Sorry… it won’t make you coffee.
Top Level Commands
Download, Configure,
Install
wp core download!
!
!
!
wp core config !
! --dbname=wcatx !
! --dbuser=wcatx !
! --dbpass=wcatx!
!
wp core install !
! --url=“http://wcatx.dev” !
...
wp option update timezone_string “America/
New_York"!
!
wp rewrite structure ‘/%year%/%monthnum%/
%postname%/‘ --hard
Install and Manage
Plugins
Install and Manage
Themes
Import / Export
wp import!
!
wp export
Managing the Database
wp db export!
wp db import!
!
!
wp db cli!
!
!
wp site empty
Search and Replace
wp search-replace!
!
wp search-replace “oldsite.dev” “newsite.com”!
!
!
--network!
--dry-run
Posts
Comments
Media
wp media regenerate --yes
Users	

Roles	

Capabilities
Multisite	

Rewrites	

Options
Terms	

Menus	

Sidebars	

Widgets
Plugin or Theme
developer?
English please?
Community Commands
Community Commands
http://wp-cli.org/package-index/
Dictator
Dictator
Your Own Commands
WP-CLI API
https://github.com/wp-cli/wp-cli/wiki/API
How to Install
The Quick Lazy 	

Easy Way™
# mkdir -p ~/.wp-cli/bin !
!
# cd ~/.wp-cli!
!
# curl -L https://raw.github.com/wp-cli/
builds/gh-pages/phar/wp-cli.phar >...
Almost ready…
Add to ~/.bash_profile, .zshrc, etc	

!
# add to $PATH	

export PATH=$HOME/.wp-cli/bin:$PATH	

!
# autocomple...
Using ZSH?
# autocomplete	

autoload bashcompinit	

bashcompinit	

source $HOME/.wp-cli/wp-completion.bash
MAMP or other
custom PHP
export PATH=/Applications/MAMP/bin/php/
php5.4.10/bin:$PATH
Installing the 	

Better Way™
(so you can contribute,
of course)
# git clone git@github.com:ryanduff/wp-
cli.git ~/.wp-cli!
!
# cd wp-cli!
!
# git remote add upstream git@github.com:wp-
c...
Almost ready…
Add to ~/.bash_profile, .zshrc, etc	

!
# add to $PATH	

export PATH=$HOME/.wp-cli/wp-cli/bin:$PATH	

!
# aut...
More Info
Web: http://wp-cli.org/	

!
Core Commands: http://wp-cli.org/
commands/	

!
Cookbook: https://github.com/wp-cli/...
Contributing
https://github.com/wp-cli/wp-cli/blob/master/
CONTRIBUTING.md	

!
https://help.github.com/articles/fork-a-repo
Questions?
Ryan Duff	

!
!
email: ryan@fusionized.com	

!
web: http://fusionized.com	

!
twitter: @ryancduff	

!
github: https://gith...
Extending your WordPress Toolbelt with WP-CLI - WordCamp Austin 2014
Extending your WordPress Toolbelt with WP-CLI - WordCamp Austin 2014
Extending your WordPress Toolbelt with WP-CLI - WordCamp Austin 2014
Extending your WordPress Toolbelt with WP-CLI - WordCamp Austin 2014
Extending your WordPress Toolbelt with WP-CLI - WordCamp Austin 2014
Extending your WordPress Toolbelt with WP-CLI - WordCamp Austin 2014
Extending your WordPress Toolbelt with WP-CLI - WordCamp Austin 2014
Extending your WordPress Toolbelt with WP-CLI - WordCamp Austin 2014
Extending your WordPress Toolbelt with WP-CLI - WordCamp Austin 2014
Extending your WordPress Toolbelt with WP-CLI - WordCamp Austin 2014
Extending your WordPress Toolbelt with WP-CLI - WordCamp Austin 2014
Upcoming SlideShare
Loading in...5
×

Extending your WordPress Toolbelt with WP-CLI - WordCamp Austin 2014

717

Published on

Extending your WordPress Toolbelt with WP-CLI presentation from WordCamp Austin 2014. March 27, 2014.

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
717
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
4
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Extending your WordPress Toolbelt with WP-CLI - WordCamp Austin 2014"

  1. 1. ExtendingYour WordPress Toolbelt with WP-CLI WordCamp Austin 2014 Ryan Duff
  2. 2. # whoami • WordPress Developer • Open Source Contributor • Sysadmin (sort of)
  3. 3. What is WP-CLI?
  4. 4. WP-CLI is a set of command-line tools for managing WordPress installations.
  5. 5. WP-CLI is a set of command-line tools for managing WordPress installations.
  6. 6. So Let’s Get Started
  7. 7. Requirements
  8. 8. • UNIX-like environment (OS X, Linux, FreeBSD, Cygwin) • PHP 5.3.2 or later • WordPress 3.5.2 or later ! • Basic knowledge of the command line
  9. 9. What Does It Do?
  10. 10. What Does It Do? Everything... almost ! ! ! ! !
  11. 11. What Does It Do? Everything... almost ! ! ! ! Sorry… it won’t make you coffee.
  12. 12. Top Level Commands
  13. 13. Download, Configure, Install
  14. 14. wp core download! ! ! !
  15. 15. wp core config ! ! --dbname=wcatx ! ! --dbuser=wcatx ! ! --dbpass=wcatx! ! wp core install ! ! --url=“http://wcatx.dev” ! ! --title="Site Name" ! ! --admin_user=notadmin ! ! --admin_password=somethingstrong ! ! --admin_email="user@site.com"
  16. 16. wp option update timezone_string “America/ New_York"! ! wp rewrite structure ‘/%year%/%monthnum%/ %postname%/‘ --hard
  17. 17. Install and Manage Plugins
  18. 18. Install and Manage Themes
  19. 19. Import / Export wp import! ! wp export
  20. 20. Managing the Database wp db export! wp db import! ! ! wp db cli! ! ! wp site empty
  21. 21. Search and Replace wp search-replace! ! wp search-replace “oldsite.dev” “newsite.com”! ! ! --network! --dry-run
  22. 22. Posts
  23. 23. Comments
  24. 24. Media wp media regenerate --yes
  25. 25. Users Roles Capabilities
  26. 26. Multisite Rewrites Options
  27. 27. Terms Menus Sidebars Widgets
  28. 28. Plugin or Theme developer?
  29. 29. English please?
  30. 30. Community Commands
  31. 31. Community Commands http://wp-cli.org/package-index/
  32. 32. Dictator
  33. 33. Dictator
  34. 34. Your Own Commands
  35. 35. WP-CLI API https://github.com/wp-cli/wp-cli/wiki/API
  36. 36. How to Install
  37. 37. The Quick Lazy Easy Way™
  38. 38. # mkdir -p ~/.wp-cli/bin ! ! # cd ~/.wp-cli! ! # curl -L https://raw.github.com/wp-cli/ builds/gh-pages/phar/wp-cli.phar > bin/wp! ! # chmod +x bin/wp! ! ! # curl -LO https://github.com/wp-cli/wp-cli/ raw/master/utils/wp-completion.bash
  39. 39. Almost ready… Add to ~/.bash_profile, .zshrc, etc ! # add to $PATH export PATH=$HOME/.wp-cli/bin:$PATH ! # autocomplete source $HOME/.wp-cli/wp-completion.bash
  40. 40. Using ZSH? # autocomplete autoload bashcompinit bashcompinit source $HOME/.wp-cli/wp-completion.bash
  41. 41. MAMP or other custom PHP export PATH=/Applications/MAMP/bin/php/ php5.4.10/bin:$PATH
  42. 42. Installing the Better Way™
  43. 43. (so you can contribute, of course)
  44. 44. # git clone git@github.com:ryanduff/wp- cli.git ~/.wp-cli! ! # cd wp-cli! ! # git remote add upstream git@github.com:wp- cli/wp-cli.git! ! # composer install
  45. 45. Almost ready… Add to ~/.bash_profile, .zshrc, etc ! # add to $PATH export PATH=$HOME/.wp-cli/wp-cli/bin:$PATH ! # autocomplete source $HOME/.wp-cli/wp-cli/utils/wp-completion.bash
  46. 46. More Info Web: http://wp-cli.org/ ! Core Commands: http://wp-cli.org/ commands/ ! Cookbook: https://github.com/wp-cli/wp- cli/wiki/Commands-Cookbook ! Github: https://github.com/wp-cli/wp-cli
  47. 47. Contributing https://github.com/wp-cli/wp-cli/blob/master/ CONTRIBUTING.md ! https://help.github.com/articles/fork-a-repo
  48. 48. Questions?
  49. 49. Ryan Duff ! ! email: ryan@fusionized.com ! web: http://fusionized.com ! twitter: @ryancduff ! github: https://github.com/ryanduff
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×