postman-cli 1.84.0 → 1.86.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.
Files changed (3) hide show
  1. package/README.md +154 -47
  2. package/man/postman.1 +231 -13
  3. package/package.json +6 -6
package/README.md CHANGED
@@ -4,9 +4,11 @@
4
4
 
5
5
  # Postman CLI
6
6
 
7
- **API engineering for your agents.** Go faster from development to production.
7
+ **API engineering for your agents.** Go faster from development to production with higher accuracy and fewer tokens.
8
8
 
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.
9
+ Requests, collections, specs, functional and performance tests, mocks, simulations and monitors for coding agents, terminals and CI pipelines.
10
+
11
+ [Docs](https://learning.postman.com/docs/postman-cli/postman-cli-overview/) · [Coding agent plugins](https://learning.postman.com/docs/reference/developer-resources/postman-plugin) · [Command reference](https://learning.postman.com/docs/postman-cli/postman-cli-options/) · [Release notes](https://www.postman.com/release-notes/postman-cli/)
10
12
 
11
13
  ## Install
12
14
 
@@ -21,7 +23,8 @@ Without Node.js:
21
23
  curl -o- "https://dl-cli.pstmn.io/install/unix.sh" | sh
22
24
 
23
25
  # Windows (PowerShell)
24
- powershell -NoP -NonI -c "irm https://dl-cli.pstmn.io/install/win64.ps1 | iex"
26
+ powershell -NoP -NonI -c `
27
+ "irm https://dl-cli.pstmn.io/install/win64.ps1 | iex"
25
28
  ```
26
29
 
27
30
  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.
@@ -29,25 +32,43 @@ The Postman desktop app includes the CLI. Update with `postman update`. See the
29
32
  ## Quick start
30
33
 
31
34
  ```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
+ # Set up the repo, install agent skills, link a workspace
36
+ postman init
37
+
38
+ # Send a request
39
+ postman request GET https://api.example.com/health
40
+
41
+ # Run a collection and its tests
42
+ postman collection run postman/collections/orders
35
43
  ```
36
44
 
45
+ ## What `postman init` sets up
46
+
47
+ `postman init` turns a repo into a Postman project that agents and teammates can build on.
48
+
49
+ - **API work as files in git.** Collections, specs, environments, mocks and simulations live under `postman/`, next to your code ([Native Git](https://learning.postman.com/docs/use/native-git/overview/)). An existing OpenAPI or AsyncAPI spec is adopted as it is.
50
+ - **Agent skills in the repo.** Skills under `postman/skills/` and a pointer in `AGENTS.md` show coding agents how to build and test the API with the CLI.
51
+ - **A linked Postman workspace.** `.postman/resources.yaml` connects the repo to a workspace, so collections, monitors and mocks have a shared home from the first command.
52
+ - **Context that carries over.** Run results, pushes with their messages, and who or which agent did what are saved to the workspace. The next session, agent or teammate picks up from there with `postman workspace context`, and the same context keeps your API Catalog and Context Graph current.
53
+ - **The same setup in CI.** Builds reuse the workspace recorded in `.postman/resources.yaml`.
54
+
55
+ Run `postman init --dry-run` to see what it will do first. See [`postman init`](https://learning.postman.com/docs/postman-cli/postman-cli-init/).
56
+
37
57
  ## Agent skills
38
58
 
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`.
59
+ `postman init` installs Postman's agent skills in `postman/skills/` and adds a pointer to them in `AGENTS.md`. `postman update` updates the CLI and the repo's skills. `postman status` shows the CLI version, skills, account and plugin state.
40
60
 
41
61
  | Skill | What you get |
42
62
  |---|---|
43
63
  | `api-discovery` | Reuse the APIs your organization already has, and see what depends on one before you change it |
44
64
  | `api-testing` | A repeatable test for every change, so regressions surface in review |
45
65
  | `api-mocking` | Build against agreed behaviour before the real API or its dependencies exist |
66
+ | `api-simulation` | Test against a realistic environment, including the failures real services won't produce on demand |
46
67
  | `api-monitoring` | The same tests that passed in development, running against production |
47
68
  | `ci-integration` | Merges that fail on a broken test, contract or governance rule |
48
69
  | `performance-testing` | Releases gated on latency and error-rate thresholds |
49
70
 
50
- [See all skills](https://github.com/postmanlabs/postman-plugin/tree/main/skills).
71
+ [See all skills](https://learning.postman.com/docs/postman-plugin/skills/).
51
72
 
52
73
  ## Usage
53
74
 
@@ -55,33 +76,48 @@ The examples below cover common tasks. For the full reference, run `man postman`
55
76
 
56
77
  ### Requests
57
78
 
79
+ Send requests while you develop, with assertions on each response, secret variables kept out of the command line, and the request's context retained for later testing and verification.
80
+
58
81
  ```bash
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" \
82
+ postman request POST http://localhost:3000/auth/token \
83
+ --body @creds.json --response-only
84
+
85
+ postman request PATCH http://localhost:3000/orders/42 \
86
+ --auth-bearer-token "$TOKEN" \
61
87
  --body '{"status":"shipped"}' \
62
- --script-post-request "pm.test('200', () => pm.response.to.have.status(200))"
88
+ --script-post-request "pm.test('ok', () => pm.response.to.be.ok)"
63
89
  ```
64
90
 
65
- Exits `0` on a 2xx or 3xx response with all tests passing. Otherwise exits with the number of failed tests.
91
+ Exits `0` on a 2xx or 3xx response with all tests passing. Otherwise exits with the number of failed tests. See [`postman request`](https://learning.postman.com/docs/postman-cli/postman-cli-requests/).
66
92
 
67
93
  ### Collections and specs
68
94
 
95
+ Turn specs and ad hoc requests into collections, lint specs against your governance rules, and run collections as repeatable test suites locally or in CI with the [Collection Runner](https://www.postman.com/product/collection-runner/) and [Spec Hub](https://www.postman.com/product/spec-hub/).
96
+
69
97
  ```bash
70
98
  postman spec lint ./openapi.yaml
71
- postman spec generate collection ./openapi.yaml --name "Orders API"
99
+ postman spec generate collection ./openapi.yaml \
100
+ --name "Orders API"
72
101
  postman collection import ./login.curl
73
- postman collection run ./postman/collections/orders -e ./postman/environments/dev.environment.yaml
102
+ postman collection run postman/collections/orders \
103
+ -e postman/environments/dev.environment.yaml
74
104
  ```
75
105
 
76
106
  ### Mocks
77
107
 
108
+ Reproduce how an API behaves, not just what it returns. A Code Mock keeps state across requests, validates incoming calls and runs named scenarios, so it becomes a dependency you control without running another service.
109
+
78
110
  ```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"
111
+ # From an OpenAPI spec or collection; --mode ai adds realistic data
112
+ postman mock generate specs/payments.yaml --stateful
113
+
114
+ postman mock run postman/mocks/payments --port 4010
115
+
116
+ postman collection run postman/collections/checkout \
117
+ --use-mock "{{paymentsUrl}} mock:postman/mocks/payments"
82
118
  ```
83
119
 
84
- A mock is a Node.js request handler in `postman/mocks/<name>/`. Use `pm.state` to keep state between requests:
120
+ A mock is a Node.js request handler in `postman/mocks/<name>/`, versioned and reviewed with your code. Use `pm.state` to keep state between requests:
85
121
 
86
122
  ```js
87
123
  const http = require("http");
@@ -89,34 +125,91 @@ http.createServer(async (req, res) => {
89
125
  const key = req.headers["idempotency-key"];
90
126
  const seen = await pm.state.get(key);
91
127
  if (seen) return res.end(JSON.stringify(seen));
92
- if (req.headers["x-test"] === "429") { res.writeHead(429); return res.end(); }
128
+ if (req.headers["x-test"] === "429") {
129
+ res.writeHead(429); return res.end();
130
+ }
93
131
  const charge = { id: "ch_" + Date.now(), status: "succeeded" };
94
132
  await pm.state.set(key, charge);
95
133
  res.writeHead(201); res.end(JSON.stringify(charge));
96
134
  });
97
135
  ```
98
136
 
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.
137
+ `--use-mock` points every request to `{{paymentsUrl}}` at the local mock for the length of the run. `pm.state` persists across requests and runs until `pm.state.clear()`. `postman mock run --output ndjson` streams one JSON event per request for CI.
138
+
139
+ Named scenarios in `config.yaml` add delays, failures, alternate responses and rate limits. Select one per request with the `x-mock-scenario` header. Add `pm.test` inside a mock to check that callers stay within the contract. Deploy a mock with `postman mock deploy` to share it as a mock server with a durable URL, isolated sessions and request logs (`postman mock log`). See [mocks](https://learning.postman.com/docs/design-apis/mock-apis/local-mock-servers/).
140
+
141
+ ### Simulations
142
+
143
+ Bring up the whole dependency chain your service calls in seconds, from files in your repo. Mix simulated and real services, switch scenarios as you change code, and let agents develop against it faster than real time.
144
+
145
+ ```bash
146
+ postman simulation create -n "Checkout" \
147
+ --mock postman/mocks/payments \
148
+ --mock postman/mocks/orders \
149
+ -o checkout.sim.yaml
150
+
151
+ # Every mock behind one local port
152
+ postman simulation run checkout.sim.yaml
153
+
154
+ # Reach mocks by hostname, with no code changes
155
+ postman simulation run checkout.sim.yaml --proxy \
156
+ --scenario timeout --lift "npm test"
157
+ ```
158
+
159
+ A simulation is a `.sim.yaml` file that combines mocks and their routing. With `--proxy`, requests to each mock's `origin` hostname, such as `api.stripe.com`, reach the mock, and all other traffic goes to its real destination, so you only simulate what you choose. `--lift` starts your command with the proxy already configured. Multiple agents can run their own simulations at the same time without interfering with each other.
100
160
 
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).
161
+ A context file beside each simulation records the assumptions your code relies on, what was observed and where it came from, including what has and hasn't been verified. The next run, agent or teammate starts from what is already established instead of rediscovering it. Simulations catch problems earlier; they don't replace a final check against the real services.
162
+
163
+ Add `--deploy` to `postman simulation create` to share the whole environment as one mock server with the same routing. See [Postman Simulator](https://learning.postman.com/docs/design-apis/simulate-conditions/overview/).
102
164
 
103
165
  ### Performance tests
104
166
 
167
+ Find out how the API and its business logic hold up under load before you ship, and fail the release when they don't meet your thresholds.
168
+
105
169
  ```bash
106
- postman performance run ./postman/collections/checkout \
170
+ postman performance run postman/collections/checkout \
107
171
  --peak-vu 200 --duration 5 --load-profile fixed \
108
- --pass-if "less_than(p95, 300)" --pass-if "less_than(error_rate, 1)" \
172
+ --pass-if "less_than(p95, 300)" \
173
+ --pass-if "less_than(error_rate, 1)" \
174
+ --pass-if "less_than(failure_rate, 1)" \
109
175
  --output ndjson
110
176
  ```
111
177
 
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.
178
+ `--duration` is in minutes, and `--load-profile` takes `fixed`, `ramp-up`, `spike` or `peak`. A failed `--pass-if` exits `1`, which fails the CI job. Thresholds can use `avg`, `p90`, `p95`, `p99`, `error_rate`, `failure_rate` and `rps`. Load runs from the local machine by default. Use `--runner postman-cloud` to generate load from Postman's cloud runners.
179
+
180
+ The `pm.test()` assertions in your collection run on every iteration under load. `failure_rate` is the percentage of request executions with a failing test, so an agent can tell whether the logic still holds at 200 users without working through traces and metrics. In Postman, the run's [Tests tab](https://learning.postman.com/docs/tests-and-scripts/performance-testing/test-assertions/overview/) shows each assertion against the number of virtual users, so you can see where it starts to fail. See [Performance Testing](https://www.postman.com/product/performance-testing/).
181
+
182
+ ### Datasets
183
+
184
+ Bring test data from the files and databases you already use, query it with SQL, and reuse it on every run. Agents get the same data for repeated testing, and can add synthetic data as CSV or JSON sources when real data isn't available.
185
+
186
+ ```bash
187
+ postman dataset create users.dataset.yaml --name "Users"
188
+
189
+ postman dataset source add -d users.dataset.yaml \
190
+ -n users --file users.csv
191
+
192
+ postman dataset query users.dataset.yaml \
193
+ -q "SELECT * FROM users LIMIT 5"
194
+
195
+ postman dataset view create -d users.dataset.yaml -n active \
196
+ -q "SELECT * FROM users WHERE active = 1"
197
+
198
+ postman collection run postman/collections/orders \
199
+ --iteration-data-dataset users.dataset.yaml \
200
+ --iteration-data-view active
201
+ ```
202
+
203
+ Sources can be CSV, JSON and spreadsheet files, or MySQL, PostgreSQL, SQL Server and other JDBC databases, with credentials taken from Shared Vault. The same dataset feeds collection runs, performance tests, monitors and mocks. See [Datasets](https://learning.postman.com/docs/tests-and-scripts/datasets/overview/).
113
204
 
114
205
  ### Monitors
115
206
 
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.
207
+ Keep running the tests that passed in development against production, on a schedule, and hear about failures first with [Monitors](https://www.postman.com/product/monitors/).
117
208
 
118
209
  ```bash
119
- postman monitor create --collection <collection-id> --schedule "*/5 * * * *" --notify-email oncall@example.com
210
+ postman monitor create --collection <collection-id> \
211
+ --schedule "*/5 * * * *" \
212
+ --notify-email oncall@example.com
120
213
  postman monitor run <monitor-id>
121
214
  postman monitor jobs list <monitor-id> --result failure
122
215
  ```
@@ -125,48 +218,59 @@ Send alerts to email or any of Postman's [monitor integrations](https://www.post
125
218
 
126
219
  ### Secrets
127
220
 
221
+ Use API keys and tokens in requests and runs without putting them in your code, your shell history or your agent's context.
222
+
128
223
  ```bash
129
224
  postman secret create PAYMENTS_API_KEY
130
- postman environment var set api_key --secret-id <id> -e ./postman/environments/staging.environment.yaml
225
+ postman environment var set api_key --secret-id <id> \
226
+ -e postman/environments/staging.environment.yaml
131
227
  ```
132
228
 
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.
229
+ Secret values are entered in a one-time browser form and stored in your team's [Shared Vault](https://learning.postman.com/docs/use/postman-vault/postman-vault-key/#postman-shared-vault). The CLI never prints them, and coding agents never see them.
134
230
 
135
231
  ### Workspace context
136
232
 
233
+ Share what was built and tested with the next person or agent in a [Postman workspace](https://www.postman.com/product/workspaces/), so they start from the work already done.
234
+
137
235
  ```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
236
+ postman workspace push --yes -m "Add refunds endpoint and tests"
237
+
238
+ # What the workspace holds and how it relates
239
+ postman workspace context
240
+
241
+ # Recent push messages, one line each
242
+ postman workspace activity --type workspacePush --limit 5 --brief
243
+
141
244
  postman workspace pull
142
245
  ```
143
246
 
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.
247
+ Use `-m` to record what changed. `workspace context` lists the workspace's collections, environments, monitors, mocks, specs and flows, and which monitors run which collections. `workspace activity` shows each change 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
248
 
146
249
  ### Context Graph
147
250
 
251
+ Find out what depends on an API, and what a change will break, before you make it.
252
+
148
253
  ```bash
149
- postman context-graph ask "What depends on the billing service's invoice response?" --wait --json
254
+ postman context-graph ask \
255
+ "What depends on the billing service's invoice response?" \
256
+ --wait --json
150
257
  ```
151
258
 
152
259
  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
260
 
154
261
  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
262
 
156
- ### Public APIs
263
+ ### Public APIs using Orbit
264
+
265
+ Integrate third-party APIs with instructions drawn from their live schemas, from auth to known gotchas.
157
266
 
158
267
  [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.
159
268
 
160
269
  ```bash
161
- claude mcp add --transport http orbit https://mcp.buildwithorbit.ai/mcp
270
+ claude mcp add --transport http orbit \
271
+ https://mcp.buildwithorbit.ai/mcp
162
272
  ```
163
273
 
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 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
274
  ## Accounts
171
275
 
172
276
  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.
@@ -175,7 +279,7 @@ All capabilities are available without signing in. Signing in associates your wo
175
279
  postman whoami
176
280
  postman signup
177
281
  postman login
178
- postman login --with-api-key <api-key> # or set POSTMAN_API_KEY
282
+ postman login --with-api-key <api-key> # or set POSTMAN_API_KEY
179
283
  ```
180
284
 
181
285
  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/).
@@ -185,15 +289,19 @@ The CLI supports Postman's EU region for teams whose data is hosted in the EU. S
185
289
  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
290
 
187
291
  ```bash
188
- npx @postman/postman-plugin # every agent on this machine
292
+ # Every agent on this machine
293
+ npx @postman/postman-plugin
189
294
 
190
- claude plugin marketplace add anthropics/claude-plugins-official # Claude Code
295
+ # Claude Code
296
+ claude plugin marketplace add anthropics/claude-plugins-official
191
297
  claude plugin install postman@claude-plugins-official
192
298
 
193
- codex plugin marketplace add postmanlabs/postman-plugin # Codex
299
+ # Codex
300
+ codex plugin marketplace add postmanlabs/postman-plugin
194
301
  codex plugin add postman@postman
195
302
 
196
- /add-plugin postman # Cursor
303
+ # Cursor
304
+ /add-plugin postman
197
305
  ```
198
306
 
199
307
  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/).
@@ -203,7 +311,6 @@ Also available for OpenCode, GitHub Copilot CLI, Antigravity, Factory, Kimi Code
203
311
  - Authenticate with `POSTMAN_API_KEY` or `postman login --with-api-key`.
204
312
  - Commands exit non-zero on failure.
205
313
  - `--json` for machine-readable output, `--output ndjson` for streaming, `--yes` to skip prompts.
206
- - Collection run reporters: `cli`, `json`, `junit`, `html`.
207
314
  - `postman workspace diff --exit-code` fails when local files and the cloud workspace differ.
208
315
  - In CI, `postman init` uses the workspace recorded in `.postman/resources.yaml`.
209
316
  - GitHub Actions: [Postman CLI GitHub Action](https://learning.postman.com/docs/postman-cli/postman-cli-github-actions).
package/man/postman.1 CHANGED
@@ -1,4 +1,4 @@
1
- .TH POSTMAN 1 "2026-11-02" "v1.84.0" "Postman CLI Manual"
1
+ .TH POSTMAN 1 "2026-11-04" "v1.86.0" "Postman CLI Manual"
2
2
  .SH NAME
3
3
  postman \- Command\-line companion utility for Postman
4
4
  .SH SYNOPSIS
@@ -3902,7 +3902,7 @@ Workspace that owns the shared vault for the collection's v12 secret variables.
3902
3902
 
3903
3903
  Examples:
3904
3904
  postman performance run 123456\-45159473\-1e45\-1f34\-5678\-1234567890ab # defaults: 20 VUs, ramp\-up, 1 minute
3905
- postman performance run "postman/collections/My Collection" \-\-peak\-vu 10 \-\-duration 2 # a local collection, recorded only when git\-linked
3905
+ postman performance run "postman/collections/My Collection" \-\-peak\-vu 10 \-\-duration 2 # local files, unrecorded even when git\-linked
3906
3906
  postman performance run <collectionId> \-\-load\-profile fixed \-\-peak\-vu 50 \-\-duration 15 # 50 VUs, flat
3907
3907
  postman performance run <collectionId> \-\-load\-profile spike \-\-peak\-vu 100 \-\-base\-vu 2 \-\-duration 5 \-\-load\-segments 1m30s,20s,40s
3908
3908
  postman performance run <collectionId> \-\-pass\-if "less_than(p95, 500)" \-\-pass\-if "less_than(error_rate, 5)" # fail if p95 is over 500ms or error rate is over 5%
@@ -5185,11 +5185,14 @@ Create, run, and manage Postman mocks — in your repository or in Postman cloud
5185
5185
  .B Subcommands:
5186
5186
  .TP
5187
5187
  .B mock generate
5188
- 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.
5188
+ Generate a mock from a Postman collection, an OpenAPI file or a dataset, or a static mock from a built\-in sample shopping cart (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.
5189
5189
  .TP
5190
5190
  .B mock run
5191
5191
  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).
5192
5192
  .TP
5193
+ .B mock stop
5194
+ Stop a mock started with `postman mock run` on this machine, and wait until it has exited and released its port.
5195
+ .TP
5193
5196
  .B mock push
5194
5197
  Upload a mock from your repository to Postman cloud (creates it the first time, updates it after).
5195
5198
  .TP
@@ -5209,7 +5212,7 @@ Show the requests a live mock server has received and the responses it sent, usi
5209
5212
  Delete a mock using its path if it lives in your repository, or its id if it lives in Postman cloud. Cannot be undone.
5210
5213
 
5211
5214
  .SS "mock generate"
5212
- 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.
5215
+ Generate a mock from a Postman collection, an OpenAPI file or a dataset, or a static mock from a built\-in sample shopping cart (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.
5213
5216
 
5214
5217
  .B Usage:
5215
5218
  [sourcePath] [options]
@@ -5220,10 +5223,10 @@ Generate a mock from a Postman collection, an OpenAPI file or a dataset, or from
5220
5223
  Folder to save the mock in. Relative or absolute, e.g. ./postman/mocks/orders. Defaults to postman/mocks/<name>.
5221
5224
  .TP
5222
5225
  .B \-n, \-\-name <name>
5223
- Name for the mock. Taken from the source when you provide one; required for the sample.
5226
+ Name for the mock. Taken from the source when you provide one; required for the sample. With \-\-update, renames the mock.
5224
5227
  .TP
5225
5228
  .B \-\-port <port>
5226
- Port the mock runs on (e.g. 4010) (default: 4500)
5229
+ Port the mock runs on (e.g. 4010; default 4500). With \-\-update, changes the mock's port.
5227
5230
  .TP
5228
5231
  .B \-\-mode <mode>
5229
5232
  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`).
@@ -5232,7 +5235,10 @@ How the mock behaves: static (replays examples, the default), stateful (keeps re
5232
5235
  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.
5233
5236
  .TP
5234
5237
  .B \-\-instructions <text>
5235
- With \-\-mode ai: guidance for the AI, e.g. "Orders can only be cancelled before they ship".
5238
+ With \-\-mode ai: guidance for the AI, up to 2000 characters, e.g. "Orders can only be cancelled before they ship". Recorded with the mock, so \-\-update reuses them.
5239
+ .TP
5240
+ .B \-\-strict
5241
+ With \-\-mode ai: fail instead of falling back. Postman refuses a mock it would build without AI (exit 1, nothing written or saved). A mock whose AI rules reached only some operations, or one an older Postman built without AI anyway, is kept but exits 4.
5236
5242
  .TP
5237
5243
  .B \-\-spec <specId>
5238
5244
  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.
@@ -5244,22 +5250,22 @@ Generate from a collection in Postman (by id) instead of a local file. With \-\-
5244
5250
  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.
5245
5251
  .TP
5246
5252
  .B \-\-force
5247
- Overwrite the mock's files if the target folder already has one
5253
+ Replace the mock's files if the target folder already holds a mock. A folder with other files and no mock is never written to.
5248
5254
  .TP
5249
- .B \-u, \-\-update <mockPath>
5250
- 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.
5255
+ .B \-u, \-\-update <mockPathOrId>
5256
+ Regenerate an existing mock in place: one in your repository by path (e.g. ./postman/mocks/orders), or one in Postman cloud by id. Without a source or \-\-mode, it uses the ones the mock recorded (and an ai mock's instructions). Cannot be used with \-\-output.
5251
5257
  .TP
5252
5258
  .B \-w, \-\-workspace <id>
5253
- 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.
5259
+ Save the mock to this Postman cloud workspace (by id) instead of your repository. Cannot be used with \-\-output, \-\-force, or \-\-update <mockPath>; with \-\-deploy it only picks the workspace, and with \-\-update <cloudMockId> it names the workspace the mock is in.
5254
5260
  .TP
5255
5261
  .B \-\-deploy
5256
5262
  After generating, upload the mock to Postman cloud and deploy it to a live mock server (private by default). Uses \-\-workspace, else the workspace linked to this project.
5257
5263
  .TP
5258
5264
  .B \-\-public
5259
- With \-\-deploy, let anyone with the link reach the server (default: callers need an API key)
5265
+ With \-\-deploy, let anyone with the link reach the server (default: callers need an API key). Requires \-\-deploy.
5260
5266
  .TP
5261
5267
  .B \-s, \-\-slug <slug>
5262
- With \-\-deploy, the short label used in the server's web address
5268
+ With \-\-deploy, the short label used in the server's web address. Requires \-\-deploy.
5263
5269
  .TP
5264
5270
  .B \-\-timeout <ms>
5265
5271
  How long to wait for Postman to generate the mock, in milliseconds (default 75000).
@@ -5284,6 +5290,7 @@ Eg. postman mock generate ./my\-collection.json
5284
5290
  postman mock generate ./openapi.yaml \-\-stateful # CRUD handlers backed by pm.state
5285
5291
  postman mock generate ./openapi.yaml \-\-mode ai \-\-instructions "Orders ship in 2 days"
5286
5292
  postman mock generate \-\-spec <specId> \-\-mode stateful \-w <workspaceId> # linked cloud mock
5293
+ postman mock generate \-\-update <cloudMockId> # regenerate a cloud mock from its linked source
5287
5294
  postman mock generate \-\-dataset ./postman/datasets/shop/shop.dataset.yaml # rows as records
5288
5295
  postman mock generate \-\-update ./postman/mocks/orders # regenerate from its recorded source
5289
5296
  postman mock generate \-\-spec <specId> \-\-mode ai \-o ./postman/mocks/orders \-\-json
@@ -5348,6 +5355,29 @@ use \-\-no\-history to opt out.
5348
5355
  Paths can be relative (e.g. ./postman/mocks/orders) or absolute (e.g. /Users/me/postman/mocks/orders).
5349
5356
 
5350
5357
 
5358
+ .SS "mock stop"
5359
+ Stop a mock started with `postman mock run` on this machine, and wait until it has exited and released its port.
5360
+
5361
+ .B Usage:
5362
+ <mockIdOrPath> [options]
5363
+
5364
+ .B Options:
5365
+ .TP
5366
+ .B \-\-timeout <seconds>
5367
+ Seconds to wait for a graceful shutdown before force\-killing the mock (default 15)
5368
+ .TP
5369
+ .B \-\-json
5370
+ Print the result as machine\-readable data
5371
+
5372
+ .TP Examples:
5373
+
5374
+ Eg. postman mock stop ./postman/mocks/orders # by the path passed to mock run
5375
+ postman mock stop 12345678\-90ab\-cdef\-1234\-567890abcdef # by the cloud id passed to mock run
5376
+ postman mock stop ./postman/mocks/orders \-\-timeout 5
5377
+
5378
+ The mock is sent SIGTERM so it shuts down the same way as Ctrl+C, then SIGKILL if it is still running after \-\-timeout. The command returns once the process has exited and its port is free. Stopping a mock that is not running succeeds.
5379
+
5380
+
5351
5381
  .SS "mock push"
5352
5382
  Upload a mock from your repository to Postman cloud (creates it the first time, updates it after).
5353
5383
 
@@ -5750,6 +5780,9 @@ Show a simulation's details using its .sim.yaml path if it lives in your reposit
5750
5780
  .B simulation run
5751
5781
  Serve a simulation's mocks on one local port, routing each by its routeKey. Pass a .sim.yaml path (local) or a Postman simulation id (fetched and run locally).
5752
5782
  .TP
5783
+ .B simulation stop
5784
+ Stop a simulation started with `postman simulation run` on this machine, and wait until it has exited and released its port.
5785
+ .TP
5753
5786
  .B simulation push
5754
5787
  Upload a simulation from your repository to Postman cloud (creates it the first time, updates it after). Its member mocks are pushed too.
5755
5788
  .TP
@@ -5963,6 +5996,29 @@ Because the mocks sit on throwaway ports, a manifest's own `port` is ignored. A
5963
5996
  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.
5964
5997
 
5965
5998
 
5999
+ .SS "simulation stop"
6000
+ Stop a simulation started with `postman simulation run` on this machine, and wait until it has exited and released its port.
6001
+
6002
+ .B Usage:
6003
+ <simIdOrPath> [options]
6004
+
6005
+ .B Options:
6006
+ .TP
6007
+ .B \-\-timeout <seconds>
6008
+ Seconds to wait for a graceful shutdown before force\-killing the simulation (default 15)
6009
+ .TP
6010
+ .B \-\-json
6011
+ Print the result as machine\-readable data
6012
+
6013
+ .TP Examples:
6014
+
6015
+ Eg. postman simulation stop ./postman/simulations/checkout.sim.yaml # by the path passed to run
6016
+ postman simulation stop 12345678\-90ab\-cdef\-1234\-567890abcdef # by the id passed to run
6017
+ postman simulation stop ./simulation.yaml \-\-timeout 5
6018
+
6019
+ Pass the same id or path that was given to `simulation run`. The simulation is sent SIGTERM so it shuts down the same way as Ctrl+C, then SIGKILL if it is still running after \-\-timeout. The command returns once the process has exited and its port is free. Stopping a simulation that is not running succeeds.
6020
+
6021
+
5966
6022
  .SS "simulation push"
5967
6023
  Upload a simulation from your repository to Postman cloud (creates it the first time, updates it after). Its member mocks are pushed too.
5968
6024
 
@@ -7167,6 +7223,12 @@ Create or update scripts executed by a webhook.
7167
7223
  .TP
7168
7224
  .B webhook forward
7169
7225
  Forward incoming webhook requests to a local port.
7226
+ .TP
7227
+ .B webhook environment
7228
+ Get or set the cloud environment associated with a webhook.
7229
+ .TP
7230
+ .B webhook auth
7231
+ Get or set authentication for incoming webhook requests.
7170
7232
 
7171
7233
  .SS "webhook create"
7172
7234
  Create a new webhook and print its public URL.
@@ -7448,6 +7510,162 @@ Examples:
7448
7510
 
7449
7511
 
7450
7512
 
7513
+ .SS "webhook environment"
7514
+ Get or set the cloud environment associated with a webhook.
7515
+
7516
+ .B Usage:
7517
+ [options] [command]
7518
+
7519
+ .B Subcommands:
7520
+ .TP
7521
+ .B webhook environment get
7522
+ Print the associated cloud environment ID.
7523
+ .TP
7524
+ .B webhook environment set
7525
+ Associate a cloud environment ID with a webhook; local files are not supported.
7526
+
7527
+ .SS "webhook environment get"
7528
+ Print the associated cloud environment ID.
7529
+
7530
+ .B Usage:
7531
+ [options] <webhookId>
7532
+
7533
+ .B Options:
7534
+ .TP
7535
+ .B \-w, \-\-workspace <workspaceId>
7536
+ Postman workspace ID (falls back to .postman/resources.yaml or .postman/config.json)
7537
+ .TP
7538
+ .B \-\-api\-key <key>
7539
+ Postman API key for CLI authentication
7540
+ .TP
7541
+ .B \-\-timeout <ms>
7542
+ Request timeout in milliseconds (default: 30000)
7543
+ .TP
7544
+ .B \-\-json
7545
+ Print the result as JSON
7546
+
7547
+ .TP Examples:
7548
+
7549
+ Example:
7550
+ postman webhook environment get <webhookId>
7551
+
7552
+
7553
+
7554
+ .SS "webhook environment set"
7555
+ Associate a cloud environment ID with a webhook; local files are not supported.
7556
+
7557
+ .B Usage:
7558
+ [options] <webhookId> <environmentId>
7559
+
7560
+ .B Options:
7561
+ .TP
7562
+ .B \-w, \-\-workspace <workspaceId>
7563
+ Postman workspace ID (falls back to .postman/resources.yaml or .postman/config.json)
7564
+ .TP
7565
+ .B \-\-api\-key <key>
7566
+ Postman API key for CLI authentication
7567
+ .TP
7568
+ .B \-\-timeout <ms>
7569
+ Request timeout in milliseconds (default: 30000)
7570
+ .TP
7571
+ .B \-\-json
7572
+ Print the result as JSON
7573
+
7574
+ .TP Examples:
7575
+
7576
+ Example:
7577
+ postman webhook environment set <webhookId> 12345678\-00000000\-0000\-4000\-8000\-000000000000
7578
+
7579
+
7580
+
7581
+ .SS "webhook auth"
7582
+ Get or set authentication for incoming webhook requests.
7583
+
7584
+ .B Usage:
7585
+ [options] [command]
7586
+
7587
+ .B Subcommands:
7588
+ .TP
7589
+ .B webhook auth get
7590
+ Show webhook authentication details without credential values.
7591
+ .TP
7592
+ .B webhook auth set
7593
+ Set Basic or API key authentication, or disable authentication.
7594
+
7595
+ .SS "webhook auth get"
7596
+ Show webhook authentication details without credential values.
7597
+
7598
+ .B Usage:
7599
+ [options] <webhookId>
7600
+
7601
+ .B Options:
7602
+ .TP
7603
+ .B \-w, \-\-workspace <workspaceId>
7604
+ Postman workspace ID (falls back to .postman/resources.yaml or .postman/config.json)
7605
+ .TP
7606
+ .B \-\-api\-key <key>
7607
+ Postman API key for CLI authentication
7608
+ .TP
7609
+ .B \-\-timeout <ms>
7610
+ Request timeout in milliseconds (default: 30000)
7611
+ .TP
7612
+ .B \-\-json
7613
+ Print the result as JSON
7614
+
7615
+ .TP Examples:
7616
+
7617
+ Example:
7618
+ postman webhook auth get <webhookId>
7619
+
7620
+
7621
+
7622
+ .SS "webhook auth set"
7623
+ Set Basic or API key authentication, or disable authentication.
7624
+
7625
+ .B Usage:
7626
+ [options] <webhookId>
7627
+
7628
+ .B Options:
7629
+ .TP
7630
+ .B \-\-type <type>
7631
+ Authentication type
7632
+ .TP
7633
+ .B \-\-username <username>
7634
+ Basic auth username or variable reference
7635
+ .TP
7636
+ .B \-\-password <password>
7637
+ Basic auth password or variable reference
7638
+ .TP
7639
+ .B \-\-secret <secret>
7640
+ Webhook API key value or variable reference
7641
+ .TP
7642
+ .B \-\-source <source>
7643
+ Where incoming credentials are read (default: headers)
7644
+ .TP
7645
+ .B \-\-key <key>
7646
+ Header or query parameter name (default: Authorization for Basic, x\-api\-key for API key)
7647
+ .TP
7648
+ .B \-w, \-\-workspace <workspaceId>
7649
+ Postman workspace ID (falls back to .postman/resources.yaml or .postman/config.json)
7650
+ .TP
7651
+ .B \-\-api\-key <key>
7652
+ Postman API key for CLI authentication
7653
+ .TP
7654
+ .B \-\-timeout <ms>
7655
+ Request timeout in milliseconds (default: 30000)
7656
+ .TP
7657
+ .B \-\-json
7658
+ Print the result as JSON
7659
+
7660
+ .TP Examples:
7661
+
7662
+ Examples:
7663
+ postman webhook auth set <webhookId> \-\-type basic \-\-username '{{username}}' \-\-password '{{password}}'
7664
+ postman webhook auth set <webhookId> \-\-type api\-key \-\-secret '{{webhookApiKey}}'
7665
+ postman webhook auth set <webhookId> \-\-type none
7666
+
7667
+
7668
+
7451
7669
  .SS "dataset"
7452
7670
  Work with Postman datasets in local YAML files or the cloud.
7453
7671
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postman-cli",
3
- "version": "1.84.0",
3
+ "version": "1.86.0",
4
4
  "description": "Official Postman CLI - Command-line companion for API development, testing, and automation",
5
5
  "keywords": [
6
6
  "postman",
@@ -57,10 +57,10 @@
57
57
  "scripts/"
58
58
  ],
59
59
  "optionalDependencies": {
60
- "@postman/pm-bin-macos-arm64": "1.84.0",
61
- "@postman/pm-bin-macos-x64": "1.84.0",
62
- "@postman/pm-bin-linux-x64": "1.84.0",
63
- "@postman/pm-bin-linux-arm64": "1.84.0",
64
- "@postman/pm-bin-windows-x64": "1.84.0"
60
+ "@postman/pm-bin-macos-arm64": "1.86.0",
61
+ "@postman/pm-bin-macos-x64": "1.86.0",
62
+ "@postman/pm-bin-linux-x64": "1.86.0",
63
+ "@postman/pm-bin-linux-arm64": "1.86.0",
64
+ "@postman/pm-bin-windows-x64": "1.86.0"
65
65
  }
66
66
  }