From 29f7e17b9a261aaa2e5a01fac8d3ea75ef6fdb92 Mon Sep 17 00:00:00 2001 From: Muneeb Ashraf <58017595+muneeb-ashraf@users.noreply.github.com> Date: Thu, 8 Oct 2026 13:12:46 +0500 Subject: [PATCH] Document how `wp package install` resolves a package name The docs still described names as coming from WP-CLI's package index, which is deprecated. Explain the lookup order the command uses (package index, Packagist, GitHub, GitLab) and the GITHUB_TOKEN and GITLAB_TOKEN variables it reads for the GitHub and GitLab checks. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01W6LxjEQnP4PPgXXvAM3M2F --- README.md | 8 +++++++- src/Package_Command.php | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 413047c5..5f70a36f 100644 --- a/README.md +++ b/README.md @@ -200,11 +200,17 @@ wp package install [--insecure] [--interaction] Packages are required to be a valid Composer package, and can be specified as: -* Package name from WP-CLI's package index. +* Package name, such as `wp-cli/server-command`. * Git URL accessible by the current shell user. * Path to a directory on the local machine. * Local or remote .zip file. +A package name is looked up in WP-CLI's package index, which is deprecated, +and then on Packagist. If neither has it, WP-CLI tries +`https://github.com/.git` and then +`https://gitlab.com/.git`. Set the `GITHUB_TOKEN` or +`GITLAB_TOKEN` environment variable to avoid rate limiting on that check. + Packages are installed to `~/.wp-cli/packages/` by default. Use the `WP_CLI_PACKAGES_DIR` environment variable to provide a custom path. diff --git a/src/Package_Command.php b/src/Package_Command.php index 41c2fd62..d4642647 100644 --- a/src/Package_Command.php +++ b/src/Package_Command.php @@ -169,11 +169,17 @@ public function browse( $_, $assoc_args ) { * Packages are required to be a valid Composer package, and can be * specified as: * - * * Package name from WP-CLI's package index. + * * Package name, such as `wp-cli/server-command`. * * Git URL accessible by the current shell user. * * Path to a directory on the local machine. * * Local or remote .zip file. * + * A package name is looked up in WP-CLI's package index, which is deprecated, + * and then on Packagist. If neither has it, WP-CLI tries + * `https://github.com/.git` and then + * `https://gitlab.com/.git`. Set the `GITHUB_TOKEN` or + * `GITLAB_TOKEN` environment variable to avoid rate limiting on that check. + * * Packages are installed to `~/.wp-cli/packages/` by default. Use the * `WP_CLI_PACKAGES_DIR` environment variable to provide a custom path. *