Skip to content

Commit 3f61e33

Browse files
Document how wp package install resolves a package name (#255)
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. Claude-Session: https://claude.ai/code/session_01W6LxjEQnP4PPgXXvAM3M2F Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent b81ca21 commit 3f61e33

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

‎README.md‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,17 @@ wp package install <name|git|path|zip> [--insecure] [--interaction]
200200
Packages are required to be a valid Composer package, and can be
201201
specified as:
202202

203-
* Package name from WP-CLI's package index.
203+
* Package name, such as `wp-cli/server-command`.
204204
* Git URL accessible by the current shell user.
205205
* Path to a directory on the local machine.
206206
* Local or remote .zip file.
207207

208+
A package name is looked up in WP-CLI's package index, which is deprecated,
209+
and then on Packagist. If neither has it, WP-CLI tries
210+
`https://github.com/<package-name>.git` and then
211+
`https://gitlab.com/<package-name>.git`. Set the `GITHUB_TOKEN` or
212+
`GITLAB_TOKEN` environment variable to avoid rate limiting on that check.
213+
208214
Packages are installed to `~/.wp-cli/packages/` by default. Use the
209215
`WP_CLI_PACKAGES_DIR` environment variable to provide a custom path.
210216

‎src/Package_Command.php‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,17 @@ public function browse( $_, $assoc_args ) {
169169
* Packages are required to be a valid Composer package, and can be
170170
* specified as:
171171
*
172-
* * Package name from WP-CLI's package index.
172+
* * Package name, such as `wp-cli/server-command`.
173173
* * Git URL accessible by the current shell user.
174174
* * Path to a directory on the local machine.
175175
* * Local or remote .zip file.
176176
*
177+
* A package name is looked up in WP-CLI's package index, which is deprecated,
178+
* and then on Packagist. If neither has it, WP-CLI tries
179+
* `https://github.com/<package-name>.git` and then
180+
* `https://gitlab.com/<package-name>.git`. Set the `GITHUB_TOKEN` or
181+
* `GITLAB_TOKEN` environment variable to avoid rate limiting on that check.
182+
*
177183
* Packages are installed to `~/.wp-cli/packages/` by default. Use the
178184
* `WP_CLI_PACKAGES_DIR` environment variable to provide a custom path.
179185
*

0 commit comments

Comments
 (0)