WP-CLI Process Killed

Which version of WP-CLI are you using? What is wp –version returning you? Seems a little bit that you may be running out of memory as this is quite a large amount of images and there doesn’t seem some proper batch processing implemented in version 1 of WP-CLI. At least, that’s how I’d understand this … Read more

Changing the WP CLI cache folder

You could try to change it through the environment variable: WP_CLI_CACHE_DIR as we have it included in the WP_CLI::get_cache() method (src): $dir = getenv( ‘WP_CLI_CACHE_DIR’ ) ? : “$home/.wp-cli/cache”; You can also check out issue #1848 – Use shared cache directory for multiple installs for usage examples. In the WP-CLI Handbook on make.wordpress.org, we have … Read more

WP-CLI Cannot Connect to Database due to Vagrant

Since the issue is probably DB configuration you could try adjusting it conditionally in wp-config.php: if ( defined( ‘WP_CLI’ ) ) { define( ‘DB_HOST’, ‘example.com’ ); } else { define( ‘DB_HOST’, ‘localhost’ ); }

wp-cli 0.14.1 MySQL error

It seems like Cygwin doesn’t support inline environment variables, like Bash does. Opened a ticket: https://github.com/wp-cli/wp-cli/issues/1086

Using wp-cli can I not query pages by their title?

If we restrict us to the output of wp post list, then here’s a way to search for %test% within the post titles of published posts: wp post list –ignore_sticky_posts=1 –post__in=$(wp db query ‘SELECT ID FROM wp_posts WHERE post_title LIKE “%test%” AND post_status=”publish” AND post_type=”post”‘ –skip-column-names | paste -s -d ‘,’ – ) Here’s the … Read more

wp-cli Enabling Maintainance Mode

WP-CLI now has native commands for it. # Activate Maintenance mode $ wp maintenance-mode activate # Deactivate Maintenance mode $ wp maintenance-mode deactivate See wp-cli/maintenance-mode-command for more information.

Detect if WP is running under WP-CLI

Within the php/wp-cli.php we find these lines: // Can be used by plugins/themes to check if WP-CLI is running or not define( ‘WP_CLI’, true ); define( ‘WP_CLI_VERSION’, trim( file_get_contents( WP_CLI_ROOT . ‘/VERSION’ ) ) ); define( ‘WP_CLI_START_MICROTIME’, microtime( true ) ); so you could check if WP_CLI or WP_CLI_VERSION are defined.