Download the PHP package leymannx/wp-cli-launcher without Composer
On this page you can find all versions of the php package leymannx/wp-cli-launcher. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download leymannx/wp-cli-launcher
More information about leymannx/wp-cli-launcher
Files in leymannx/wp-cli-launcher
Package wp-cli-launcher
Short Description Provides a WP-CLI executable for your global PATH
License GPL-2.0-or-later
Informations about the package wp-cli-launcher
WP-CLI Launcher
A small wrapper around WP-CLI for your global $PATH.
Why?
In order to avoid dependency issues, it is best to require WP-CLI on a per-project basis via Composer (composer require wp-cli/wp-cli
). This makes WP-CLI available to your project by placing it at vendor/bin/wp
.
However, it is inconvenient to type vendor/bin/wp
in order to execute WP-CLI commands. By installing the WP-CLI Launcher globally on your local machine, you can simply type wp
on the command line, and the launcher will find and execute the project specific version of WP-CLI located in your project's vendor
directory.
Installation - Phar
-
Download latest stable release via CLI (code below) or browse to https://github.com/leymannx/wp-cli-launcher/releases/latest.
OSX:
Linux:
-
Make downloaded file executable:
-
Move wp-cli.phar to a location listed in your
$PATH
, rename towp
: - Windows users: create a wp-cli.bat file in the same folder as wp-cli.phar with the following lines. This gets around the problem where Windows does not know that .phar files are associated with
php
:
Update
The WP-CLI Launcher Phar is able to self update to the latest release.
Alternatives
If you only have one codebase on your system (typical with VMs, Docker, etc,), you should add /path/to/vendor/bin
to your $PATH.
Fallback
When a site-local WP-CLI is not found, this launcher usually throws a helpful error. You may avoid the error and instead hand off execution to a global WP-CLI (any version) by doing either of:
- Export an environment variable:
export WP_CLI_LAUNCHER_FALLBACK=/path/to/wp
- Specify an option:
--fallback=/path/to/wp
Xdebug compatibility
WP-CLI Launcher, like Composer automatically disables Xdebug by default. This improves performance substantially. You may override this feature by setting an environment variable. WP_CLI_ALLOW_XDEBUG=1 wp [command]
License
GPL-2.0+