How to Install a WP-CLI Package

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

  1. SSH into your server as the cPanel user that owns the website you would like to install the plugin on.

  2. Use the cd command to switch to the document root directory of your website.

    Example: cd public_html/my_website

  3. Run the following command:

    wp package install danielbachhuber/wp-cli-stat-command

    Once the installation completes, you will see the following output:

    [email protected] [~/public_html/wordpress]# wp package install danielbachhuber/wp-cli-stat-command Installing package danielbachhuber/wp-cli-stat-command (dev-master) Updating /home/exampl3/.wp-cli/packages/composer.json to require the package... Using Composer to install the package... --- Loading composer repositories with package information Updating dependencies Resolving dependencies through SAT Dependency resolution completed in 0.242 seconds Analyzed 5729 packages to resolve dependencies Analyzed 373408 rules to resolve dependencies Package operations: 1 install, 0 updates, 0 removals Installs: danielbachhuber/wp-cli-stat-command:dev-master d308e5b  - Installing danielbachhuber/wp-cli-stat-command (dev-master d308e5b) Writing lock file Generating autoload files --- Success: Package installed.

Congratulations! Now you know how to install a package using WP-CLI.

Learn more about WP-CLI, the command-line interface for WordPress, and streamline your WordPress maintenance workflow!

JB
John-Paul Briones

John-Paul is an Electronics Engineer that spent most of his career in IT. He has been a Technical Writer for InMotion since 2013.

More Articles by John-Paul

Was this article helpful? Let us know!