Shortest way to install WP-CLI

Downloading the Phar file is the recommended installation method for most users. As you showed, it’s basically just one line. It can’t really get shorter than that. And the steps make sense: download the file, make it executable and move it to the right location.

There are alternative ways to install WP-CLI though. For example, if you’re using Composer, and have something like ~/.composer/vendor/bin in your PATH (or C:\Users\you\AppData\Roaming\Composer\vendor\bin on Windows), you can just run:

composer global require wp-cli/wp-cli

To update everything globally, run composer global update.

Alternatively, on Debian or Ubuntu you can just download and open one of the .deb packages: https://github.com/wp-cli/builds/tree/gh-pages/deb

On macOS you can install WP-CLI via Homebrew: brew install homebrew/php/wp-cli