Today at WordCamp NYC, I gave a presentation on how you can work with WordPress via a command-line interface (CLI.) This presentation covered how you can can poke and prod WordPress core and API by using WPSH, a custom script built on top of Facebook’s PHPSH.
Also covered were approaches to write command-line scripts for WordPress, using this knowledge to build tools for importing and exporting blog data, as well as some of the higher-level issues involved with processing bulk data.
One question that was offered after the presentation had to do with my familiarity with wp-cli, which I admit, I had none. It appears that the wp-cli utility is useful for atomic operations on the blog, like upgrading core, adding users, &c., whereas wpsh will give you an interactive environment to run any PHP / WordPress API code that your heart desires. I will be sure to give props to wp-cli in my next talk, and discuss how it differs from wpsh, and the advantages of each.
You can obtain the presentation slides at github.