postman-cli 1.77.0 → 1.80.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/README.md +197 -46
- package/man/postman.1 +94 -36
- package/package.json +32 -37
package/README.md
CHANGED
|
@@ -1,82 +1,233 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
<a href="https://www.getpostman.com/">
|
|
5
|
-
<img src="https://voyager.postman.com/logo/postman-logo-orange.svg" alt="Postman Logo" width="400" height="200">
|
|
6
|
-
</a>
|
|
7
|
-
</div>
|
|
8
|
-
|
|
9
|
-
<br>
|
|
1
|
+
<a href="https://www.postman.com/">
|
|
2
|
+
<img src="https://voyager.postman.com/logo/postman-logo-orange.svg" alt="Postman" width="320">
|
|
3
|
+
</a>
|
|
10
4
|
|
|
11
5
|
# Postman CLI
|
|
12
6
|
|
|
13
|
-
|
|
7
|
+
**API engineering for your agents.** Go faster from development to production.
|
|
14
8
|
|
|
15
|
-
|
|
9
|
+
Lets a coding agent send and test API requests, run collections (saved groups of requests with tests) and OpenAPI specs, load-test an API, stand in for third-party APIs with local fake servers (mocks, and simulations that serve several mocks together), and schedule checks against production (monitors). The CLI provides a standardised runtime and execution across operating systems and environments such as the terminal, coding harnesses and CI.
|
|
16
10
|
|
|
17
|
-
|
|
11
|
+
## Install
|
|
18
12
|
|
|
19
13
|
```bash
|
|
20
14
|
npm install -g postman-cli
|
|
21
15
|
```
|
|
22
16
|
|
|
23
|
-
|
|
17
|
+
Without Node.js:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# macOS, Linux, WSL
|
|
21
|
+
curl -o- "https://dl-cli.pstmn.io/install/unix.sh" | sh
|
|
22
|
+
|
|
23
|
+
# Windows (PowerShell)
|
|
24
|
+
powershell -NoP -NonI -c "irm https://dl-cli.pstmn.io/install/win64.ps1 | iex"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The Postman desktop app includes the CLI. Update with `postman update`. See the [installation guide](https://learning.postman.com/docs/postman-cli/postman-cli-installation/) for other options.
|
|
28
|
+
|
|
29
|
+
## Quick start
|
|
24
30
|
|
|
25
|
-
|
|
31
|
+
```bash
|
|
32
|
+
postman init # set up the repo, install agent skills, link a workspace
|
|
33
|
+
postman request GET https://api.example.com/health # send a request
|
|
34
|
+
postman collection run ./postman/collections/orders # run a collection and its tests
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Agent skills
|
|
38
|
+
|
|
39
|
+
`postman init` installs Postman's agent skills in `postman/skills/` and adds a pointer to them in `AGENTS.md`. Check for updates with `postman skills status`.
|
|
40
|
+
|
|
41
|
+
| Skill | What you get |
|
|
42
|
+
|---|---|
|
|
43
|
+
| `api-discovery` | Reuse the APIs your organization already has, and see what depends on one before you change it |
|
|
44
|
+
| `api-testing` | A repeatable test for every change, so regressions surface in review |
|
|
45
|
+
| `api-mocking` | Build against agreed behaviour before the real API or its dependencies exist |
|
|
46
|
+
| `api-monitoring` | The same tests that passed in development, running against production |
|
|
47
|
+
| `ci-integration` | Merges that fail on a broken test, contract or governance rule |
|
|
48
|
+
| `performance-testing` | Releases gated on latency and error-rate thresholds |
|
|
49
|
+
|
|
50
|
+
[See all skills](https://github.com/postmanlabs/postman-plugin/tree/main/skills).
|
|
26
51
|
|
|
27
52
|
## Usage
|
|
28
53
|
|
|
54
|
+
The examples below cover common tasks. For the full reference, run `man postman`, `postman --help`, or `postman <command> --help`.
|
|
55
|
+
|
|
56
|
+
### Requests
|
|
57
|
+
|
|
29
58
|
```bash
|
|
30
|
-
|
|
31
|
-
postman --
|
|
59
|
+
postman request POST http://localhost:3000/auth/token --body @creds.json --response-only
|
|
60
|
+
postman request PATCH http://localhost:3000/orders/42 --auth-bearer-token "$TOKEN" \
|
|
61
|
+
--body '{"status":"shipped"}' \
|
|
62
|
+
--script-post-request "pm.test('200', () => pm.response.to.have.status(200))"
|
|
63
|
+
```
|
|
32
64
|
|
|
33
|
-
|
|
34
|
-
|
|
65
|
+
Exits `0` on a 2xx or 3xx response with all tests passing. Otherwise exits with the number of failed tests.
|
|
66
|
+
|
|
67
|
+
### Collections and specs
|
|
35
68
|
|
|
36
|
-
|
|
37
|
-
postman
|
|
69
|
+
```bash
|
|
70
|
+
postman spec lint ./openapi.yaml
|
|
71
|
+
postman spec generate collection ./openapi.yaml --name "Orders API"
|
|
72
|
+
postman collection import ./login.curl
|
|
73
|
+
postman collection run ./postman/collections/orders -e ./postman/environments/dev.environment.yaml
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Mocks
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
postman mock generate ./specs/payments.yaml --stateful # no spec? pass only --name for a sample
|
|
80
|
+
postman mock run ./postman/mocks/payments --port 4010
|
|
81
|
+
postman collection run ./postman/collections/checkout --use-mock "{{paymentsUrl}} mock:./postman/mocks/payments"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
A mock is a Node.js request handler in `postman/mocks/<name>/`. Use `pm.state` to keep state between requests:
|
|
85
|
+
|
|
86
|
+
```js
|
|
87
|
+
const http = require("http");
|
|
88
|
+
http.createServer(async (req, res) => {
|
|
89
|
+
const key = req.headers["idempotency-key"];
|
|
90
|
+
const seen = await pm.state.get(key);
|
|
91
|
+
if (seen) return res.end(JSON.stringify(seen));
|
|
92
|
+
if (req.headers["x-test"] === "429") { res.writeHead(429); return res.end(); }
|
|
93
|
+
const charge = { id: "ch_" + Date.now(), status: "succeeded" };
|
|
94
|
+
await pm.state.set(key, charge);
|
|
95
|
+
res.writeHead(201); res.end(JSON.stringify(charge));
|
|
96
|
+
});
|
|
97
|
+
```
|
|
38
98
|
|
|
39
|
-
|
|
40
|
-
postman login --with-api-key <api-key>
|
|
99
|
+
`--use-mock` takes `"<url or {{variable}}> mock:<path>"` and points every request to `{{paymentsUrl}}` at the local mock for the length of the run. Repeat the flag to redirect several URLs. `pm.state` persists across requests and runs until `pm.state.clear()`. `postman mock run --output ndjson` streams one JSON event per request for CI.
|
|
41
100
|
|
|
42
|
-
|
|
43
|
-
postman login --with-api-key <api-key> --region eu
|
|
101
|
+
Scenarios in `config.yaml` add delays, error responses, rate limits and random failures. Select one per request with the `x-mock-scenario` header. A simulation is a `.sim.yaml` file that serves several mocks together on one local port. `postman simulation run <file>` runs it, and adding `--proxy` routes requests to each mock by hostname with no code changes (Solo, Team and Enterprise plans).
|
|
44
102
|
|
|
45
|
-
|
|
46
|
-
postman collection run <collection-id>
|
|
103
|
+
### Performance tests
|
|
47
104
|
|
|
48
|
-
|
|
49
|
-
postman
|
|
105
|
+
```bash
|
|
106
|
+
postman performance run ./postman/collections/checkout \
|
|
107
|
+
--peak-vu 200 --duration 5 --load-profile fixed \
|
|
108
|
+
--pass-if "less_than(p95, 300)" --pass-if "less_than(error_rate, 1)" \
|
|
109
|
+
--output ndjson
|
|
110
|
+
```
|
|
50
111
|
|
|
51
|
-
|
|
112
|
+
`--duration` is in minutes. `--load-profile` takes `fixed` (flat at `--peak-vu`), `ramp-up`, `spike` (a short burst, no time held at the peak) or `peak` (ramps up, holds the peak, then ramps down). A failed `--pass-if` exits `1`, which fails the CI job. Thresholds can use `avg`, `p90`, `p95`, `p99` (milliseconds), `error_rate` (percent) and `rps`. Load runs from the local machine by default. Use `--runner postman-cloud` to generate load from Postman's cloud runners.
|
|
113
|
+
|
|
114
|
+
### Monitors
|
|
115
|
+
|
|
116
|
+
A monitor runs a cloud collection on a schedule against a live API and alerts you when it fails. It is not process or host monitoring.
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
postman monitor create --collection <collection-id> --schedule "*/5 * * * *" --notify-email oncall@example.com
|
|
52
120
|
postman monitor run <monitor-id>
|
|
121
|
+
postman monitor jobs list <monitor-id> --result failure
|
|
122
|
+
```
|
|
53
123
|
|
|
54
|
-
|
|
55
|
-
|
|
124
|
+
Send alerts to email or any of Postman's [monitor integrations](https://www.postman.com/product/integrations/?filter=api-monitoring). Run monitors inside your own network with `postman runner start` ([private runners](https://learning.postman.com/docs/monitoring-your-api/runners/overview/)).
|
|
125
|
+
|
|
126
|
+
### Secrets
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
postman secret create PAYMENTS_API_KEY
|
|
130
|
+
postman environment var set api_key --secret-id <id> -e ./postman/environments/staging.environment.yaml
|
|
56
131
|
```
|
|
57
132
|
|
|
58
|
-
|
|
133
|
+
Secret values are entered in a one-time browser form and stored in your team's Shared Vault. The CLI never prints them, and coding agents never see them.
|
|
59
134
|
|
|
60
|
-
|
|
135
|
+
### Workspace context
|
|
61
136
|
|
|
62
|
-
|
|
63
|
-
-
|
|
64
|
-
|
|
137
|
+
```bash
|
|
138
|
+
postman workspace push --yes -m "Add refunds endpoint, spec and tests"
|
|
139
|
+
postman workspace context --type workspacePush --limit 5 --brief # recent push messages, one line each
|
|
140
|
+
postman workspace context --json # the full workspace context
|
|
141
|
+
postman workspace pull
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Use `-m` to record what changed. `workspace context` shows each push with its author, and changes made by agents appear as `Name (Agent)`, for example `Ada Lovelace (Claude Code)`. Monitor runs and runs of linked collections are recorded in the workspace. Collection runs from CI include the commit and pipeline.
|
|
145
|
+
|
|
146
|
+
### Context Graph
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
postman context-graph ask "What depends on the billing service's invoice response?" --wait --json
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Context Graph maps your organization's APIs, deployments, database schemas, external services and teams into a single dependency graph, built from Git-connected Postman workspaces plus the sources you connect, such as GitHub repositories and New Relic. It answers how your services relate to each other and gives agents grounded, queryable context about your architecture.
|
|
153
|
+
|
|
154
|
+
Answers draw on the sources your team connects in Postman under **Home > Agent Context**. Use code search for anything outside them. `postman dependency add` pulls in collections and specs published by other teams. `postman describe` returns the details an agent needs to write code against an API. [Learn more](https://www.postman.com/context-graph/)
|
|
155
|
+
|
|
156
|
+
### Public APIs
|
|
65
157
|
|
|
66
|
-
|
|
158
|
+
[Orbit](https://www.buildwithorbit.ai/) finds public API endpoints for a task and returns instructions to call them. The `api-discovery` skill uses it automatically.
|
|
67
159
|
|
|
68
|
-
|
|
160
|
+
```bash
|
|
161
|
+
claude mcp add --transport http orbit https://mcp.buildwithorbit.ai/mcp
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## What install and `init` change on your machine
|
|
165
|
+
|
|
166
|
+
- **`npm install`:** if Claude Code's or Codex's configuration folder already exists, the install adds one line to its global instructions (`CLAUDE.md`, or Codex's `AGENTS.override.md` or `AGENTS.md`) between `<!-- postman-cli:installation:start -->` and `<!-- postman-cli:installation:end -->` markers: "Postman CLI is installed on this device, and can be used for API Engineering work." Delete those lines to remove it.
|
|
167
|
+
- **`postman init`:** writes local files (`postman/`, `AGENTS.md`, skills under `postman/skills/`). It fetches the latest skills over HTTPS and falls back to the copies bundled with the CLI; `--no-fetch` skips the attempt. It creates a cloud workspace only when you pass `--visibility`, or `--yes` (a guest session when you aren't signed in), and never in CI. `--dry-run` shows what it would do first.
|
|
168
|
+
- **Context that carries over:** in a repo linked to a Postman workspace, using the CLI saves context to that cloud workspace automatically: run results, pushes with their messages, and who or which agent did what. The next session, agent or teammate reads it back with `postman workspace context`, so work isn't re-derived each time. It also keeps your team's API Catalog and Application Inventory current, and feeds Context Graph. Commands such as `collection run`, `request` and `spec lint` do this by default.
|
|
169
|
+
|
|
170
|
+
## Accounts
|
|
171
|
+
|
|
172
|
+
All capabilities are available without signing in. Signing in associates your work with a Postman account from then on: `postman signup` creates a new account, and `postman login` connects an existing one.
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
postman whoami
|
|
176
|
+
postman signup
|
|
177
|
+
postman login
|
|
178
|
+
postman login --with-api-key <api-key> # or set POSTMAN_API_KEY
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
The CLI supports Postman's EU region for teams whose data is hosted in the EU. Sign in with `postman login --region eu` (or `postman login --with-api-key <api-key> --region eu`), and the CLI works against the EU region from then on. Private runners take the same `--region eu` option. See [EU data residency](https://learning.postman.com/docs/administration/enterprise/about-eu-data-residency/).
|
|
182
|
+
|
|
183
|
+
## Postman plugin for coding agents
|
|
184
|
+
|
|
185
|
+
Install the Postman plugin to make the skills available in every repo you open in your coding agent. The plugin runs its commands through this CLI. `postman init` adds the skills to one repo, so everyone who clones it gets them.
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
npx @postman/postman-plugin # every agent on this machine
|
|
189
|
+
|
|
190
|
+
claude plugin marketplace add anthropics/claude-plugins-official # Claude Code
|
|
191
|
+
claude plugin install postman@claude-plugins-official
|
|
192
|
+
|
|
193
|
+
codex plugin marketplace add postmanlabs/postman-plugin # Codex
|
|
194
|
+
codex plugin add postman@postman
|
|
195
|
+
|
|
196
|
+
/add-plugin postman # Cursor
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Also available for OpenCode, GitHub Copilot CLI, Antigravity, Factory, Kimi Code and Pi. See [Install the Postman plugin](https://learning.postman.com/docs/postman-plugin/install/overview/).
|
|
200
|
+
|
|
201
|
+
## CI/CD
|
|
202
|
+
|
|
203
|
+
- Authenticate with `POSTMAN_API_KEY` or `postman login --with-api-key`.
|
|
204
|
+
- Commands exit non-zero on failure.
|
|
205
|
+
- `--json` for machine-readable output, `--output ndjson` for streaming, `--yes` to skip prompts.
|
|
206
|
+
- Collection run reporters: `cli`, `json`, `junit`, `html`.
|
|
207
|
+
- `postman workspace diff --exit-code` fails when local files and the cloud workspace differ.
|
|
208
|
+
- In CI, `postman init` uses the workspace recorded in `.postman/resources.yaml`.
|
|
209
|
+
- GitHub Actions: [Postman CLI GitHub Action](https://learning.postman.com/docs/postman-cli/postman-cli-github-actions).
|
|
210
|
+
|
|
211
|
+
## Migrating from Newman
|
|
212
|
+
|
|
213
|
+
`postman collection run` accepts Newman's main options and also runs v3 YAML collections from [Native Git](https://www.postman.com/product/native-git/). Convert a v2.1 collection with `postman collection migrate`. See [Migrate from Newman](https://learning.postman.com/docs/reference/newman-cli/migrate-to-postman-cli).
|
|
214
|
+
|
|
215
|
+
## Platform support
|
|
216
|
+
|
|
217
|
+
- macOS (Intel and Apple Silicon)
|
|
218
|
+
- Linux (x64 and ARM64). Alpine is not supported.
|
|
219
|
+
- Windows (x64)
|
|
69
220
|
|
|
70
|
-
|
|
221
|
+
If you see `Binary not found`, make sure optional dependencies are installed (no `--omit=optional`, no `optional=false` in `.npmrc`) and your registry can reach `@postman/*` packages. If you installed with both npm and the install script, run `which postman` to see which one is on your `PATH`.
|
|
71
222
|
|
|
72
|
-
##
|
|
223
|
+
## Documentation
|
|
73
224
|
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
225
|
+
- [Postman CLI docs](https://learning.postman.com/docs/postman-cli/postman-cli-overview/)
|
|
226
|
+
- [Command reference](https://learning.postman.com/docs/postman-cli/postman-cli-options/)
|
|
227
|
+
- [Using the CLI with AI agents and CI/CD](https://learning.postman.com/docs/postman-cli/postman-cli-agents-and-ci)
|
|
228
|
+
- [Release notes](https://www.postman.com/release-notes/postman-cli/)
|
|
78
229
|
|
|
79
230
|
## Support
|
|
80
231
|
|
|
81
|
-
-
|
|
82
|
-
- [GitHub Issues](https://github.com/postmanlabs/postman-app-support/issues)
|
|
232
|
+
- `postman feedback "<message>"`
|
|
233
|
+
- [GitHub Issues](https://github.com/postmanlabs/postman-app-support/issues)
|
package/man/postman.1
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.TH POSTMAN 1 "2026-10-
|
|
1
|
+
.TH POSTMAN 1 "2026-10-27" "v1.80.0" "Postman CLI Manual"
|
|
2
2
|
.SH NAME
|
|
3
3
|
postman \- Command\-line companion utility for Postman
|
|
4
4
|
.SH SYNOPSIS
|
|
@@ -166,6 +166,24 @@ Show the Postman account or guest session this CLI session is using.
|
|
|
166
166
|
.B \-\-json
|
|
167
167
|
Print current identity as machine\-readable JSON.
|
|
168
168
|
|
|
169
|
+
.SS "status"
|
|
170
|
+
Show the Postman CLI version, project initialization, authentication, skills, and agent plugins.
|
|
171
|
+
|
|
172
|
+
.B Usage:
|
|
173
|
+
[options] [dir\-path]
|
|
174
|
+
|
|
175
|
+
.B Options:
|
|
176
|
+
.TP
|
|
177
|
+
.B \-\-json
|
|
178
|
+
Print status as machine\-readable JSON.
|
|
179
|
+
|
|
180
|
+
.TP Examples:
|
|
181
|
+
|
|
182
|
+
Examples:
|
|
183
|
+
$ postman status
|
|
184
|
+
$ postman status ./services/api \-\-json
|
|
185
|
+
|
|
186
|
+
|
|
169
187
|
.SS "feedback"
|
|
170
188
|
Submit feedback about CLI usability, gaps, and improvement suggestions.
|
|
171
189
|
|
|
@@ -2255,7 +2273,7 @@ Read a spec definition, including every file of a multi\-file spec.
|
|
|
2255
2273
|
Postman API key
|
|
2256
2274
|
.TP
|
|
2257
2275
|
.B \-\-json
|
|
2258
|
-
Output as JSON
|
|
2276
|
+
Output as JSON; a local OpenAPI spec also includes its parsed, $ref\-resolved definition
|
|
2259
2277
|
|
|
2260
2278
|
.TP Examples:
|
|
2261
2279
|
|
|
@@ -3206,8 +3224,8 @@ Lint the current local Postman workspace: its configuration (.postman/resources.
|
|
|
3206
3224
|
.B workspace get
|
|
3207
3225
|
Read a workspace's metadata, and optionally the ids of what it holds.
|
|
3208
3226
|
.TP
|
|
3209
|
-
.B workspace
|
|
3210
|
-
Read a workspace's activity
|
|
3227
|
+
.B workspace context
|
|
3228
|
+
Read a workspace's recent activity: who changed what, and the messages left on pushes. Also available as `activity`.
|
|
3211
3229
|
.TP
|
|
3212
3230
|
.B workspace create
|
|
3213
3231
|
Create a Postman workspace and bind it to this git repository.
|
|
@@ -3298,6 +3316,9 @@ Skip all confirmation prompts
|
|
|
3298
3316
|
.B \-\-push\-strategy <strategy>
|
|
3299
3317
|
Push strategy. "force\-sync": mirror the whole workspace — also DELETE cloud entities that have no local counterpart (destructive). Defaults to "default" (create/update only).
|
|
3300
3318
|
.TP
|
|
3319
|
+
.B \-m, \-\-message <text>
|
|
3320
|
+
Short note on what changed, like a commit message (max 500 characters). Shown on the workspace activity feed. Recorded only when the push changes something.
|
|
3321
|
+
.TP
|
|
3301
3322
|
.B \-\-json
|
|
3302
3323
|
Print the outcome as machine\-readable JSON. Implies non\-interactive: use \-\-yes to actually push.
|
|
3303
3324
|
.TP
|
|
@@ -3361,8 +3382,8 @@ Exit codes: 0 ok, 1 not found or API failure, 2 bad usage, 3 auth.
|
|
|
3361
3382
|
|
|
3362
3383
|
|
|
3363
3384
|
|
|
3364
|
-
.SS "workspace
|
|
3365
|
-
Read a workspace's activity
|
|
3385
|
+
.SS "workspace context"
|
|
3386
|
+
Read a workspace's recent activity: who changed what, and the messages left on pushes. Also available as `activity`.
|
|
3366
3387
|
|
|
3367
3388
|
.B Usage:
|
|
3368
3389
|
[options] [id]
|
|
@@ -3370,7 +3391,7 @@ Read a workspace's activity feed.
|
|
|
3370
3391
|
.B Options:
|
|
3371
3392
|
.TP
|
|
3372
3393
|
.B \-\-type <types>
|
|
3373
|
-
Comma\-separated element types to filter on, e.g. "api,collection".
|
|
3394
|
+
Comma\-separated element types to filter on, e.g. "api,collection". Use "workspacePush" for the messages left with `workspace push \-m`.
|
|
3374
3395
|
.TP
|
|
3375
3396
|
.B \-\-contributor <ids>
|
|
3376
3397
|
Comma\-separated user ids to filter on.
|
|
@@ -3387,19 +3408,23 @@ Ask the API for a human\-readable description of each entry.
|
|
|
3387
3408
|
.B \-\-json
|
|
3388
3409
|
Print the feed as machine\-readable JSON.
|
|
3389
3410
|
.TP
|
|
3411
|
+
.B \-\-brief
|
|
3412
|
+
Print one plain line per entry (time, who, message), for a prompt or a log. Prints nothing when there are no entries.
|
|
3413
|
+
.TP
|
|
3390
3414
|
.B \-\-timeout <ms>
|
|
3391
3415
|
Milliseconds to wait for the API (default 30000).
|
|
3392
3416
|
|
|
3393
3417
|
.TP Examples:
|
|
3394
3418
|
|
|
3395
3419
|
Examples:
|
|
3396
|
-
postman workspace
|
|
3420
|
+
postman workspace context
|
|
3397
3421
|
Reads the current folder's bound workspace
|
|
3398
|
-
postman workspace
|
|
3399
|
-
postman workspace
|
|
3400
|
-
postman workspace
|
|
3401
|
-
postman workspace
|
|
3402
|
-
postman workspace
|
|
3422
|
+
postman workspace context 00a50319\-1262\-49d2\-83e5\-551e3c5dba00
|
|
3423
|
+
postman workspace context <id> \-\-type api,collection
|
|
3424
|
+
postman workspace context <id> \-\-contributor <userId>
|
|
3425
|
+
postman workspace context <id> \-\-markdown
|
|
3426
|
+
postman workspace context <id> \-\-json
|
|
3427
|
+
postman workspace context <id> \-\-type workspacePush \-\-limit 5 \-\-brief
|
|
3403
3428
|
|
|
3404
3429
|
Exit codes: 0 ok, 1 not found or API failure, 2 bad usage, 3 auth.
|
|
3405
3430
|
|
|
@@ -3840,9 +3865,9 @@ Load segments:
|
|
|
3840
3865
|
ramp\-up — 2 segments
|
|
3841
3866
|
|
|
3842
3867
|
peak ┤ _________ at peak __________
|
|
3843
|
-
│ ramp\-up _____
|
|
3844
|
-
│ ______
|
|
3845
|
-
base ┤__ warm\-up ___
|
|
3868
|
+
│ ramp\-up _____╱
|
|
3869
|
+
│ ______╱
|
|
3870
|
+
base ┤__ warm\-up ___╱
|
|
3846
3871
|
└┬─────────────┬─────────────┬───────────────────────────┤ \-\-duration
|
|
3847
3872
|
1 2 (3)
|
|
3848
3873
|
|
|
@@ -3854,10 +3879,10 @@ Load segments:
|
|
|
3854
3879
|
|
|
3855
3880
|
spike — 3 segments · no time at the peak; use \-\-load\-profile peak to hold
|
|
3856
3881
|
|
|
3857
|
-
peak ┤
|
|
3858
|
-
│ ramp\-up _
|
|
3859
|
-
│ _
|
|
3860
|
-
base ┤______ warm\-up _______
|
|
3882
|
+
peak ┤ ╱╲
|
|
3883
|
+
│ ramp\-up _╱ ╲_ ramp\-down
|
|
3884
|
+
│ _╱ ╲_
|
|
3885
|
+
base ┤______ warm\-up _______╱ ╲______ at base _______
|
|
3861
3886
|
└┬─────────────────────┬─────┬─────┬─────────────────────┤ \-\-duration
|
|
3862
3887
|
1 2 3 (4)
|
|
3863
3888
|
|
|
@@ -3870,9 +3895,9 @@ Load segments:
|
|
|
3870
3895
|
peak — 4 segments
|
|
3871
3896
|
|
|
3872
3897
|
peak ┤ __ hold ___
|
|
3873
|
-
│ ramp\-up ____
|
|
3874
|
-
│ ____
|
|
3875
|
-
base ┤_ warm\-up _
|
|
3898
|
+
│ ramp\-up ____╱ ╲____ ramp\-down
|
|
3899
|
+
│ ____╱ ╲____
|
|
3900
|
+
base ┤_ warm\-up _╱ ╲_ at base __
|
|
3876
3901
|
└┬──────────┬──────────┬──────────┬──────────┬───────────┤ \-\-duration
|
|
3877
3902
|
1 2 3 4 (5)
|
|
3878
3903
|
|
|
@@ -5058,7 +5083,7 @@ Create, run, and manage Postman mocks — in your repository or in Postman cloud
|
|
|
5058
5083
|
.B Subcommands:
|
|
5059
5084
|
.TP
|
|
5060
5085
|
.B mock generate
|
|
5061
|
-
Generate a mock from a Postman collection
|
|
5086
|
+
Generate a mock from a Postman collection, an OpenAPI file or a dataset, or from a built\-in sample shopping\-cart mock (POST /cart/items, GET /cart, POST /checkout). Writes a local mock by default, or a cloud mock with \-\-workspace. Add \-\-deploy to also make it a live mock server.
|
|
5062
5087
|
.TP
|
|
5063
5088
|
.B mock run
|
|
5064
5089
|
Start a mock using its path if it lives in your repository, or its id if it lives in Postman cloud (fetched and run locally).
|
|
@@ -5082,7 +5107,7 @@ Show the requests a live mock server has received and the responses it sent, usi
|
|
|
5082
5107
|
Delete a mock using its path if it lives in your repository, or its id if it lives in Postman cloud. Cannot be undone.
|
|
5083
5108
|
|
|
5084
5109
|
.SS "mock generate"
|
|
5085
|
-
Generate a mock from a Postman collection
|
|
5110
|
+
Generate a mock from a Postman collection, an OpenAPI file or a dataset, or from a built\-in sample shopping\-cart mock (POST /cart/items, GET /cart, POST /checkout). Writes a local mock by default, or a cloud mock with \-\-workspace. Add \-\-deploy to also make it a live mock server.
|
|
5086
5111
|
|
|
5087
5112
|
.B Usage:
|
|
5088
5113
|
[sourcePath] [options]
|
|
@@ -5098,14 +5123,29 @@ Name for the mock. Taken from the source when you provide one; required for the
|
|
|
5098
5123
|
.B \-\-port <port>
|
|
5099
5124
|
Port the mock runs on (e.g. 4010) (default: 4500)
|
|
5100
5125
|
.TP
|
|
5126
|
+
.B \-\-mode <mode>
|
|
5127
|
+
How the mock behaves: static (replays examples, the default), stateful (keeps records: create, read, list, update, delete), or ai (stateful, plus realistic data and business rules; generated by Postman, needs `postman login`).
|
|
5128
|
+
.TP
|
|
5101
5129
|
.B \-\-stateful
|
|
5102
|
-
|
|
5130
|
+
Same as \-\-mode stateful. Generated offline for a local file, by Postman with \-\-workspace, \-\-spec, \-\-collection or \-\-dataset (validated, with seed data). Endpoints that are not CRUD\-shaped stay static.
|
|
5131
|
+
.TP
|
|
5132
|
+
.B \-\-instructions <text>
|
|
5133
|
+
With \-\-mode ai: guidance for the AI, e.g. "Orders can only be cancelled before they ship".
|
|
5134
|
+
.TP
|
|
5135
|
+
.B \-\-spec <specId>
|
|
5136
|
+
Generate from a spec in Postman (by id) instead of a local file. With \-\-workspace, the mock stays linked to it and is regenerated when it changes.
|
|
5137
|
+
.TP
|
|
5138
|
+
.B \-\-collection <collectionId>
|
|
5139
|
+
Generate from a collection in Postman (by id) instead of a local file. With \-\-workspace, the mock stays linked to it and is regenerated when it changes.
|
|
5140
|
+
.TP
|
|
5141
|
+
.B \-\-dataset <datasetIdOrPath>
|
|
5142
|
+
Generate from a dataset: its tables become resources and their first 20 rows the records. A dataset in Postman (by id) or a local .dataset.yaml (CSV and JSON sources). Generated by Postman in stateful (the default) or ai mode; AI sees the column names and types, never the rows.
|
|
5103
5143
|
.TP
|
|
5104
5144
|
.B \-\-force
|
|
5105
5145
|
Overwrite the mock's files if the target folder already has one
|
|
5106
5146
|
.TP
|
|
5107
5147
|
.B \-u, \-\-update <mockPath>
|
|
5108
|
-
|
|
5148
|
+
Regenerate an existing mock in place, e.g. ./postman/mocks/orders. Without a source or \-\-mode, it uses the ones the mock recorded. Cannot be used with \-\-output.
|
|
5109
5149
|
.TP
|
|
5110
5150
|
.B \-w, \-\-workspace <id>
|
|
5111
5151
|
Save the mock to this Postman cloud workspace (by id) instead of your repository. Cannot be used with \-\-output, \-\-force, or \-\-update, except with \-\-deploy, where it only picks the workspace.
|
|
@@ -5119,11 +5159,14 @@ With \-\-deploy, let anyone with the link reach the server (default: callers nee
|
|
|
5119
5159
|
.B \-s, \-\-slug <slug>
|
|
5120
5160
|
With \-\-deploy, the short label used in the server's web address
|
|
5121
5161
|
.TP
|
|
5122
|
-
.B \-\-
|
|
5123
|
-
|
|
5162
|
+
.B \-\-timeout <ms>
|
|
5163
|
+
How long to wait for Postman to generate the mock, in milliseconds (default 75000).
|
|
5124
5164
|
.TP
|
|
5125
5165
|
.B \-\-api\-key <key>
|
|
5126
|
-
Postman API key
|
|
5166
|
+
Postman API key for anything Postman generates, saves or deploys (defaults to your `postman login` session)
|
|
5167
|
+
.TP
|
|
5168
|
+
.B \-\-json
|
|
5169
|
+
Print the result as machine\-readable data instead of a summary: the generated mock, or with \-\-deploy the live server details
|
|
5127
5170
|
.TP
|
|
5128
5171
|
.B \-x, \-\-suppress\-exit\-code
|
|
5129
5172
|
Always exit with code 0, even on failure
|
|
@@ -5137,7 +5180,11 @@ Eg. postman mock generate ./my\-collection.json
|
|
|
5137
5180
|
postman mock generate ./openapi.yaml \-n orders \-\-deploy # generate and get a live URL
|
|
5138
5181
|
postman mock generate ./openapi.yaml \-n orders \-\-deploy \-\-json # same, machine\-readable
|
|
5139
5182
|
postman mock generate ./openapi.yaml \-\-stateful # CRUD handlers backed by pm.state
|
|
5140
|
-
postman mock generate ./
|
|
5183
|
+
postman mock generate ./openapi.yaml \-\-mode ai \-\-instructions "Orders ship in 2 days"
|
|
5184
|
+
postman mock generate \-\-spec <specId> \-\-mode stateful \-w <workspaceId> # linked cloud mock
|
|
5185
|
+
postman mock generate \-\-dataset ./postman/datasets/shop/shop.dataset.yaml # rows as records
|
|
5186
|
+
postman mock generate \-\-update ./postman/mocks/orders # regenerate from its recorded source
|
|
5187
|
+
postman mock generate \-\-spec <specId> \-\-mode ai \-o ./postman/mocks/orders \-\-json
|
|
5141
5188
|
postman mock generate ./my\-collection.json \-w 12345678\-90ab\-cdef\-1234\-567890abcdef # save to Postman cloud
|
|
5142
5189
|
|
|
5143
5190
|
Paths can be relative (e.g. ./my\-collection.json) or absolute (e.g. /Users/me/my\-collection.json).
|
|
@@ -5668,6 +5715,8 @@ Eg. postman simulation create \-n "Checkout" \-\-mock ./postman/mocks/payments \
|
|
|
5668
5715
|
|
|
5669
5716
|
Local mock paths build a simulation file you serve with `postman simulation run`. Postman mock ids create it in your cloud workspace instead. Use one kind or the other, not both. Add \-\-deploy to upload it and get a live mock server.
|
|
5670
5717
|
|
|
5718
|
+
A <name>.context.md is written beside the .sim.yaml, holding what running this simulation has taught: the commands, the preconditions, and what a passing run still does not prove. `simulation update` renames it with the simulation and `simulation delete` removes it. An existing one is never overwritten, because it holds what earlier runs learned.
|
|
5719
|
+
|
|
5671
5720
|
|
|
5672
5721
|
.SS "simulation list"
|
|
5673
5722
|
List the simulations in your repository or Postman cloud workspace
|
|
@@ -5736,7 +5785,7 @@ Path to a file of environment variables for the mocks (relative or absolute)
|
|
|
5736
5785
|
Path to a file of global variables for the mocks (relative or absolute)
|
|
5737
5786
|
.TP
|
|
5738
5787
|
.B \-p, \-\-port <port>
|
|
5739
|
-
Port to serve on (e.g. 4010), or "auto" for a free one
|
|
5788
|
+
Port to serve on (e.g. 4010), or "auto" for a free one. Omitted, it prefers 3000 but falls back to a free port when that one is busy, so an omitted port is not guaranteed: pass one to pin it, or read the bound port from \-\-output ndjson's "listening" event. Binds 127.0.0.1 only, so a caller in a container or VM cannot reach it.
|
|
5740
5789
|
.TP
|
|
5741
5790
|
.B \-\-dataset <pathOrDir>
|
|
5742
5791
|
Dataset file or folder to load for pm.datasets (repeatable) (default: )
|
|
@@ -5763,22 +5812,25 @@ Show request and response headers and bodies for each request. By default each r
|
|
|
5763
5812
|
Serve the mocks behind a local HTTP(S) forward proxy instead of one routed port, so a repo under test can point HTTP_PROXY/HTTPS_PROXY at it and reach each mock by hostname without code changes. Each mock is reached on the hostnames its `origin:` declares; a request to any other host reaches the real host unchanged.
|
|
5764
5813
|
.TP
|
|
5765
5814
|
.B \-\-proxy\-port <n>
|
|
5766
|
-
Port for the proxy server. Distinct from \-\-port, which is the one\-port run's own port. (default: 7001)
|
|
5815
|
+
Port for the proxy server. Distinct from \-\-port, which is the one\-port run's own port. Bound to 127.0.0.1, so point clients there rather than at "localhost" — a client that resolves localhost to ::1 first will not reach it. A busy port exits 1. (default: 7001)
|
|
5767
5816
|
.TP
|
|
5768
5817
|
.B \-\-scenario <name>
|
|
5769
|
-
Scenario each mock serves, sent as both pm\-mock\-scenario and x\-mock\-scenario. (default: default)
|
|
5818
|
+
Scenario each mock serves, sent as both pm\-mock\-scenario and x\-mock\-scenario. A member that defines no scenario by this name serves its default. (default: default)
|
|
5770
5819
|
.TP
|
|
5771
5820
|
.B \-\-session <id>
|
|
5772
5821
|
Session id to select via the x\-mock\-session header (default: a generated id).
|
|
5773
5822
|
.TP
|
|
5774
5823
|
.B \-\-log\-format <format>
|
|
5775
|
-
Proxy request log format: text or json. (default: text)
|
|
5824
|
+
Proxy request log format: text or json. Each line carries the method, host, path, destination (a routeKey, or "passthrough"), status and duration; json adds a timestamp, the scenario and the session. (default: text)
|
|
5776
5825
|
.TP
|
|
5777
5826
|
.B \-\-log\-body
|
|
5778
5827
|
Also log each response body (truncated). Buffers full responses in memory; meant for temporary debugging, not left on by default.
|
|
5779
5828
|
.TP
|
|
5780
5829
|
.B \-\-doctor
|
|
5781
5830
|
Start the proxy, probe each available HTTP client (fetch/undici/axios/node\-fetch) to confirm it honors HTTP_PROXY/HTTPS_PROXY, then exit.
|
|
5831
|
+
.TP
|
|
5832
|
+
.B \-\-lift <cmd>
|
|
5833
|
+
Start this command behind the proxy with HTTP_PROXY, HTTPS_PROXY and NODE_EXTRA_CA_CERTS already set in its environment, instead of printing them for you to export by hand. Runs as a child process, so the variables reach the code making the calls rather than the CLI. The proxy lives exactly as long as the command and exits with its exit code.
|
|
5782
5834
|
|
|
5783
5835
|
.TP Examples:
|
|
5784
5836
|
|
|
@@ -5793,8 +5845,14 @@ Start history (source: cli): a simulation\-id run records automatically (the id
|
|
|
5793
5845
|
|
|
5794
5846
|
Eg. postman simulation run ./postman/simulations/checkout/checkout.sim.yaml \-\-proxy
|
|
5795
5847
|
postman simulation run ./postman/simulations/checkout/checkout.sim.yaml \-\-proxy \-\-doctor
|
|
5848
|
+
postman simulation run ./postman/simulations/checkout/checkout.sim.yaml \-\-proxy \e
|
|
5849
|
+
\-\-lift "npm start" # starts npm with the proxy variables already set
|
|
5850
|
+
|
|
5851
|
+
\-\-proxy reads the same .sim.yaml, starts the mocks on throwaway ports behind the proxy, and records no start history. The hostnames a member stands in for are its `origin:` in the .sim.yaml, as a string or a list, and a member with none is never matched, so its host reaches the real service. `simulation create` copies that value from the mock's own manifest, which is where it is declared — so adding an `origin:` to a manifest does not change a .sim.yaml that already exists. Edit the member, or recreate the simulation.
|
|
5852
|
+
|
|
5853
|
+
Because the mocks sit on throwaway ports, a manifest's own `port` is ignored. A member that does not answer within 30s gives 504 and one that cannot be reached gives 502. Ctrl+C prints the total, mocked and passed\-through request counts.
|
|
5796
5854
|
|
|
5797
|
-
\-\-proxy
|
|
5855
|
+
Every \-\-proxy\-* flag, plus \-\-scenario, \-\-session, \-\-log\-format, \-\-log\-body, \-\-doctor and \-\-lift, is inert without \-\-proxy and passing one alone is a usage error (exit 2), as is an unsupported \-\-log\-format.
|
|
5798
5856
|
|
|
5799
5857
|
|
|
5800
5858
|
.SS "simulation push"
|
package/package.json
CHANGED
|
@@ -1,50 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "postman-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.80.0",
|
|
4
4
|
"description": "Official Postman CLI - Command-line companion for API development, testing, and automation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"postman",
|
|
7
|
+
"postman-cli",
|
|
8
|
+
"postman-collection",
|
|
9
|
+
"newman",
|
|
7
10
|
"cli",
|
|
8
11
|
"api",
|
|
9
|
-
"
|
|
10
|
-
"automation",
|
|
11
|
-
"rest",
|
|
12
|
-
"newman",
|
|
13
|
-
"api-testing",
|
|
12
|
+
"api-engineering",
|
|
14
13
|
"api-development",
|
|
15
|
-
"
|
|
16
|
-
"continuous-integration",
|
|
17
|
-
"postman-cli",
|
|
14
|
+
"rest-api",
|
|
18
15
|
"api-client",
|
|
19
16
|
"http-client",
|
|
17
|
+
"api-testing",
|
|
20
18
|
"api-automation",
|
|
21
|
-
"collection-runner",
|
|
22
|
-
"postman-collection",
|
|
23
|
-
"api-governance",
|
|
24
|
-
"api-security",
|
|
25
|
-
"api-linting",
|
|
26
|
-
"api-validation",
|
|
27
19
|
"contract-testing",
|
|
28
20
|
"schema-validation",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
21
|
+
"openapi",
|
|
22
|
+
"openapi-lint",
|
|
23
|
+
"api-governance",
|
|
24
|
+
"mock-server",
|
|
25
|
+
"api-mocking",
|
|
26
|
+
"service-virtualization",
|
|
27
|
+
"api-simulation",
|
|
28
|
+
"fault-injection",
|
|
29
|
+
"load-testing",
|
|
30
|
+
"performance-testing",
|
|
31
|
+
"api-monitoring",
|
|
32
|
+
"webhook-testing",
|
|
33
|
+
"api-discovery",
|
|
34
|
+
"api-documentation",
|
|
35
|
+
"dependency-graph",
|
|
36
|
+
"secrets-manager",
|
|
37
|
+
"ci-cd",
|
|
31
38
|
"github-actions",
|
|
32
|
-
"gitlab-ci",
|
|
33
|
-
"azure-devops",
|
|
34
|
-
"jenkins",
|
|
35
|
-
"circleci",
|
|
36
|
-
"integration-testing",
|
|
37
|
-
"functional-testing",
|
|
38
|
-
"test-reports",
|
|
39
39
|
"junit-reports",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"postman-runner",
|
|
44
|
-
"postman-monitor",
|
|
45
|
-
"rest-api",
|
|
46
|
-
"http-testing",
|
|
47
|
-
"api-tools"
|
|
40
|
+
"ai-agents",
|
|
41
|
+
"coding-agents",
|
|
42
|
+
"agent-skills"
|
|
48
43
|
],
|
|
49
44
|
"bin": {
|
|
50
45
|
"postman": "bin/postman.js"
|
|
@@ -62,10 +57,10 @@
|
|
|
62
57
|
"scripts/"
|
|
63
58
|
],
|
|
64
59
|
"optionalDependencies": {
|
|
65
|
-
"@postman/pm-bin-macos-arm64": "1.
|
|
66
|
-
"@postman/pm-bin-macos-x64": "1.
|
|
67
|
-
"@postman/pm-bin-linux-x64": "1.
|
|
68
|
-
"@postman/pm-bin-linux-arm64": "1.
|
|
69
|
-
"@postman/pm-bin-windows-x64": "1.
|
|
60
|
+
"@postman/pm-bin-macos-arm64": "1.80.0",
|
|
61
|
+
"@postman/pm-bin-macos-x64": "1.80.0",
|
|
62
|
+
"@postman/pm-bin-linux-x64": "1.80.0",
|
|
63
|
+
"@postman/pm-bin-linux-arm64": "1.80.0",
|
|
64
|
+
"@postman/pm-bin-windows-x64": "1.80.0"
|
|
70
65
|
}
|
|
71
66
|
}
|