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 count lines in a document?
- WP CLI “Error establishing a database connection” in localhost (MAMP)
- 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 0.14.1 MySQL error
- Changing the WP CLI cache folder
- How to use wp-cli.yml file?
- WP cli –path does not seem to work
- Enable Auto-updates for all plugins using wp-cli? (since wordpress 5.5)
- 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?
- Does wp post delete also delete metadata associated with posts?
- WP-CLI works on non WP-CLI installed WordPress instance?
- WP-CLI – Return posts with matching meta key
- Prompt user for input in WP CLI
- Generate WP-CLI @alias for each site on multisite
- 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?
- “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 – show users whose ID is larger than given ID
- How can I replace all regex matches using the WP_CLI search-replace tool
- Wp-cli-ssh global installation problem [closed]
- 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?
- Is there a way to pre-cache plugins with WP-CLI for faster installation?
- Allow download_url for lan addresses
- wp-cli silently fails with 255 when running wp core install
- Execute wp-cli command on all sites on server
- wp-cli: run post generate and post meta add together
- Unable to install plugins from wp-cli
- How can I get the WP-CLI eval-file command to report errors to stderr?
- 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 Shell not working on Windows
- How do you kill WP-CLI execution?
- How to specify to wp-cli for the `wp config create` (`wp core config`) command that the DB user is an ‘all hosts’ user?
- Does WP-CLI support updating multiple options via a single command?
- How to use wp db export and import together?
- WP CLI not finding plugin commands
- WP CLI not outputting anything
- WP-CLI search-replace posts content for certain URLs
- How to retrieve text only from a post using WP CLI?
- wp search-replace (not executing)
- Bulk remove custom post type and its attachments with wp-cli?
- Specify custom php.ini to use with WP-CLI
- WP-CLI can not find Url
- Wrong output order when mixing WP_CLI::API and php-cli-tools
- Is resetting post data necessary with custom WP_CLI commands?
- WP-CLI not working from Bash script
- MySQL 5.6 Causes Errors with WP CLI
- Using WP-CLI, how do I delete a post by title or slug, not ID?
- Do all WordPress installations include WP CLI by default
- How can I list all installed plugins/themes/versions from CLI/API?
- Why doesn’t ‘wp’ command work in my WP-CLI installation?
- A shorter way to automatically update WordPress?
- wp-cli for Creating page-template
- WP-CLI unable to recongnise PHP server / environment variables on Ubuntu
- How to move back a command in WP-CLI from wp shell?
- wp_clear_object_cache() is deprecated. What should I use instead?
- How best to keep my localhost on Http while my Remote production is on Https
- Can’t Connect to MySQL Database using WP CLI and MAMP on a macOS Catalina, using Oh My Zsh
- What is the purpose of the “user” global parameter in wp-cli.yml config?
- PHPUnit via WP-CLI: Warning: Cannot modify header information … bootstrap.php:68
- PHP Parse error on WP-CLI, not on web server
- Trying to install/configure wp-cli for WordPress
- Using the WP CLI to output the HTML results of calling a post?
- Working with CLI and missing my namespace classes inside
- Logs for WP CLI
- WP-Cli Autoloads Non-existant Framework
- Give WP-Cli User Home Directory Privileges
- WP CLI: critical error on your website
- How to remove all plugins, posts, pages, and inactive themes in one line with wp-cli? WordPress bloatware removal
- WP-CLI plugin activate – ‘activate’ is not a registered subcommand of ‘plugin’
- Creating a subcommand for custom wp-cli command
- Is WP-CLI safe to use in a hosting environment? Why?
- How come there is no error if I upgrade WordPress core after locking .htaccess permissions to 644?
- WP-CLI – How to install a plugin from a remote server
- How to fix “Not enough memory” on Windows 7 and PHP 7.2.0 (cli)
- Is it possible to use WP CLI to update a theme that is not in the WordPress Repo?
- Can I use WP-CLI from a remote computer?
- Why can’t the WP-CLI installer find my php.ini?
- wp-cli output ‘column display format’ / wrapping
- When might you need to specify the “url” argument/option in WP-CLI?
- WP-CLi Uable to Install / Update Plugins
- wp-cli incorrectly believes a plugin is currently installed
- Using wp-cli on remote with quoted commands
- Post Count for Multisite?