postman-cli 1.62.0 → 1.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/postman.js +19 -0
- package/man/postman.1 +150 -10
- package/package.json +6 -6
package/bin/postman.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
const { constants } = require('os');
|
|
4
|
+
|
|
3
5
|
// Keep this wrapper alive while the native binary handles shutdown gracefully.
|
|
4
6
|
process.on('SIGINT', function () {});
|
|
5
7
|
process.on('SIGTERM', function () {});
|
|
@@ -10,5 +12,22 @@ try {
|
|
|
10
12
|
run(...process.argv.slice(2));
|
|
11
13
|
}
|
|
12
14
|
catch (error) {
|
|
15
|
+
// The CLI's exit codes are a documented contract (`postman init` returns 2 for
|
|
16
|
+
// ambiguous specs and 4 for a refusal, for instance), so the binary's own code has
|
|
17
|
+
// to survive this wrapper. execFileSync throws on any non-zero exit and carries
|
|
18
|
+
// the code as `status`; collapsing that to 1 made a recoverable refusal
|
|
19
|
+
// indistinguishable from a crash.
|
|
20
|
+
if (typeof error.status === 'number') {
|
|
21
|
+
process.exit(error.status);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// A signalled child has no status. Report it the way a shell does.
|
|
25
|
+
if (error.signal) {
|
|
26
|
+
process.exit(128 + (constants.signals[error.signal] || 0));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Spawning the binary failed outright (missing platform package, not executable).
|
|
30
|
+
// The message never reached the user before, leaving a silent exit 1.
|
|
31
|
+
process.stderr.write(`${error.message || error}\n`);
|
|
13
32
|
process.exit(1);
|
|
14
33
|
}
|
package/man/postman.1
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.TH POSTMAN 1 "2026-09-
|
|
1
|
+
.TH POSTMAN 1 "2026-09-23" "v1.63.0" "Postman CLI Manual"
|
|
2
2
|
.SH NAME
|
|
3
3
|
postman \- Command\-line companion utility for Postman
|
|
4
4
|
.SH SYNOPSIS
|
|
@@ -94,7 +94,7 @@ Use the skills bundled with this CLI instead of fetching the latest
|
|
|
94
94
|
Which spec is authoritative, when more than one could be
|
|
95
95
|
.TP
|
|
96
96
|
.B \-\-visibility <status>
|
|
97
|
-
Create and bind a workspace non\-interactively (personal
|
|
97
|
+
Create and bind a workspace non\-interactively (personal, team)
|
|
98
98
|
.TP
|
|
99
99
|
.B \-\-no\-cloud
|
|
100
100
|
Skip the workspace step entirely
|
|
@@ -120,11 +120,21 @@ Exit codes:
|
|
|
120
120
|
|
|
121
121
|
Code 5 needs \-\-visibility: without it no workspace was requested, so nothing
|
|
122
122
|
can fail for not getting one. It does not mean re\-run init \- the local files
|
|
123
|
-
are already written.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
123
|
+
are already written. A \-\-visibility that is not personal, team is code 5 on
|
|
124
|
+
every path, including \-\-json, CI and \-\-no\-cloud: none of them makes the value
|
|
125
|
+
usable, so none of them should report success for it.
|
|
126
|
+
|
|
127
|
+
Under \-\-json, read `exitCode`, `refusal`, `usageError` and `cloud` from the
|
|
128
|
+
payload rather than matching the messages on stderr. `refusal.kind` is one of
|
|
129
|
+
foreign\-postman\-dir, bound\-spec\-missing, spec\-hint\-unmatched. `usageError`
|
|
130
|
+
names the flag whose value init could not use. `cloud` says what happened to
|
|
131
|
+
the workspace step, including why it was skipped.
|
|
132
|
+
|
|
133
|
+
\-\-json with \-\-visibility creates the workspace, same as without it: stdout
|
|
134
|
+
carries the payload and everything meant for a person goes to stderr. It used
|
|
135
|
+
to skip the step and exit 0, so a missing `origin` remote or a failed bind
|
|
136
|
+
went unreported. Without \-\-visibility, \-\-json still skips \- there is nothing
|
|
137
|
+
to create and init may not prompt.
|
|
128
138
|
|
|
129
139
|
Examples:
|
|
130
140
|
$ postman init
|
|
@@ -286,6 +296,9 @@ Fetch a Postman collection in the V3 format and print it.
|
|
|
286
296
|
.B collection request
|
|
287
297
|
Add, update, or remove requests in a local v3 collection.
|
|
288
298
|
.TP
|
|
299
|
+
.B collection folder
|
|
300
|
+
Add, update, or remove folders in a local v3 collection.
|
|
301
|
+
.TP
|
|
289
302
|
.B collection list
|
|
290
303
|
List collections: your local project's collections by default, or a Postman cloud workspace's collections with \-\-workspace.
|
|
291
304
|
.TP
|
|
@@ -547,6 +560,132 @@ Examples:
|
|
|
547
560
|
|
|
548
561
|
|
|
549
562
|
|
|
563
|
+
.SS "collection folder"
|
|
564
|
+
Add, update, or remove folders in a local v3 collection.
|
|
565
|
+
|
|
566
|
+
.B Usage:
|
|
567
|
+
[options] [command]
|
|
568
|
+
|
|
569
|
+
.B Subcommands:
|
|
570
|
+
.TP
|
|
571
|
+
.B collection folder add
|
|
572
|
+
Add an empty folder to a local v3 collection (set its details later with `update`).
|
|
573
|
+
.TP
|
|
574
|
+
.B collection folder update
|
|
575
|
+
Update a folder in a v3 collection (only the fields you pass).
|
|
576
|
+
.TP
|
|
577
|
+
.B collection folder rm
|
|
578
|
+
Remove a folder from a v3 collection (recursive: removes everything inside it).
|
|
579
|
+
|
|
580
|
+
.SS "collection folder add"
|
|
581
|
+
Add an empty folder to a local v3 collection (set its details later with `update`).
|
|
582
|
+
|
|
583
|
+
.B Usage:
|
|
584
|
+
[options] [folder\-name]
|
|
585
|
+
|
|
586
|
+
.B Options:
|
|
587
|
+
.TP
|
|
588
|
+
.B \-\-collection <id|name>
|
|
589
|
+
Target collection: name, directory, id, cloud id, or path. Required.
|
|
590
|
+
.TP
|
|
591
|
+
.B \-\-folder <id|name|path>
|
|
592
|
+
Parent folder within the collection, e.g. "Users/Admin". Defaults to the root.
|
|
593
|
+
.TP
|
|
594
|
+
.B \-w, \-\-workspace <id>
|
|
595
|
+
Target a Postman cloud workspace by id (cloud mode).
|
|
596
|
+
.TP
|
|
597
|
+
.B \-\-json
|
|
598
|
+
JSON output.
|
|
599
|
+
|
|
600
|
+
.TP Examples:
|
|
601
|
+
|
|
602
|
+
Creates an empty folder (name only); set its description with `collection folder update`. Nest it with \-\-folder.
|
|
603
|
+
|
|
604
|
+
Examples:
|
|
605
|
+
postman collection folder add Users \-\-collection "My API"
|
|
606
|
+
postman collection folder add \-\-collection "My API" # named "New folder"
|
|
607
|
+
postman collection folder add Admin \-\-collection "My API" \-\-folder Users
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
.SS "collection folder update"
|
|
612
|
+
Update a folder in a v3 collection (only the fields you pass).
|
|
613
|
+
|
|
614
|
+
.B Usage:
|
|
615
|
+
[options] <folder>
|
|
616
|
+
|
|
617
|
+
.B Options:
|
|
618
|
+
.TP
|
|
619
|
+
.B \-\-collection <id|name>
|
|
620
|
+
Target collection: name, directory, id, cloud id, or path (cloud: id only). Required.
|
|
621
|
+
.TP
|
|
622
|
+
.B \-\-folder <id|name|path>
|
|
623
|
+
Parent folder to scope the selector, e.g. "Users" (local: name/path; cloud: id).
|
|
624
|
+
.TP
|
|
625
|
+
.B \-\-name <name>
|
|
626
|
+
Rename the folder (moves its directory).
|
|
627
|
+
.TP
|
|
628
|
+
.B \-\-description <text>
|
|
629
|
+
Folder description.
|
|
630
|
+
.TP
|
|
631
|
+
.B \-\-auth <spec>
|
|
632
|
+
Folder auth: none, inherit, bearer:TOKEN, basic:USER:PASS, apikey:KEY:VALUE[:header|query], oauth2:TOKEN.
|
|
633
|
+
.TP
|
|
634
|
+
.B \-\-scripts <event:script>
|
|
635
|
+
Replace folder scripts. event is prerequest or test; script is @file, \- for stdin, or inline. Repeatable. (default: )
|
|
636
|
+
.TP
|
|
637
|
+
.B \-w, \-\-workspace <id>
|
|
638
|
+
Target a Postman cloud workspace by id (cloud mode).
|
|
639
|
+
.TP
|
|
640
|
+
.B \-\-json
|
|
641
|
+
JSON output.
|
|
642
|
+
|
|
643
|
+
.TP Examples:
|
|
644
|
+
|
|
645
|
+
Select the folder by the <folder> selector: local — a name or "Parent/Name" path (or \-\-folder to scope a bare name); cloud (\-\-workspace) — a folder id, with \-\-collection an id too.
|
|
646
|
+
|
|
647
|
+
Examples:
|
|
648
|
+
postman collection folder update Users \-\-collection "My API" \-\-name Accounts
|
|
649
|
+
postman collection folder update "Users/Admin" \-\-collection "My API" \-\-description "Admin endpoints"
|
|
650
|
+
postman collection folder update Admin \-\-collection "My API" \-\-folder Users \-\-auth bearer:TOKEN
|
|
651
|
+
postman collection folder update <folderId> \-\-collection <collectionId> \-\-name Accounts \-w <workspaceId>
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
.SS "collection folder rm"
|
|
656
|
+
Remove a folder from a v3 collection (recursive: removes everything inside it).
|
|
657
|
+
|
|
658
|
+
.B Usage:
|
|
659
|
+
[options] <folder>
|
|
660
|
+
|
|
661
|
+
.B Options:
|
|
662
|
+
.TP
|
|
663
|
+
.B \-\-collection <id|name>
|
|
664
|
+
Target collection: name, directory, id, cloud id, or path (cloud: id only). Required.
|
|
665
|
+
.TP
|
|
666
|
+
.B \-\-folder <id|name|path>
|
|
667
|
+
Parent folder to scope the selector, e.g. "Users" (local: name/path; cloud: id).
|
|
668
|
+
.TP
|
|
669
|
+
.B \-y, \-\-yes
|
|
670
|
+
Skip the confirmation prompt (required when stdout is not a TTY).
|
|
671
|
+
.TP
|
|
672
|
+
.B \-w, \-\-workspace <id>
|
|
673
|
+
Target a Postman cloud workspace by id (cloud mode).
|
|
674
|
+
.TP
|
|
675
|
+
.B \-\-json
|
|
676
|
+
JSON output.
|
|
677
|
+
|
|
678
|
+
.TP Examples:
|
|
679
|
+
|
|
680
|
+
Removal is recursive. Select the folder by the <folder> selector: local — a name or "Parent/Name" path (or \-\-folder to scope a bare name); cloud (\-\-workspace) — a folder id, with \-\-collection an id too.
|
|
681
|
+
|
|
682
|
+
Examples:
|
|
683
|
+
postman collection folder rm Users \-\-collection "My API" \-\-yes
|
|
684
|
+
postman collection folder rm "Users/Admin" \-\-collection "My API" \-y
|
|
685
|
+
postman collection folder rm <folderId> \-\-collection <collectionId> \-y \-w <workspaceId>
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
|
|
550
689
|
.SS "collection list"
|
|
551
690
|
List collections: your local project's collections by default, or a Postman cloud workspace's collections with \-\-workspace.
|
|
552
691
|
|
|
@@ -2164,7 +2303,8 @@ Create even when a workspace is already recorded for this repo
|
|
|
2164
2303
|
|
|
2165
2304
|
.TP Examples:
|
|
2166
2305
|
|
|
2167
|
-
Requires a login (`postman login`) or POSTMAN_API_KEY.
|
|
2306
|
+
Requires a login (`postman login`) or POSTMAN_API_KEY. A guest session
|
|
2307
|
+
has no account to own a workspace: run `postman signup` first.
|
|
2168
2308
|
Refuses to run on CI: create once locally and commit the binding.
|
|
2169
2309
|
|
|
2170
2310
|
Examples:
|
|
@@ -3563,7 +3703,7 @@ Start a mock using its path if it lives in your repository, or its id if it live
|
|
|
3563
3703
|
.B Options:
|
|
3564
3704
|
.TP
|
|
3565
3705
|
.B \-e, \-\-environment <path>
|
|
3566
|
-
Path to a file of environment variables for the mock. Relative or absolute, e.g. ./postman/environments/dev.
|
|
3706
|
+
Path to a file of environment variables for the mock. Relative or absolute, e.g. ./postman/environments/dev.environment.yaml
|
|
3567
3707
|
.TP
|
|
3568
3708
|
.B \-g, \-\-globals <path>
|
|
3569
3709
|
Path to a file of global variables for the mock. Relative or absolute, e.g. ./globals.json
|
|
@@ -3578,7 +3718,7 @@ Postman API key, used with a Postman cloud id (defaults to your `postman login`
|
|
|
3578
3718
|
|
|
3579
3719
|
Eg. postman mock run 12345678\-90ab\-cdef\-1234\-567890abcdef # by id, from Postman cloud
|
|
3580
3720
|
postman mock run ./postman/mocks/orders # by path, from your repository
|
|
3581
|
-
postman mock run ./postman/mocks/orders \-\-environment ./postman/environments/dev.
|
|
3721
|
+
postman mock run ./postman/mocks/orders \-\-environment ./postman/environments/dev.environment.yaml
|
|
3582
3722
|
postman mock run ./postman/mocks/orders \-\-port auto # pick any free port
|
|
3583
3723
|
postman mock run ./postman/mocks/orders \-\-port 4600 # use port 4600 (fails if it is in use)
|
|
3584
3724
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "postman-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.63.0",
|
|
4
4
|
"description": "Official Postman CLI - Command-line companion for API development, testing, and automation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"postman",
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
"man/"
|
|
59
59
|
],
|
|
60
60
|
"optionalDependencies": {
|
|
61
|
-
"@postman/pm-bin-macos-arm64": "1.
|
|
62
|
-
"@postman/pm-bin-macos-x64": "1.
|
|
63
|
-
"@postman/pm-bin-linux-x64": "1.
|
|
64
|
-
"@postman/pm-bin-linux-arm64": "1.
|
|
65
|
-
"@postman/pm-bin-windows-x64": "1.
|
|
61
|
+
"@postman/pm-bin-macos-arm64": "1.63.0",
|
|
62
|
+
"@postman/pm-bin-macos-x64": "1.63.0",
|
|
63
|
+
"@postman/pm-bin-linux-x64": "1.63.0",
|
|
64
|
+
"@postman/pm-bin-linux-arm64": "1.63.0",
|
|
65
|
+
"@postman/pm-bin-windows-x64": "1.63.0"
|
|
66
66
|
}
|
|
67
67
|
}
|