Skip to content

Commit b34a928

Browse files
authored
Merge branch 'main' into copilot/add-package-name-argument
2 parents fb1acec + a198bca commit b34a928

5 files changed

Lines changed: 258 additions & 22 deletions

File tree

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ for future authorization requests.
189189
Lists installed WP-CLI packages.
190190

191191
~~~
192-
wp package list [--fields=<fields>] [--format=<format>]
192+
wp package list [--fields=<fields>] [--format=<format>] [--skip-update-check]
193193
~~~
194194

195195
**OPTIONS**
@@ -209,6 +209,9 @@ wp package list [--fields=<fields>] [--format=<format>]
209209
- yaml
210210
---
211211

212+
[--skip-update-check]
213+
Skip checking for updates. This is faster and avoids authentication issues with GitHub or Composer repositories.
214+
212215
**AVAILABLE FIELDS**
213216

214217
These fields will be displayed by default for each package:
@@ -233,6 +236,14 @@ These fields are optionally available:
233236
| wp-cli/server-command | Daniel Bachhuber | dev-main | available | 2.x-dev |
234237
+-----------------------+------------------+----------+-----------+----------------+
235238

239+
# List installed packages without checking for updates.
240+
$ wp package list --skip-update-check
241+
+-----------------------+------------------+----------+--------+----------------+
242+
| name | authors | version | update | update_version |
243+
+-----------------------+------------------+----------+--------+----------------+
244+
| wp-cli/server-command | Daniel Bachhuber | dev-main | none | |
245+
+-----------------------+------------------+----------+--------+----------------+
246+
236247

237248

238249
### wp package update
@@ -286,6 +297,30 @@ wp package uninstall <name> [--insecure]
286297
Removing package directories and regenerating autoloader...
287298
Success: Uninstalled package.
288299

300+
301+
302+
### wp package is-installed
303+
304+
Checks if a given package is installed.
305+
306+
~~~
307+
wp package is-installed <name>
308+
~~~
309+
310+
Returns exit code 0 when installed, 1 when uninstalled.
311+
312+
**OPTIONS**
313+
314+
<name>
315+
The package to check.
316+
317+
**EXAMPLES**
318+
319+
# Check whether "foo/bar" is installed; exit status 0 if installed, otherwise 1
320+
$ wp package is-installed foo/bar
321+
$ echo $?
322+
1
323+
289324
## Installing
290325

291326
This package is included with WP-CLI itself, no additional installation necessary.

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"package install",
4242
"package list",
4343
"package update",
44-
"package uninstall"
44+
"package uninstall",
45+
"package is-installed"
4546
]
4647
},
4748
"autoload": {

0 commit comments

Comments
 (0)