The WordPress REST API gets lots of attention, but for many of the same reasons, the WordPress command line interface — WP-CLI — is also worthy of this type of excitement. A REST API and a CLI are essential to modernizing WordPress. Like the REST API, WP-CLI is an alternative way of manipulating data on a WordPress site. Using simple commands you can change a user’s password, bulk import posts, activate a theme, and so much more.
The WP-CLI is a community project that is led by Daniel Bachhuber. It was recently announced that the project would become an official part of the WordPress open source project with financial support to continue its development.
In this article, I will explain why WP-CLI is important. How to install it, show you some examples of how to use it, and give you some resources to learn more.
Not everyone needs or should use WP-CLI. Command line tools are not for everyone. Personally, I use it in my local development environments because it saves time setting things up and to deploy scripts.
Having WP-CLI installed on my servers has saved me more than once. Like when I needed to reset a user password on a site that was having email issues.