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

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

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.