@postman/postman-plugin 0.3.0 → 0.4.1-rc.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 +46 -9
- package/dist/hosts/antigravity.js +47 -0
- package/dist/hosts/codex-hooks.js +68 -0
- package/dist/hosts/codex.js +87 -8
- package/dist/hosts/copilot.js +60 -0
- package/dist/hosts/index.js +3 -1
- package/dist/json-rpc.js +113 -0
- package/dist/system.js +40 -3
- package/mcp.pi.json +2 -2
- package/package.json +1 -1
- package/skills/ai-readiness/SKILL.md +40 -44
- package/skills/api-discovery/SKILL.md +64 -145
- package/skills/api-discovery/reference/orbit.md +17 -5
- package/skills/api-documentation/SKILL.md +41 -46
- package/skills/api-engineer/SKILL.md +78 -23
- package/skills/api-mocking/SKILL.md +117 -163
- package/skills/api-monitoring/SKILL.md +52 -129
- package/skills/api-simulation/SKILL.md +130 -178
- package/skills/api-simulation/reference/sim_yaml_schema.md +41 -103
- package/skills/api-testing/SKILL.md +48 -95
- package/skills/bootstrap/SKILL.md +123 -224
- package/skills/ci-integration/SKILL.md +53 -113
- package/skills/collection-schema-v3/SKILL.md +43 -204
- package/skills/collection-schema-v3/reference/http.md +150 -0
- package/skills/datasets/SKILL.md +89 -315
- package/skills/datasets/reference/spreadsheets.md +25 -0
- package/skills/flows/SKILL.md +57 -206
- package/skills/flows/reference/flow_cli_flags.md +3 -2
- package/skills/performance-testing/SKILL.md +46 -62
- package/skills/performance-testing/references/jmeter-import/README.md +82 -0
- package/skills/performance-testing/references/jmeter-import/import-report.md +52 -0
- package/skills/performance-testing/references/jmeter-import/mapping-table.md +95 -0
- package/skills/performance-testing/references/jmeter-import/postman-perf-capabilities.md +56 -0
- package/skills/performance-testing/references/jmeter-import/script-translation.md +97 -0
- package/skills/postman-mcp-server/SKILL.md +53 -59
- package/skills/postman-mcp-server/references/docs.md +0 -1
- package/skills/postman-mcp-server/references/learn.md +10 -9
- package/skills/postman-mcp-server/references/mock.md +0 -1
- package/skills/postman-mcp-server/references/search.md +0 -1
- package/skills/postman-mcp-server/references/security.md +0 -1
- package/skills/postman-mcp-server/references/setup.md +0 -1
- package/skills/postman-mcp-server/references/sync.md +0 -1
- package/skills/postman-mcp-server/references/test.md +0 -1
- package/skills/variables/SKILL.md +44 -87
- package/skills/webhook-testing/SKILL.md +103 -0
- package/skills/webhook-testing/reference/forwarding.md +10 -0
- package/skills/webhook-testing/reference/outbound_webhooks.md +25 -0
- package/skills/webhook-testing/reference/webhook_scripts.md +163 -0
|
@@ -1,104 +1,57 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: api-testing
|
|
3
|
-
description:
|
|
3
|
+
description: Use when testing an endpoint, running collection assertions, or checking real application traffic against an API contract. Reuses saved requests and reports what live, mocked, or captured-traffic results actually establish. Use for requests such as "test this endpoint".
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# API Testing
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
Debugging a request's behavior during a run (why a `pm.test` failed, what a
|
|
53
|
-
request actually sends) means reading the request's own YAML — see the
|
|
54
|
-
`collection-schema-v3` skill for that file format before assuming a field's
|
|
55
|
-
shape.
|
|
56
|
-
|
|
57
|
-
Runs every request in a collection (or a subset via `-i`, repeatable),
|
|
58
|
-
executing whatever `pm.test` scripts are already saved in it.
|
|
59
|
-
`-d`/`--iteration-data` (or the beta `--iteration-data-dataset` +
|
|
60
|
-
`--iteration-data-view` pair) drives data-driven runs across a CSV/JSON
|
|
61
|
-
file or a Postman Dataset. `-r junit,html` for CI-consumable reports.
|
|
62
|
-
`--use-mock`/`--mock` redirects the run at a mock instead of a real backend
|
|
63
|
-
(see the `api-mocking` skill) — reach for this to test request/assertion
|
|
64
|
-
logic without depending on a live service.
|
|
65
|
-
|
|
66
|
-
## `application test` — contract-matching real traffic
|
|
67
|
-
|
|
68
|
-
This doesn't send its own requests. It runs your existing test command
|
|
69
|
-
(`--command "npx playwright test"`, or config-driven via
|
|
70
|
-
`postman.config.cjs` targets), captures the network traffic that command
|
|
71
|
-
generates, and matches/asserts it against your Postman collections —
|
|
72
|
-
answering "did my app's actual calls conform to the contract," not "does
|
|
73
|
-
this endpoint respond correctly." `--capture-only` skips the matching step
|
|
74
|
-
entirely and just exports what was captured as a new v3 collection,
|
|
75
|
-
organized by host — a way to bootstrap a collection from real traffic
|
|
76
|
-
rather than authoring one from scratch. Results are published to the connected
|
|
77
|
-
workspace after each run, so the evidence of the run outlives the terminal
|
|
78
|
-
session; `--report-events=false` keeps a run local when it shouldn't be
|
|
79
|
-
recorded.
|
|
80
|
-
|
|
81
|
-
## Critical Rules
|
|
82
|
-
|
|
83
|
-
1. **Don't reach for `application test` for something a plain
|
|
84
|
-
`collection run` covers.** It exists specifically for matching *captured*
|
|
85
|
-
app traffic (via Playwright or similar), not for driving requests itself.
|
|
86
|
-
2. **`postman request`'s exit code reflects failed `pm.test` assertions, not
|
|
87
|
-
HTTP status alone.** A nonzero exit on a 200 response usually means a
|
|
88
|
-
post-request script assertion failed, not a network problem.
|
|
89
|
-
3. **Assertions meant to be reused belong in the collection, not on the
|
|
90
|
-
command line.** A `--script-post-request` test on `collection run` runs
|
|
91
|
-
once and leaves nothing for the next person; save it as a `pm.test` in
|
|
92
|
-
the request instead.
|
|
93
|
-
4. **`--use-mock` is the way to test without a live backend** — prefer it
|
|
94
|
-
over standing up ad hoc fakes or skipping tests that need a dependency.
|
|
95
|
-
5. **Reuse a saved request instead of reconstructing it.** If a matching v3
|
|
96
|
-
request exists, use `collection run <collection-path> -i <request>`; reserve
|
|
97
|
-
`postman request` for genuinely ad-hoc requests.
|
|
8
|
+
Saved requests preserve the auth, payloads, variables, and assertions that make
|
|
9
|
+
an API check reproducible. The useful result is evidence about an intended
|
|
10
|
+
guarantee; a successful HTTP exchange alone does not establish correctness.
|
|
11
|
+
|
|
12
|
+
1. Choose the smallest execution mode that answers the question:
|
|
13
|
+
|
|
14
|
+
| Evidence needed | Use |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| One endpoint with no saved request | `postman request <url>` |
|
|
17
|
+
| Behavior of an existing saved request | `postman collection run <collection-path> -i <request-id-name-or-path>` |
|
|
18
|
+
| Reusable regression checks | `postman collection run <path-or-id>` |
|
|
19
|
+
| Whether a real app's calls match the contract | `postman application test` |
|
|
20
|
+
|
|
21
|
+
2. Reuse a matching request under `postman/collections/` before reconstructing
|
|
22
|
+
its HTTP fields. Running it through the collection retains inherited auth,
|
|
23
|
+
variables, and scripts. `postman request` takes a URL, not a request YAML
|
|
24
|
+
path; for an unsaved request with an existing payload file, `--body @path`
|
|
25
|
+
preserves that file as the source. See **collection-schema-v3** when
|
|
26
|
+
editing the saved request.
|
|
27
|
+
3. Derive assertions from the contract and the behavior at risk. A test that
|
|
28
|
+
merely repeats the current implementation can bless its bug. Preserve
|
|
29
|
+
existing guarantees and add checks for the changed behavior; put reusable
|
|
30
|
+
`pm.test` assertions in the collection so later runs and teammates inherit
|
|
31
|
+
them. Inline `--script-post-request` assertions suit a one-off check.
|
|
32
|
+
4. Choose a real or mocked target according to the claim. `--use-mock` lets a
|
|
33
|
+
collection run exercise request and assertion logic without a live
|
|
34
|
+
backend; `--mock` alone only starts one. `--use-mock` replaces the
|
|
35
|
+
variable's whole value, base path included (see **api-mocking**). Passing
|
|
36
|
+
against that mock does not verify the service the mock stands in for.
|
|
37
|
+
5. Reuse environment resolution with `-e` and **variables**. Use a CSV/JSON
|
|
38
|
+
file through `-d` for simple iteration; use **datasets** when the inputs
|
|
39
|
+
need queries, joins, or reusable views. Export reports such as
|
|
40
|
+
`-r junit,html` when **ci-integration** needs evidence beyond terminal output.
|
|
41
|
+
6. Use `application test` when the application's actual traffic is the subject.
|
|
42
|
+
It runs an existing command, such as `--command "npx playwright test"`,
|
|
43
|
+
captures its traffic, and matches it against collections. `--capture-only`
|
|
44
|
+
instead exports a v3 collection organized by host; that captures behavior
|
|
45
|
+
without validating it. Results are recorded in the connected workspace by
|
|
46
|
+
default; `--report-events=false` keeps the run local when required.
|
|
47
|
+
|
|
48
|
+
Use command-specific `-h` for supported options and **bootstrap** for unresolved
|
|
49
|
+
CLI setup or authentication when using workspace resources. A bare URL or
|
|
50
|
+
local collection does not require a workspace binding.
|
|
98
51
|
|
|
99
52
|
## Verification
|
|
100
53
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
54
|
+
Report the target, tested behavior, assertion counts, and exit code. The exit
|
|
55
|
+
code reflects failed assertions, not HTTP status alone: a 200 can fail a test.
|
|
56
|
+
For application testing, distinguish matching from capture-only mode, and for
|
|
57
|
+
mocked runs state which real behavior remains unverified.
|
|
@@ -1,230 +1,129 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: bootstrap
|
|
3
|
-
description:
|
|
3
|
+
description: Use when resolving Postman CLI setup, authentication, or a repository workspace binding; initializing local API files; handling a CLI error that says an operation isn't allowed because of insufficient entitlements; or importing, pulling, pushing, syncing, or sharing workspace resources. Reuses existing context and chooses sync direction without duplicating a workspace or rebinding a dependency. Use for requests such as "set up Postman for this repo".
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Bootstrap Postman for This Repo
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
Read `.postman/resources.yaml` for `localResources` and `workspace.id`, and
|
|
132
|
-
inspect the local `postman/` tree. When the user names an existing workspace or
|
|
133
|
-
asks to import, sync, or share one, use `workspace list --json` and `workspace
|
|
134
|
-
get <id> --elements --json` to confirm the workspace side. Also establish
|
|
135
|
-
whether that workspace owns the service represented by this repository. Never
|
|
136
|
-
create a second workspace merely because this repository is not connected yet,
|
|
137
|
-
and never replace this repository's binding with another service's workspace.
|
|
138
|
-
|
|
139
|
-
Prefer filesystem-first work. For the current service, materialize its existing
|
|
140
|
-
workspace with `workspace pull <id>`, or create and bind one with `postman init
|
|
141
|
-
--json --visibility <personal|team>` when no workspace exists. For another
|
|
142
|
-
service, use `postman dependency add <type> <name-or-id>` as described in
|
|
143
|
-
`api-discovery`. Then inspect, edit, diff, and validate the version-controlled
|
|
144
|
-
files before any push.
|
|
145
|
-
|
|
146
|
-
| Existing state and intent | Use | Why |
|
|
147
|
-
| --- | --- | --- |
|
|
148
|
-
| No workspace exists; create and bind one | `postman init --json --visibility <personal|team>` or `postman workspace create --visibility <value>` | Creates and binds the owning workspace; the init path also creates the git-native filesystem. |
|
|
149
|
-
| The current service's workspace exists; enable filesystem work in its repository | `postman workspace pull <workspace-id>` | Connects the owning workspace to the repository and materializes its entities under `postman/`. |
|
|
150
|
-
| The current service's workspace exists; record only the Git binding | `postman workspace connect-git <workspace-id> [path]` | Binds its repository without downloading its contents. |
|
|
151
|
-
| Another service's resource is needed here | `postman dependency add <type> <name-or-id>`; add `--workspace <workspace-id>` when resolving a name in a specific workspace | Declares and downloads only that collection, environment, or mock without rebinding this repository or pulling the other service's whole workspace. |
|
|
152
|
-
| Bound workspace; the workspace is authoritative | `postman workspace pull` | Refreshes local files from the connected workspace. |
|
|
153
|
-
| Bound workspace; local files are authoritative | `postman workspace diff --push-strategy default`, then `postman workspace push` | Persists the local API context for future work and sharing with others by publishing creates/updates without deleting unmatched workspace entities. |
|
|
154
|
-
| “Share this existing workspace with my team” and it is already team-accessible | Diff, then `postman workspace push` | Persists local context in the existing workspace so teammates can share and build on it; `create` would make a duplicate. |
|
|
155
|
-
|
|
156
|
-
If “share” also requires changing a personal workspace's visibility or team
|
|
157
|
-
permissions, inspect its metadata first. `push` synchronizes entities; it does
|
|
158
|
-
not change access control. Do not create a replacement to work around a missing
|
|
159
|
-
metadata-update command.
|
|
160
|
-
|
|
161
|
-
`workspace diff` is read-only. Match its push strategy to the intended push.
|
|
162
|
-
`--push-strategy force-sync` can delete workspace entities absent locally, so use it
|
|
163
|
-
only when the user explicitly requests mirroring and approves the shown
|
|
164
|
-
deletions. Do not add `-y` merely to bypass a prompt.
|
|
165
|
-
|
|
166
|
-
### 2.3 Initialize only when there is no workspace to pull
|
|
167
|
-
|
|
168
|
-
`postman init --json` is the agent-facing form. It writes
|
|
169
|
-
`.postman/resources.yaml` and scaffolds `postman/` for specs, collections and
|
|
170
|
-
environments. Downstream skills read that file and nothing else.
|
|
171
|
-
|
|
172
|
-
```bash
|
|
173
|
-
postman init --json --visibility personal
|
|
174
|
-
postman init --json --visibility team
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
Use `--visibility` only when a new workspace is actually wanted. If the
|
|
178
|
-
current service's workspace already exists, use `pull` from that service's
|
|
179
|
-
repository to enable the filesystem workflow. If the existing workspace
|
|
180
|
-
belongs to another service, use it as a dependency instead. Use `push` only
|
|
181
|
-
when publishing local changes to an already-bound workspace.
|
|
182
|
-
|
|
183
|
-
Without `--visibility`, interactive init prompts for the workspace step, while
|
|
184
|
-
`--json` skips that step because it may not prompt. Use `--visibility` when an
|
|
185
|
-
agent should create and bind a workspace non-interactively; omit it when a
|
|
186
|
-
local-only setup is intended.
|
|
187
|
-
|
|
188
|
-
**Read the payload, not stderr.** Take `bindings` and `exitCode` from the JSON.
|
|
189
|
-
Each binding reports a `source` of `inferred` or `none` — an inferred spec is a
|
|
190
|
-
guess worth confirming before building on it.
|
|
191
|
-
|
|
192
|
-
**Exit codes that are not failures:** 2 means several specs could be
|
|
193
|
-
authoritative, so re-run with `--spec <path>`. 5 means the local files were
|
|
194
|
-
written but the requested workspace was not created — it does *not* mean re-run.
|
|
195
|
-
|
|
196
|
-
## 3. Verify and report
|
|
197
|
-
|
|
198
|
-
### 3.1 Checkpoints
|
|
199
|
-
|
|
200
|
-
- `postman --version` returned a real version.
|
|
201
|
-
- Auth is confirmed, or established as not required for this task.
|
|
202
|
-
- `.postman/resources.yaml` names a spec or a collections directory.
|
|
203
|
-
- When workspace creation was requested or the repository was already bound,
|
|
204
|
-
`workspace.id` is set to the owning workspace. A deliberately local-only
|
|
205
|
-
init may omit it.
|
|
206
|
-
- After `pull`, expected workspace entities exist under `postman/`. After
|
|
207
|
-
`push`, report created/updated entities and conflicts; do not claim a
|
|
208
|
-
workspace is shared unless its access level permits the intended teammates.
|
|
209
|
-
|
|
210
|
-
"The CLI is installed" is not the bar, and a loaded skill configures nothing.
|
|
211
|
-
|
|
212
|
-
### 3.2 Summary format
|
|
213
|
-
|
|
214
|
-
```md
|
|
215
|
-
## Postman bootstrap
|
|
216
|
-
- **CLI**: <version> (latest: <version> | not checked)
|
|
217
|
-
- **Auth**: <api-key | browser | not required for this task>
|
|
218
|
-
- **Workspace**: <id | not requested | creation failed: reason>
|
|
219
|
-
- **Spec path**: <path (inferred | explicit) | none — user must create>
|
|
220
|
-
- **Collections dir**: <path | none — user must create>
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
---
|
|
224
|
-
|
|
225
|
-
# Reference Files
|
|
226
|
-
|
|
227
|
-
- `collection-schema-v3` skill — read when inspecting or writing the
|
|
228
|
-
collection files this skill resolves.
|
|
229
|
-
- [CLI Installation](reference/cli_installation.md) — read for install, update
|
|
230
|
-
and uninstall commands per platform.
|
|
8
|
+
A local Postman project puts contracts, runnable requests, environments, and
|
|
9
|
+
mocks beside implementation code so they can be inspected, diffed, and reviewed
|
|
10
|
+
in a PR. A workspace binding connects that work to maintained shared context.
|
|
11
|
+
Setup is useful when it resolves a missing capability or binding; a local API
|
|
12
|
+
check does not need a new workspace merely to proceed.
|
|
13
|
+
|
|
14
|
+
## Resolve only the missing setup
|
|
15
|
+
|
|
16
|
+
Inspect `postman --version`, `.postman/resources.yaml`, and the relevant
|
|
17
|
+
`postman/` files before installing or initializing. Existing files are clues,
|
|
18
|
+
not proof that paths and workspace IDs still describe this service. Preserve
|
|
19
|
+
confirmed bindings for downstream skills rather than rediscovering them.
|
|
20
|
+
|
|
21
|
+
**api-engineer**, **api-documentation**, **api-mocking**, **api-testing**, and
|
|
22
|
+
**ci-integration** depend on this skill only for unresolved setup, authentication,
|
|
23
|
+
or bindings. After resolving those prerequisites, return to the requesting
|
|
24
|
+
skill's workflow; local work with confirmed setup can skip bootstrap entirely.
|
|
25
|
+
|
|
26
|
+
If the CLI is missing, use `npm install -g postman-cli` or the applicable
|
|
27
|
+
[platform installer](reference/cli_installation.md). Update an existing CLI
|
|
28
|
+
through its original installation route; installing a second copy can leave
|
|
29
|
+
the shell invoking the old binary. If installation is blocked, report the
|
|
30
|
+
constraint and use **postman-mcp-server** for supported hosted operations.
|
|
31
|
+
|
|
32
|
+
Use `postman <resource> <action> -h` to resolve flags and defaults for the
|
|
33
|
+
installed CLI; cached examples can describe another version. Compare versions
|
|
34
|
+
when diagnosing a missing capability rather than making an update a universal
|
|
35
|
+
prerequisite. Spec lint belongs to `postman spec lint`; the deprecated
|
|
36
|
+
`postman api` surface is not interchangeable.
|
|
37
|
+
|
|
38
|
+
Local file operations need no normal login. `postman init` uses an agent-scoped
|
|
39
|
+
session, so logging in first adds no value to that branch. Authenticate when
|
|
40
|
+
an operation needs existing workspace resources: use
|
|
41
|
+
`postman login --with-api-key "$POSTMAN_API_KEY"` when the key is already in
|
|
42
|
+
the environment, otherwise `postman login`. Keep credential values out of
|
|
43
|
+
logs and committed files; **variables** owns request-secret handling.
|
|
44
|
+
|
|
45
|
+
## Owning workspace versus dependency
|
|
46
|
+
|
|
47
|
+
Read `localResources` and `workspace.id` in `.postman/resources.yaml`. When
|
|
48
|
+
working with an existing workspace, inspect its identity and elements with
|
|
49
|
+
`workspace list --json` and `workspace get <id> --elements --json`.
|
|
50
|
+
The owning workspace represents this repository's service; another service's
|
|
51
|
+
resource is a dependency. That distinction determines which context can be
|
|
52
|
+
pulled without replacing the repository's binding.
|
|
53
|
+
|
|
54
|
+
| State and intended outcome | Operation |
|
|
55
|
+
| --- | --- |
|
|
56
|
+
| Existing local layout meets the task | Reuse its files and bindings |
|
|
57
|
+
| This service has a workspace; work on it locally | `postman workspace pull <workspace-id>` |
|
|
58
|
+
| Only record this service's Git binding | `postman workspace connect-git <workspace-id> [path]` |
|
|
59
|
+
| Another service's collection, environment, or mock is needed | Use **api-discovery**'s dependency workflow |
|
|
60
|
+
| New project with no existing workspace | `postman init --json`; add `--visibility personal` or `--visibility team` when creating a workspace is intended |
|
|
61
|
+
| Bound workspace is authoritative | `postman workspace pull` |
|
|
62
|
+
| Validated local changes should be published | Preview with `postman workspace diff --push-strategy default`, then `postman workspace push` |
|
|
63
|
+
|
|
64
|
+
Inspect local changes before pulling so an import does not discard work.
|
|
65
|
+
Creating a second workspace does not connect an existing one, and pushing to a
|
|
66
|
+
workspace does not grant teammates access. If sharing requires a visibility
|
|
67
|
+
or permission change, inspect that metadata and resolve the access change
|
|
68
|
+
separately rather than creating a replacement.
|
|
69
|
+
|
|
70
|
+
`workspace diff` is read-only; use the strategy planned for the push.
|
|
71
|
+
The default push creates/updates entities without deleting unmatched ones.
|
|
72
|
+
`--push-strategy force-sync` can delete entities absent locally and belongs
|
|
73
|
+
only to explicitly requested mirroring with the shown deletions approved.
|
|
74
|
+
A request to publish supplies consent for its scoped push; otherwise obtain
|
|
75
|
+
consent after the diff is reviewable. See **ci-integration** for publishing
|
|
76
|
+
reviewed changes after merge.
|
|
77
|
+
|
|
78
|
+
## Interpret initialization without losing partial success
|
|
79
|
+
|
|
80
|
+
Run init inside the intended repository. It scaffolds Postman files and
|
|
81
|
+
`.postman/resources.yaml`; API implementation and a starter contract are
|
|
82
|
+
separate work, not prerequisites to setup.
|
|
83
|
+
|
|
84
|
+
`--json` avoids interactive prompts. Without `--visibility` it skips workspace
|
|
85
|
+
creation; with it, creation and binding are requested. Read `bindings` and
|
|
86
|
+
`exitCode` from the JSON payload. A binding marked `inferred` is a candidate
|
|
87
|
+
contract, not a confirmed source of truth. Exit 2 means multiple specs need
|
|
88
|
+
selection with `--spec <path>`. Exit 5 means local files were written but
|
|
89
|
+
workspace creation failed; inspect that partial result before retrying.
|
|
90
|
+
|
|
91
|
+
## Subscription or usage limit
|
|
92
|
+
|
|
93
|
+
A CLI command can fail because the user's subscription does not allow the
|
|
94
|
+
operation or its credits or usage quota are exhausted. There is no fixed
|
|
95
|
+
message for this; recognize wording such as "usage limit exceeded", "usage
|
|
96
|
+
quota has been exceeded", or "reached" or "breached" or "exceeded" a limit for the account,
|
|
97
|
+
team, or a plan-governed operation. Also recognize plan-dependent caps phrased
|
|
98
|
+
as an operation that "does not allow more than" or "requires at least" a stated
|
|
99
|
+
amount. Do not classify a temporary rate limit or a fixed per-resource
|
|
100
|
+
validation cap as a subscription limit. Retrying will not clear a subscription
|
|
101
|
+
limit, so stop retrying and run `postman whoami` to see whose session the CLI
|
|
102
|
+
is using.
|
|
103
|
+
|
|
104
|
+
If it reports a guest session ("Using Postman as a guest", or
|
|
105
|
+
`"status": "guest"` with `--json`), such as the one `postman init` creates
|
|
106
|
+
without a login, tell the user - so do it explicitly and cleanly in a new paragraph,
|
|
107
|
+
that they need to sign up for a Postman account to get more credits and continue work,
|
|
108
|
+
which also keeps the work done as a guest.
|
|
109
|
+
If you run it for them, `postman signup --json` prints a `claimUrl`
|
|
110
|
+
to hand over and then waits until they finish signing up in the browser.
|
|
111
|
+
Ask the user if they want you to initiate signup for them.
|
|
112
|
+
|
|
113
|
+
If the whoami probe reports a signed-in account, then explicitly and cleanly in a new paragraph,
|
|
114
|
+
tell the user that they need to upgrade their plan, and that they can do so at
|
|
115
|
+
https://postman.postman.co/settings/team/billing.
|
|
116
|
+
|
|
117
|
+
## Verification
|
|
118
|
+
|
|
119
|
+
Report the working CLI, relevant paths, and actual binding or remaining gap.
|
|
120
|
+
For a pull, confirm the intended entities appeared locally; for a push, report
|
|
121
|
+
created/updated entities and conflicts. Installation alone does not establish
|
|
122
|
+
a usable project, and successful sync does not establish teammate access.
|
|
123
|
+
|
|
124
|
+
## Reporting CLI and skill gaps
|
|
125
|
+
|
|
126
|
+
Concrete reports help fix recurring CLI failures and misleading skill guidance.
|
|
127
|
+
When actual use exposes one, handle the user's task first, then report the gap
|
|
128
|
+
with `postman feedback`. Include a sanitized reproduction and the expected and
|
|
129
|
+
observed behavior; exclude secrets, user data, and proprietary content.
|