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
Related Posts:
- How to change a post attribute to homepage using WP CLI?
- WP-CLI sudden empty response
- WP Cli will not execute on Windows
- Running custom defined WP-CLI commands without WordPress installation present
- What user should I use for wp-cli on Ubuntu VPS [closed]
- bash script wp-cli search-replace 0 replacements, but command-line 3000+
- How to change the output color of echo in Linux
- Diff command along with Grep gives “Binary file (standard input) matches”
- How to count lines in a document?
- How to recursively download a folder via FTP on Linux
- Delete .DS_STORE files in current folder and all subfolders from command line on Mac
- Detect if WP is running under WP-CLI
- WP CLI “Error establishing a database connection” in localhost (MAMP)
- wp-cli Enabling Maintainance Mode
- How do I run a PHP script from WordPress environment, like `wp shell`?
- Using wp-cli can I not query pages by their title?
- wp-cli displays php notices when display errors off
- wp-cli 0.14.1 MySQL error
- WP-CLI Cannot Connect to Database due to Vagrant
- Changing the WP CLI cache folder
- WP-CLI Process Killed
- How to use wp-cli.yml file?
- wp-cli commands do nothing, return nothing
- WP cli –path does not seem to work
- Enable Auto-updates for all plugins using wp-cli? (since wordpress 5.5)
- How do I clone or duplicate a post with the WordPress Command Line Interface WP-CLI?
- How to use command ‘wp post create’ in wp-cli properly?
- How do I activate an mu-plugin with WP-CLI?
- WP-CLI get all posts from certain post type and taxonomy term
- How to create a WP-CLI command with $_POST?
- wp-cli doesn’t find and wordpress installation
- Does wp post delete also delete metadata associated with posts?
- WP-CLI :: Cannot installing plugin as www-data
- wp-cli import theme sample data
- WP-CLI works on non WP-CLI installed WordPress instance?
- Export list of users with first and lastname in WP-CLI
- WP-CLI – Return posts with matching meta key
- Prompt user for input in WP CLI
- Generate WP-CLI @alias for each site on multisite
- What could cause WP-CLI search-replace to not replace all instances of a string?
- WP-CLI throwing PHP Fatal error: Call to undefined function apply_filters() [closed]
- WPCLI – update plugins, themes, and core, all in one row, instead 3 rows?
- Using Travis CI to run unit tests and running phpunit locally [closed]
- “Could not open input file” error even when WP-CLI is in the path
- Revert WordPress default options after a PHPUnit test has run
- Can I create multiple pages at once using WP-CLI?
- How do I set and list page_template with wpcli?
- WP-CLI update date and time format
- WP-CLI over SSH – wp command not found
- wp-cli create post and media import
- Import Media To CPT with CLI & Filter Custom Taxonomy
- wp-cli with MAMP shows sh: mysql: command not found
- How do I pass an array as an argument to a WP-CLI command?
- What is the difference between the Package Language and the Site Language?
- PHP warning are displaying when using WP CLI [closed]
- WP CLI – show users whose ID is larger than given ID
- How can I replace all regex matches using the WP_CLI search-replace tool
- How do I update a nested option?
- Is it possible to use WP-CLI via PHP-framework?
- Wp-cli-ssh global installation problem [closed]
- WP-CLI with theme: Uncaught Error: Class ‘WP_CLI’ not found
- WPCLI search and replace variants for all tables
- What’s the proper way to setup WP-CLI on Ubuntu so that I don’t have to use the flag –allow-root?
- Can I create (or update) user password with WP-CLI by hash?
- How to disable XML-RPC from Linux command-line in a total way?
- Is there a way to pre-cache plugins with WP-CLI for faster installation?
- Allow download_url for lan addresses
- What tools respect `.distignore`?
- How to prevent WP-CLI shell from exiting when an exception occurs?
- wp-cli silently fails with 255 when running wp core install
- WP-CLI Get Site ID from its url
- WP-CLI alias: connect with ssh proxy
- Execute wp-cli command on all sites on server
- wp-cli: run post generate and post meta add together
- Setting boolean and array values using wp theme mod set
- Ask WP-CLI latest core WordPress version released
- Unable to install plugins from wp-cli
- How can I get the WP-CLI eval-file command to report errors to stderr?
- How to get all posts related to a term with WP-CLI?
- WP CLI: there has been critical error
- In a continuous integration environment how do you implement the database entries for plugins and themes
- How to verify a correct wp-cli installation?
- wp-cli: wp term generate xxxxx – Error: ‘xxxxx’ is not a registered taxonomy
- How can I add an RSS widget using WP-CLI?
- MAMP PRO WP-CLI Error: Error establishing a database connection
- “Class ‘Phar’ not found” error setting up WP-CLI with Cygwin
- Uninstall WP-CLI
- Running WP-CLI without SSH
- WP CLI Shell not working on Windows
- How do you kill WP-CLI execution?
- Is it possible to delete a range of posts by ID with WP-CLI?
- How to specify to wp-cli for the `wp config create` (`wp core config`) command that the DB user is an ‘all hosts’ user?
- Get last published post in WordPress using wp-cli
- Formatting messed up when piping wp commands
- Where do the files of a custom WP CLI Command reside?
- wpcli: Error on post_content or post_title if accents
- wp-cli configuration in php?
- Does WP-CLI support updating multiple options via a single command?
- Lock User and Enforce Password change via wp-cli
- How to use wp db export and import together?