@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.
Files changed (48) hide show
  1. package/README.md +46 -9
  2. package/dist/hosts/antigravity.js +47 -0
  3. package/dist/hosts/codex-hooks.js +68 -0
  4. package/dist/hosts/codex.js +87 -8
  5. package/dist/hosts/copilot.js +60 -0
  6. package/dist/hosts/index.js +3 -1
  7. package/dist/json-rpc.js +113 -0
  8. package/dist/system.js +40 -3
  9. package/mcp.pi.json +2 -2
  10. package/package.json +1 -1
  11. package/skills/ai-readiness/SKILL.md +40 -44
  12. package/skills/api-discovery/SKILL.md +64 -145
  13. package/skills/api-discovery/reference/orbit.md +17 -5
  14. package/skills/api-documentation/SKILL.md +41 -46
  15. package/skills/api-engineer/SKILL.md +78 -23
  16. package/skills/api-mocking/SKILL.md +117 -163
  17. package/skills/api-monitoring/SKILL.md +52 -129
  18. package/skills/api-simulation/SKILL.md +130 -178
  19. package/skills/api-simulation/reference/sim_yaml_schema.md +41 -103
  20. package/skills/api-testing/SKILL.md +48 -95
  21. package/skills/bootstrap/SKILL.md +123 -224
  22. package/skills/ci-integration/SKILL.md +53 -113
  23. package/skills/collection-schema-v3/SKILL.md +43 -204
  24. package/skills/collection-schema-v3/reference/http.md +150 -0
  25. package/skills/datasets/SKILL.md +89 -315
  26. package/skills/datasets/reference/spreadsheets.md +25 -0
  27. package/skills/flows/SKILL.md +57 -206
  28. package/skills/flows/reference/flow_cli_flags.md +3 -2
  29. package/skills/performance-testing/SKILL.md +46 -62
  30. package/skills/performance-testing/references/jmeter-import/README.md +82 -0
  31. package/skills/performance-testing/references/jmeter-import/import-report.md +52 -0
  32. package/skills/performance-testing/references/jmeter-import/mapping-table.md +95 -0
  33. package/skills/performance-testing/references/jmeter-import/postman-perf-capabilities.md +56 -0
  34. package/skills/performance-testing/references/jmeter-import/script-translation.md +97 -0
  35. package/skills/postman-mcp-server/SKILL.md +53 -59
  36. package/skills/postman-mcp-server/references/docs.md +0 -1
  37. package/skills/postman-mcp-server/references/learn.md +10 -9
  38. package/skills/postman-mcp-server/references/mock.md +0 -1
  39. package/skills/postman-mcp-server/references/search.md +0 -1
  40. package/skills/postman-mcp-server/references/security.md +0 -1
  41. package/skills/postman-mcp-server/references/setup.md +0 -1
  42. package/skills/postman-mcp-server/references/sync.md +0 -1
  43. package/skills/postman-mcp-server/references/test.md +0 -1
  44. package/skills/variables/SKILL.md +44 -87
  45. package/skills/webhook-testing/SKILL.md +103 -0
  46. package/skills/webhook-testing/reference/forwarding.md +10 -0
  47. package/skills/webhook-testing/reference/outbound_webhooks.md +25 -0
  48. package/skills/webhook-testing/reference/webhook_scripts.md +163 -0
@@ -1,104 +1,57 @@
1
1
  ---
2
2
  name: api-testing
