Skip to content
Paul Bunyan Message Logger by Diamond Sierra

Paul Bunyan from the command line (WP-CLI)

The wp pb commands: check status, turn recording on and off, list what to fix first, print the AI report, and log a message from a deploy script.

Updated · By Diamond Sierra

The Fix first screen: problems ranked by cost, each with its PB code and what to do

If your host has WP-CLI, Paul Bunyan adds a wp pb command. It is handy over SSH, in deploy scripts and in cron jobs.

CommandWhat it does
wp pb statusSays whether Paul Bunyan is recording, and why.
wp pb on [--for=<minutes>]Turns recording on, optionally for a set number of minutes.
wp pb offTurns recording off.
wp pb fix [--hours=<hours>]Lists the top 15 things to fix first. Looks back 24 hours by default.
wp pb report [--hours=<hours>]Prints the full AI report, the same text as the AI report screen. Use 1, 24 or 168 hours; 24 is the default.
wp pb log <level> <component> <message>Logs one message, the way the original Paul Bunyan's PBLog.exe did from a batch file.

Examples

Mark the start of a release in the log, so it lines up with the requests around it:

wp pb log info deploy "Beginning release 7.2"

Record for one hour while you test, then let it switch itself off:

wp pb on --for=60

Send yesterday's findings to a file:

wp pb report --hours=24 > paul-bunyan-report.md

wp pb on refuses while PAUL_BUNYAN_OFF is set in wp-config.php. Remove that line first. To mark a deploy for the Compare screen, call paul_bunyan_mark() from your deploy code; see Context, events and markers.