This is huge! 5 years of effort, so many contributors and such an awesome tool for devs!
Woohoo! Over the course of 5+ years, hundreds of contributors have worked to bring you WP-CLI v1.0.0, which I’m proud to announce today.
This release represents a level of maturity few open source projects achieve. It also marks a moment of transition. The WP-CLI project will shift its focus to the WP-CLI package ecosystem, where it will enable innovation by building and encouraging new features as standalone packages. We hope this approach will promote faster iteration and more creativity, and more sustainably distribute the maintenance burden. As these community packages find success, we’ll bring their learnings back into WP-CLI, alongside bug fixes and minor enhancements.
Now that the issue backlog is down to zero, I’m personally looking forward to getting more ideas cooking for runcommand, my own WP-CLI innovation studio.
Headed to Philly this week? I’ll be at Post Status Publish and WCUS (although only until mid-afternoon Friday). Say hello - I’m @danielbachhuber on Twitter.
On with the show…
WP_CLI::runcommand() (doc) is the new best way to run WP-CLI commands from within your WP-CLI command. It’s as though
The long term sustainability of WP-CLI is being considered and non-coder help is requested.
As you might be aware, WP-CLI is an indispensable tool for many individuals and companies. We very much appreciate our community of users (although we have no idea how many of you there actually are), and want to ensure our relationship is strong for the years to come. Just over a month ago, I started a Github issue with this question:
how do I reduce WP-CLI’s bus factor, and more generally lay a foundation for WP-CLI’s long-term organizational stability?
Although things seem to be going reasonably well now, I want to make sure we’re taking steps towards ensuring the long-term continuity of the project. Today, Andreas (WP-CLI’s founder) and I sat down for breakfast to discuss our options and how we want to proceed.
Based on our conversation, we think the most important task is to reduce WP-CLI’s bus factor and onboard one or more additional maintainers to focus on a few non-code roles:
Documentation - Help ensure WP-CLI’s documentation is world-class.
Marketing / community management - Help spread the word about WP-CLI.
Support - Help WP-CLI users where they’re asking questions, let it be Github, WordPress.org, Stack Exchange, or elsewhere.
Kickstarter funds for Dan have run out, so should be interesting to see what happens after this. Nice new features though.
Last November, I published a Kickstarter, and was completely blown away by the support. This month, the funding ran out, so I thought I’d post one last RESTful WP-CLI update. Actually, the story doesn’t end here. I’m writing a massive retrospective post about using Kickstarter to fund open source, so keep an eye out for that. Also, WP-CLI v0.24.0 is due out a week from now, July 27th, and it’s looking to be the largest release ever. When you do a Kickstarter, it’s really just the beginning of something bigger.
Enough with the superlatives, let’s dive into some new features. Remember: RESTful WP-CLI features require under the hood changes to WP-CLI. You’ll want to wp cli update --nightly to play with this new functionality locally. Once you’ve done so, you can wp package install wp-cli/restful to install the latest.
Effortlessly use WP-CLI against any WordPress install
WP-CLI aliases are shortcuts you register in your wp-cli.yml or config.yml to effortlessly run commands against any WordPress install.
For instance, if I’m working locally on the runcommand theme, have registered a new rewrite rule, and need to flush rewrites inside
Lots of new features in WP CLI. Especially the search and replace feature with regex.
Even though WP-CLI is a mature project, we still manage to pack a great set of improvements into each release. Here’s what’s coming to you in v0.20.0. Regex, verbose search-replace
Use the --regex flag to wp search-replace to… wait for it… use regex in your search and replace operations. And, with the --verbose flag, you’ll see each column with affected rows as the operation is performed:
$ wp post get 1 --field=title
$ wp search-replace '(Hello)\s(world)' '$2, $1' --regex --verbose
0 rows affected
1 rows affected
0 rows affected
$ wp post get 1 --field=title
Note: search-replace with --regex is 15-20x slower than without. Make sure you plan for the performance hit in your migration plans, and use wisely.
Major bug fix: cached partial upgrade files masquerading as full upgrades
Since v0.17.0 (pull request), WP-CLI mistakenly cached partial archives in a lossy manner. More specifically, a ZIP file for a partial upgrade would be cached with the same key as a ZIP file for a full upgrade. With the file incorrectly cached, subsequent full upgrades would use the cached