3
- description: Runs tests against an API from the command line — a single ad-hoc request, a full collection of pm.test assertions, or matching real captured app traffic against a collection contract. Use when the user asks to "test this endpoint," "run this collection," "check the API still works," or "verify my app's requests match the contract." Covers `postman request`, `postman collection run`, and `postman application test`. Depends on bootstrap when the target is a cloud collection or workspace-bound environment; a bare URL or local collection needs nothing from bootstrap.
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
- ## Overview
9
-
10
- Three tools, matched to what already exists:
11
-
12
- | Have | Use |
13
- | --- | --- |
14
- | Just a URL to check, with no saved request | `postman request` |
15
- | A request already saved in a collection | `postman collection run <collection-path> -i <request-id-name-or-path>` |
16
- | A collection with `pm.test` assertions saved in it | `postman collection run` |
17
- | A real app (browser flow, CLI, service) whose traffic should match a collection's contract | `postman application test` |
18
-
19
- Don't reach for the heavier tool when the lighter one already answers the
20
- question — a one-off endpoint check doesn't need a collection, and a
21
- collection run doesn't need Playwright.
22
-
23
- ## `postman request` — over curl, not instead of testing
24
-
25
- A single request with Postman's resolution built in: `-e` resolves
26
- `{{variables}}` from an environment file the same way a collection run
27
- would, `--auth-*` flags cover basic/bearer/digest/oauth/aws/etc. without
28
- hand-building headers, and `--retry`/`--timeout` handle flaky endpoints.
29
- `--script-post-request` can run `pm.test(...)` assertions inline — the exit
30
- code counts *failed assertions*, not just HTTP status, so a 200 with a
31
- failing test still exits nonzero. Useful for a quick check or a CI health
32
- check; not the place to accumulate assertions that should outlive one
33
- command — those belong saved in a collection.
34
-
35
- Before constructing a URL, headers, auth, and body on the command line, look
36
- for a matching `*.request.yaml` under `postman/collections/`. If it exists,
37
- execute the saved request through its collection:
38
-
39
- ```bash
40
- postman collection run "postman/collections/Orders API" -i "create order"
41
- ```
42
-
43
- Do not copy the saved YAML fields into `postman request`; that bypasses the
44
- collection's inherited variables, auth, scripts, and maintained payload. The
45
- `postman request` positional target is a URL, not a `.request.yaml` path. When
46
- there is no saved request but its body already lives in a separate file, keep
47
- the file as the source of truth with `--body @path/to/payload.json` instead of
48
- inlining its contents.
49
-
50
- ## `collection run` — the assertion suite
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
- State the actual result (pass/fail counts, exit code), not just that the
102
- command ran. For `application test`, state whether it ran in match mode or
103
- `--capture-only` — they answer different questions and shouldn't be
104
- reported the same way.
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: Resolves the Postman CLI, authenticates when the task needs it, and manages the filesystem/workspace binding for a repository. Use when the user asks to set up Postman, enable filesystem workflows, authenticate, initialize, import, connect, pull, push, sync, or share a workspace — and before skills that need a linked workspace, only when the CLI, linked workspace, or spec path has not already been confirmed.
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
- ## Overview
9
-
10
- One-time and idempotent: every other Postman skill in this plugin reads the
11
- values this one records and re-derives none of them. Finding an existing
12
- `postman/` tree or an OpenAPI file is a signal to inspect, not to assume this
13
- repo is already set up.
14
-
15
- ## Rules
16
-
17
- - Make ad-hoc HTTP calls with `postman request`, never `curl` or another
18
- client. If the request already exists in a collection, preserve its saved
19
- auth, variables, scripts, and payload by using `postman collection run
20
- <collection-path> -i <request>` instead of reconstructing it on the command
21
- line; see `api-testing`.
22
- - Never invent a subcommand or a flag. Run `-h` first and believe it.
23
- - Lint specs with `postman spec lint`, never `postman api …` — the API Builder
24
- is deprecated in v12+ and the CLI prints no warning.
25
- - Local commands need no login.
26
- - A missing `postman` binary means install it. Route to `postman-mcp-server`
27
- only after an install has been attempted and actually failed.
28
- - Never fabricate a workspace id, spec path, or collections directory. Report
29
- the gap and stop.
30
- - Never echo an API key or session token into output, logs, or summaries.
31
- - "Present" is not "current": check the version and existing links before
32
- setting anything up.
33
- - Operate inside a repository, including a fresh repository for a new project.
34
- Never scaffold the API implementation or a starter spec.
35
- - Write no host-specific paths — the same `skills/` directory loads on every
36
- route.
37
- - Do not use `init` or `workspace create` to share or import a workspace that
38
- already exists. Choose the direction of sync from the lifecycle table below.
39
- - Before pulling, apply `api-discovery`'s owning-workspace-versus-dependency
40
- distinction; finding a workspace does not by itself make it this
41
- repository's workspace.
42
-
43
- ## Ask the CLI: `-h`
44
-
45
- The CLI is self-describing at different levels. Walk down only as far as the
46
- question needs:
47
-
48
- ```bash
49
- postman -h # resources: collection, spec, mock, monitor, workspace, api, flows…
50
- postman <resource> -h # that resource's actions
51
- postman <resource> <action> -h # real flags, defaults, and worked `Eg.` lines
52
- ```
53
-
54
- Read the third level before writing any command that carries a flag — it is the
55
- only place defaults are stated, and a wrong default fails silently. Live output
56
- is authoritative over any summary, including this file. There is also no single
57
- verb for "is the workspace linked and synced": run `postman workspace -h` and
58
- pick from what it prints.
59
-
60
- ---
61
-
62
- # Process
63
-
64
- Three steps, in order. Stop at the first that fails and report which one.
65
-
66
- ## 1. Resolve the CLI
67
-
68
- ### 1.1 Check what is already there
69
-
70
- **Present, and at which version?**
71
-
72
- ```bash
73
- command -v postman && postman --version
74
- ```
75
-
76
- **Current?** Never blocking — no network is a normal answer. But don't call a
77
- feature missing without having made this comparison.
78
-
79
- ```bash
80
- npm view postman-cli version
81
- ```
82
-
83
- ### 1.2 Install only if missing
84
-
85
- **npm — all platforms, using Node's global package install:**
86
-
87
- ```bash
88
- npm install -g postman-cli
89
- ```
90
-
91
- **Platform installers — direct shell installs for macOS, Linux, WSL, and
92
- Windows:** use the commands in
93
- [reference/cli_installation.md](reference/cli_installation.md). Every route
94
- puts `postman` on `PATH`.
95
-
96
- **Updating a copy that already exists:** use the same route that installed it.
97
- curl-installed binaries don't take `npm install -g` cleanly.
98
-
99
- **If every route fails:** name what blocked you — no Node, no shell, no write
100
- access, or a hosted session that cannot install — then hand off to the
101
- `postman-mcp-server` skill. An attempted install that actually failed is the
102
- only thing that qualifies.
103
-
104
- ## 2. Establish the filesystem and workspace bindings
105
-
106
- ### 2.1 Authenticate only if this step needs it
107
-
108
- `postman init` needs no normal login — init uses an agent-scoped session.
109
- Do not log in before init. Authenticate only when the command you're about to
110
- run operates on an existing workspace, such as listing, inspecting, pulling,
111
- pushing, or changing access to one.
112
-
113
- **With an API key — preferred, non-interactive:**
114
-
115
- ```bash
116
- [ -n "$POSTMAN_API_KEY" ] && postman login --with-api-key "$POSTMAN_API_KEY"
117
- ```
118
-
119
- **Browser flow, when that variable is unset:**
120
-
121
- ```bash
122
- postman login
123
- ```
124
-
125
- **Never echo the key or token.** Auth state lives in the CLI's own config; this
126
- skill writes no credential file. Report that authentication succeeded, nothing
127
- more.
128
-
129
- ### 2.2 Inspect both sides before choosing a command
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.