Globally Installing WP-CLI for Access Across Your System

When working on WordPress-based projects that utilize Composer, there are times that we’re going to want to have certain dependencies available for our project and there are times where we’re going to want to have tools available throughout our system. For example, for some projects, we may want to have PHP CodeSniffer with the WordPress Coding Standards available. For others, maybe not.
But having a tool like WP-CLI is something that’s likely better served when it’s available throughout the entire system rather than on a project-by-project basis. Globally installing WP-CLI is a relatively trivial matter.
It does, though, assume you have Composer already installed and available on your system.
Globally Installing WP-CLI
There are only three steps required to make this happen:
Define WP-CLI in Composer’s configuration,
Install the utility,
Make sure Composer’s vendor directory is in your .bash_profile (or the variables of whatever shell you want to use).
To update, add WP-CLI to Composer’s configuration, you can do this via command line by entering:
$ composer global require wp-cli/wp-cli
Or you can manually add it to the composer.json file by



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s