Table of Contents
WP-CLI has many capabilities but like plugins for WordPress, packages can be installed to add functionality to WP-CLI. For instance, you can install the wp-cli/wp-super-cache-cli package to add functions for support of the WP Super Cache plugin. Be sure to check out the official WP-CLI Package Index for more information on the available packages. In this guide, you can learn how to install a package for WP-CLI.
Install a WP-CLI Package
-
SSH into your server as the cPanel user that owns the website you would like to install the plugin on.
-
Use the cd command to switch to the document root directory of your website.
Example: cd public_html/my_website
NOTE: Be sure to replace public_html/my_website with the actual path to the document root directory of your website. -
Run the following command:
wp package install danielbachhuber/wp-cli-stat-command
NOTE: Be sure to replace danielbachhuber/wp-cli-stat-command with the actual package you would like to install. However, the example command will install a useful plugin for reviewing stats/data about your WordPress site.Once the installation completes, you will see the following output:
Congratulations! Now you know how to install a package using WP-CLI.
Learn more about WP-CLI, the command-line interface for WordPress, and how to streamline your WordPress maintenance workflows!