postman-cli-completion 1.39.2
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/LICENSE +21 -0
- package/README.md +145 -0
- package/bin/postman-completion.mjs +83 -0
- package/completions/bash/postman.bash +1078 -0
- package/completions/fish/postman.fish +574 -0
- package/completions/zsh/_postman +1294 -0
- package/package.json +47 -0
|
@@ -0,0 +1,1294 @@
|
|
|
1
|
+
#compdef postman
|
|
2
|
+
compdef _postman postman
|
|
3
|
+
# Zsh completion for Postman CLI (postman v1.39.2)
|
|
4
|
+
# Auto-generated by scripts/generate.mjs — DO NOT EDIT
|
|
5
|
+
# Source: spec/commands.json
|
|
6
|
+
# https://github.com/yokawasa/postman-cli-completion
|
|
7
|
+
|
|
8
|
+
_postman() {
|
|
9
|
+
local context state state_descr line
|
|
10
|
+
typeset -A opt_args
|
|
11
|
+
|
|
12
|
+
_arguments -C \
|
|
13
|
+
'(-v --version)'{-v,--version}'[output the version number]' \
|
|
14
|
+
'--silent[Silences all terminal output]' \
|
|
15
|
+
'--color[Enable/Disable colored output (auto|on|off) (default\: "auto")]:value:(auto on off)' \
|
|
16
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
17
|
+
'1: :_postman_commands' \
|
|
18
|
+
'*::arg:->args'
|
|
19
|
+
|
|
20
|
+
case $state in
|
|
21
|
+
args)
|
|
22
|
+
case $words[1] in
|
|
23
|
+
login) _postman_login ;;
|
|
24
|
+
logout) _postman_logout ;;
|
|
25
|
+
collection) _postman_collection ;;
|
|
26
|
+
api) _postman_api ;;
|
|
27
|
+
runner) _postman_runner ;;
|
|
28
|
+
spec) _postman_spec ;;
|
|
29
|
+
monitor) _postman_monitor ;;
|
|
30
|
+
workspace) _postman_workspace ;;
|
|
31
|
+
performance) _postman_performance ;;
|
|
32
|
+
flows|fl) _postman_flows ;;
|
|
33
|
+
request) _postman_request ;;
|
|
34
|
+
sdk) _postman_sdk ;;
|
|
35
|
+
mock) _postman_mock ;;
|
|
36
|
+
application|app) _postman_application ;;
|
|
37
|
+
simulate) _postman_simulate ;;
|
|
38
|
+
context) _postman_context ;;
|
|
39
|
+
search) _postman_search ;;
|
|
40
|
+
webhook) _postman_webhook ;;
|
|
41
|
+
esac
|
|
42
|
+
;;
|
|
43
|
+
esac
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
_postman_commands() {
|
|
47
|
+
local -a commands
|
|
48
|
+
commands=(
|
|
49
|
+
'login:Authenticate with Postman to access your resources.'
|
|
50
|
+
'logout:Delete the stored Postman API key.'
|
|
51
|
+
'collection:Run and test your Postman collections directly from the command line.'
|
|
52
|
+
'api:Publish and test your APIs directly from the command line'
|
|
53
|
+
'runner:Run runners on your own environments for monitoring your APIs'
|
|
54
|
+
'spec:Lint and validate Specifications from the command line'
|
|
55
|
+
'monitor:Invoke a monitor run and display results'
|
|
56
|
+
'workspace:Manage workspace resources.'
|
|
57
|
+
'performance:Manage performance tests on your collections.'
|
|
58
|
+
'flows:Manage and interact with flows.'
|
|
59
|
+
'fl:Alias for flows'
|
|
60
|
+
'request:Send HTTP requests from the command line with full Postman capabilities including authentication, environment variables, assertions, retries, and detailed output control.'
|
|
61
|
+
'sdk:Generate and manage your SDKs directly from the command line.'
|
|
62
|
+
'mock:Run and manage local Postman mock servers.'
|
|
63
|
+
'application:Application-level commands\: initialise config and run tests.'
|
|
64
|
+
'app:Alias for application'
|
|
65
|
+
'simulate:Start mock servers with simulated failure scenarios.'
|
|
66
|
+
'context:\[Beta\] Get API context for AI coding agents directly from the command line.'
|
|
67
|
+
'search:Search for Postman element types (requests, collections, workspaces, and more).'
|
|
68
|
+
'webhook:Create and manage Postman webhooks.'
|
|
69
|
+
)
|
|
70
|
+
_describe -t commands 'postman command' commands
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
_postman_login() {
|
|
74
|
+
_arguments \
|
|
75
|
+
'--alias[Specify the alias of the API key to fetch your resources using it. (This option is discontinued and will be removed in a future release.)]:alias' \
|
|
76
|
+
'--with-api-key[Specify the API key directly.]:apikey' \
|
|
77
|
+
'--region[Specify the region for authentication. Use "eu" for EU region.]:region:(us eu)' \
|
|
78
|
+
'--verbose[Show detailed error information]' \
|
|
79
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
_postman_logout() {
|
|
83
|
+
_arguments \
|
|
84
|
+
'--alias[Specify the alias of the API key to fetch your resources using it. (This option is discontinued and will be removed in a future release.)]:alias' \
|
|
85
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
_postman_collection() {
|
|
89
|
+
local context state state_descr line
|
|
90
|
+
typeset -A opt_args
|
|
91
|
+
_arguments -C \
|
|
92
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
93
|
+
'1: :_postman_collection_commands' \
|
|
94
|
+
'*::arg:->args'
|
|
95
|
+
case $state in
|
|
96
|
+
args)
|
|
97
|
+
case $words[1] in
|
|
98
|
+
migrate) _postman_collection_migrate ;;
|
|
99
|
+
lint) _postman_collection_lint ;;
|
|
100
|
+
ai-readiness) _postman_collection_ai_readiness ;;
|
|
101
|
+
run) _postman_collection_run ;;
|
|
102
|
+
esac
|
|
103
|
+
;;
|
|
104
|
+
esac
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
_postman_collection_commands() {
|
|
108
|
+
local -a sub
|
|
109
|
+
sub=(
|
|
110
|
+
'migrate:Migrate a v2.1 collection to the v3 format'
|
|
111
|
+
'lint:Run linting on a local v3 collection at the given file or directory path.'
|
|
112
|
+
'ai-readiness:Score a Postman collection for AI readiness by ID, local file path, or local-mode directory.'
|
|
113
|
+
'run:Initiate a Postman collection run from a given ID or path.'
|
|
114
|
+
)
|
|
115
|
+
_describe -t commands 'collection command' sub
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
_postman_collection_migrate() {
|
|
119
|
+
_arguments \
|
|
120
|
+
'(-o --output)'{-o,--output}'[Output directory (default\: ./<collection-name>)]:dir:_files -g "*.(json)"' \
|
|
121
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
122
|
+
'*:path:_files -g "*.(json)"'
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
_postman_collection_lint() {
|
|
126
|
+
_arguments \
|
|
127
|
+
'(-f --fail-severity)'{-f,--fail-severity}'[Exit with failure if diagnostics at this level or above are present. \[choices\: "error", "warning"\] (default\: "error")]:value' \
|
|
128
|
+
'(-r --reporter)'{-r,--reporter}'[Output format\: cli (human-readable) or json. (default\: "cli")]:value' \
|
|
129
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
130
|
+
'*:path:_files -g "*.(json)"'
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
_postman_collection_ai_readiness() {
|
|
134
|
+
_arguments \
|
|
135
|
+
'(-o --output)'{-o,--output}'[Output format for the results. \[choices\: "cli", "json", "html"\]]:value' \
|
|
136
|
+
'--min-score[Exit with a non-zero code if the overall score is below this threshold (0-100).]:n' \
|
|
137
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
138
|
+
'*:collectionId/Path:_files -g "*.(json)"'
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
_postman_collection_run() {
|
|
142
|
+
_arguments \
|
|
143
|
+
'(-e --environment)'{-e,--environment}'[Specify an Id or path to a Postman Environment]:path:_files -g "*.(json)"' \
|
|
144
|
+
'(-g --globals)'{-g,--globals}'[Specify an Id or path to a file containing Postman Globals]:path:_files -g "*.(json)"' \
|
|
145
|
+
'(-r --reporters)'{-r,--reporters}'[Specify the reporters to use for the run\: cli,json,junit,html. For multiple reporters, provide their names as a comma-separated list (E.g., -r cli,json) (default\: \["cli"\])]:reporter:(cli json junit html)' \
|
|
146
|
+
'--reporter-json-structure[\[Optional\] Generate JSON report using the Newman schema. By default, JSON reports use the native structure of Postman CLI.]' \
|
|
147
|
+
'(-n --iteration-count)'{-n,--iteration-count}'[Define the number of iterations to run]:n' \
|
|
148
|
+
'(-d --iteration-data)'{-d,--iteration-data}'[Specify a data file to use for iterations (either JSON or CSV)]:path:_files -g "*.(json|csv)"' \
|
|
149
|
+
'-i[Specify the request/folder id, name, or path to run from the collection. Use a path (e.g. "FolderName/RequestName") to disambiguate items with the same name. Can be specified multiple times to run multiple items (default\: \[\])]:id' \
|
|
150
|
+
'--global-var[Allows the specification of global variables via the command line, in a key=value format]:value' \
|
|
151
|
+
'--env-var[Allows the specification of environment variables via the command line, in a key=value format (default\: \[\])]:value' \
|
|
152
|
+
'--integration-id[Specify the integration id for the report. (Only supported in the US region)]:integration-id' \
|
|
153
|
+
'--postman-api-key[API Key used to load the resources from the Postman API (Only supported in the US region, use '\''postman login --region'\'' to authenticate instead)]:apiKey' \
|
|
154
|
+
'--alias[Specify the alias of the API key to fetch remote resources using it.]:alias' \
|
|
155
|
+
'--bail[Specify whether or not to gracefully stop a collection run on encountering an error and whether to end the run with an error based on the optional modifier]:modifiers:(folder failure)' \
|
|
156
|
+
'--ignore-redirects[Prevents Postman CLI from automatically following 3XX redirect responses]' \
|
|
157
|
+
'(-x --suppress-exit-code)'{-x,--suppress-exit-code}'[Specify whether or not to override the default exit code for the current run]' \
|
|
158
|
+
'--silent[Prevents Postman CLI from showing output to CLI]' \
|
|
159
|
+
'--disable-unicode[Forces Unicode compliant symbols to be replaced by their plain text equivalents]' \
|
|
160
|
+
'--delay-request[Specify the extent of delay between requests (milliseconds) (default\: 0)]:n' \
|
|
161
|
+
'--timeout[Specify a timeout for collection run (milliseconds) (default\: 0)]:n' \
|
|
162
|
+
'--timeout-request[Specify a timeout for requests (milliseconds) (default\: 0)]:n' \
|
|
163
|
+
'--timeout-script[Specify a timeout for scripts (milliseconds) (default\: 0)]:n' \
|
|
164
|
+
'--working-dir[Specify the path to the working directory]:path:_files -/' \
|
|
165
|
+
'--no-insecure-file-read[Prevents reading the files situated outside of the working directory]' \
|
|
166
|
+
'(-k --insecure)'{-k,--insecure}'[Disables SSL validations]' \
|
|
167
|
+
'--ssl-client-cert-list[Specify the path to a client certificates configurations (JSON)]:path:_files -g "*.(pem|crt|key)"' \
|
|
168
|
+
'--ssl-client-cert[Specify the path to a client certificate (PEM)]:path:_files -g "*.(pem|crt|key)"' \
|
|
169
|
+
'--ssl-client-key[Specify the path to a client certificate private key]:path:_files -g "*.(pem|crt|key)"' \
|
|
170
|
+
'--ssl-client-passphrase[Specify the client certificate passphrase (for protected key)]:passphrase' \
|
|
171
|
+
'--ssl-extra-ca-certs[Specify additionally trusted CA certificates (PEM)]:path:_files -g "*.(pem|crt|key)"' \
|
|
172
|
+
'--cookie-jar[Specify the path to a custom cookie jar (serialized tough-cookie JSON)]:path:_files -g "*.(json)"' \
|
|
173
|
+
'--export-cookie-jar[Exports the cookie jar to a file after completing the run]:path:_files -g "*.(json)"' \
|
|
174
|
+
'--verbose[Show detailed information of collection run and each request sent]' \
|
|
175
|
+
'--mock[Start a mock server from manifest (.json) file]:path:_files -g "*.(json)"' \
|
|
176
|
+
'--simulate[Start mock servers with fault-injection scenarios from a .sim.yaml file]:path:_files -g "*.(sim.yaml|yaml|yml)"' \
|
|
177
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
178
|
+
'--reporter-json-export[Path to save the report for the given reporter.]:value:_files -g "*.(json|xml|html)"' \
|
|
179
|
+
'--reporter-junit-export[Path to save the report for the given reporter.]:value:_files -g "*.(json|xml|html)"' \
|
|
180
|
+
'--reporter-html-export[Path to save the report for the given reporter.]:value:_files -g "*.(json|xml|html)"' \
|
|
181
|
+
'--reporter-json-omitRequestBodies[Remove all request bodies from the report.]' \
|
|
182
|
+
'--reporter-html-omitRequestBodies[Remove all request bodies from the report.]' \
|
|
183
|
+
'--reporter-json-omitResponseBodies[Remove all response bodies from the report.]' \
|
|
184
|
+
'--reporter-html-omitResponseBodies[Remove all response bodies from the report.]' \
|
|
185
|
+
'--reporter-json-omitHeaders[Remove all request and response headers from the report.]' \
|
|
186
|
+
'--reporter-html-omitHeaders[Remove all request and response headers from the report.]' \
|
|
187
|
+
'--reporter-json-omitAllHeadersAndBody[Remove all request/response headers and bodies from the report.]' \
|
|
188
|
+
'--reporter-html-omitAllHeadersAndBody[Remove all request/response headers and bodies from the report.]' \
|
|
189
|
+
'*:collectionId/Path:_files -g "*.(json)"'
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
_postman_api() {
|
|
193
|
+
local context state state_descr line
|
|
194
|
+
typeset -A opt_args
|
|
195
|
+
_arguments -C \
|
|
196
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
197
|
+
'1: :_postman_api_commands' \
|
|
198
|
+
'*::arg:->args'
|
|
199
|
+
case $state in
|
|
200
|
+
args)
|
|
201
|
+
case $words[1] in
|
|
202
|
+
lint) _postman_api_lint ;;
|
|
203
|
+
publish) _postman_api_publish ;;
|
|
204
|
+
esac
|
|
205
|
+
;;
|
|
206
|
+
esac
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
_postman_api_commands() {
|
|
210
|
+
local -a sub
|
|
211
|
+
sub=(
|
|
212
|
+
'lint:Run linting on the schema of the given API ID or local file in the given path. If \[api\] is not provided we will run the linting on the schema present in the .postman config file'
|
|
213
|
+
'publish:Publish a version of an API for the given apiId. All entities added to the API will be published by default. User can choose which entities to publish by using additional options.'
|
|
214
|
+
)
|
|
215
|
+
_describe -t commands 'api command' sub
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
_postman_api_lint() {
|
|
219
|
+
_arguments \
|
|
220
|
+
'--integration-id[Specify the integration ID for the report.]:integration-id' \
|
|
221
|
+
'(-f --fail-severity)'{-f,--fail-severity}'[Results of this level or above will trigger a failure exit code. \[choices\: "error", "warn", "info", "hint"\] (default\: "ERROR")]:value' \
|
|
222
|
+
'(-x --suppress-exit-code)'{-x,--suppress-exit-code}'[Specify whether or not to override the default exit code for the current run]' \
|
|
223
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
224
|
+
'*:api:'
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
_postman_api_publish() {
|
|
228
|
+
_arguments \
|
|
229
|
+
'--name[Specify the name of the version to publish.]:name' \
|
|
230
|
+
'--release-notes[Specify release notes for the version to publish.]:releaseNotes' \
|
|
231
|
+
'--collections[Specify the collections to publish. If API is connected to a repository, provide file path instead of IDs.]:collectionIds/paths...:_files -g "*.(json)"' \
|
|
232
|
+
'--api-definition[Specify the API Definition to publish. If API is connected to a repository, provide schema root file path. Note that some repository connections utilize a schema directory path; for such APIs, provide schema directory path instead of file path.]:apiDefinitionId/directory/file' \
|
|
233
|
+
'--do-not-poll[Specify whether or not to poll for completion status of the publish action.]' \
|
|
234
|
+
'(-x --suppress-exit-code)'{-x,--suppress-exit-code}'[Specify whether or not to override the default exit code for the current run.]' \
|
|
235
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
236
|
+
'*:apiId:'
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
_postman_runner() {
|
|
240
|
+
local context state state_descr line
|
|
241
|
+
typeset -A opt_args
|
|
242
|
+
_arguments -C \
|
|
243
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
244
|
+
'1: :_postman_runner_commands' \
|
|
245
|
+
'*::arg:->args'
|
|
246
|
+
case $state in
|
|
247
|
+
args)
|
|
248
|
+
case $words[1] in
|
|
249
|
+
start) _postman_runner_start ;;
|
|
250
|
+
esac
|
|
251
|
+
;;
|
|
252
|
+
esac
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
_postman_runner_commands() {
|
|
256
|
+
local -a sub
|
|
257
|
+
sub=(
|
|
258
|
+
'start:Start a runner'
|
|
259
|
+
)
|
|
260
|
+
_describe -t commands 'runner command' sub
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
_postman_runner_start() {
|
|
264
|
+
_arguments \
|
|
265
|
+
'--id[The ID of the runner to execute]:id' \
|
|
266
|
+
'--key[The secret key for the runner]:key:_files -g "*.(pem|crt|key)"' \
|
|
267
|
+
'--region[Specify the region for the runner. Use "eu" for EU region.]:region' \
|
|
268
|
+
'--proxy[External proxy URL (e.g., http\://proxy.com or http\://proxy.com\:8080)]:url' \
|
|
269
|
+
'--egress-proxy[Enable built-in egress proxy]' \
|
|
270
|
+
'--egress-proxy-authz-url[Custom egress proxy authorization service base URL]:url' \
|
|
271
|
+
'--ssl-extra-ca-certs[Additional trusted CA certificates (PEM file, can contain multiple certs)]:path:_files -g "*.(pem|crt|key)"' \
|
|
272
|
+
'--metrics[Enable the metrics server for health checks]' \
|
|
273
|
+
'--metrics-port[Port for the metrics server (default\: "9090")]:port' \
|
|
274
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
_postman_spec() {
|
|
278
|
+
local context state state_descr line
|
|
279
|
+
typeset -A opt_args
|
|
280
|
+
_arguments -C \
|
|
281
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
282
|
+
'1: :_postman_spec_commands' \
|
|
283
|
+
'*::arg:->args'
|
|
284
|
+
case $state in
|
|
285
|
+
args)
|
|
286
|
+
case $words[1] in
|
|
287
|
+
lint) _postman_spec_lint ;;
|
|
288
|
+
ai-readiness) _postman_spec_ai_readiness ;;
|
|
289
|
+
esac
|
|
290
|
+
;;
|
|
291
|
+
esac
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
_postman_spec_commands() {
|
|
295
|
+
local -a sub
|
|
296
|
+
sub=(
|
|
297
|
+
'lint:Run linting on the given specification by ID or local file path.'
|
|
298
|
+
'ai-readiness:Score an OpenAPI specification for AI readiness by ID or local file path.'
|
|
299
|
+
)
|
|
300
|
+
_describe -t commands 'spec command' sub
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
_postman_spec_lint() {
|
|
304
|
+
_arguments \
|
|
305
|
+
'(-f --fail-severity)'{-f,--fail-severity}'[Results of this level or above will trigger a failure exit code. \[choices\: "error", "warning", "info", "hint"\] (default\: "ERROR")]:value' \
|
|
306
|
+
'(-o --output)'{-o,--output}'[Output format for the results. \[choices\: "json", "csv"\]]:value' \
|
|
307
|
+
'--workspace-id[The workspace ID to use for fetching governance rulesets.]:value' \
|
|
308
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
309
|
+
'*:spec:'
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
_postman_spec_ai_readiness() {
|
|
313
|
+
_arguments \
|
|
314
|
+
'(-o --output)'{-o,--output}'[Output format for the results. \[choices\: "cli", "json", "html"\]]:value' \
|
|
315
|
+
'--min-score[Exit with a non-zero code if the overall score is below this threshold (0-100).]:n' \
|
|
316
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
317
|
+
'*:spec:'
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
_postman_monitor() {
|
|
321
|
+
local context state state_descr line
|
|
322
|
+
typeset -A opt_args
|
|
323
|
+
_arguments -C \
|
|
324
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
325
|
+
'1: :_postman_monitor_commands' \
|
|
326
|
+
'*::arg:->args'
|
|
327
|
+
case $state in
|
|
328
|
+
args)
|
|
329
|
+
case $words[1] in
|
|
330
|
+
run) _postman_monitor_run ;;
|
|
331
|
+
esac
|
|
332
|
+
;;
|
|
333
|
+
esac
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
_postman_monitor_commands() {
|
|
337
|
+
local -a sub
|
|
338
|
+
sub=(
|
|
339
|
+
'run:Invoke a monitor run and display results.'
|
|
340
|
+
)
|
|
341
|
+
_describe -t commands 'monitor command' sub
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
_postman_monitor_run() {
|
|
345
|
+
_arguments \
|
|
346
|
+
'(-x --suppress-exit-code)'{-x,--suppress-exit-code}'[Specify whether or not to override the default exit code for the current run]' \
|
|
347
|
+
'(-t --timeout)'{-t,--timeout}'[Maximum wait time for run completion in milliseconds (default\: 15 minutes) (default\: 900000)]:ms' \
|
|
348
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
349
|
+
'*:monitorId:'
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
_postman_workspace() {
|
|
353
|
+
local context state state_descr line
|
|
354
|
+
typeset -A opt_args
|
|
355
|
+
_arguments -C \
|
|
356
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
357
|
+
'1: :_postman_workspace_commands' \
|
|
358
|
+
'*::arg:->args'
|
|
359
|
+
case $state in
|
|
360
|
+
args)
|
|
361
|
+
case $words[1] in
|
|
362
|
+
prepare) _postman_workspace_prepare ;;
|
|
363
|
+
push) _postman_workspace_push ;;
|
|
364
|
+
esac
|
|
365
|
+
;;
|
|
366
|
+
esac
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
_postman_workspace_commands() {
|
|
370
|
+
local -a sub
|
|
371
|
+
sub=(
|
|
372
|
+
'prepare:Prepare local collections and environments for push by validating and regenerating IDs if needed.'
|
|
373
|
+
'push:Push local collection, environment, and specification changes to Postman workspace.'
|
|
374
|
+
)
|
|
375
|
+
_describe -t commands 'workspace command' sub
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
_postman_workspace_prepare() {
|
|
379
|
+
_arguments \
|
|
380
|
+
'--collections-dir[Path to the collections directory (default\: "postman/collections")]:path:_files -/' \
|
|
381
|
+
'--environments-dir[Path to the environments directory (default\: "postman/environments")]:path:_files -/' \
|
|
382
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
_postman_workspace_push() {
|
|
386
|
+
_arguments \
|
|
387
|
+
'--collections-dir[Path to the collections directory (default\: "postman/collections")]:path:_files -/' \
|
|
388
|
+
'--environments-dir[Path to the environments directory (default\: "postman/environments")]:path:_files -/' \
|
|
389
|
+
'--no-prepare[Skip ID validation and auto-fix before pushing]' \
|
|
390
|
+
'(-y --yes)'{-y,--yes}'[Skip all confirmation prompts]' \
|
|
391
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
_postman_performance() {
|
|
395
|
+
local context state state_descr line
|
|
396
|
+
typeset -A opt_args
|
|
397
|
+
_arguments -C \
|
|
398
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
399
|
+
'1: :_postman_performance_commands' \
|
|
400
|
+
'*::arg:->args'
|
|
401
|
+
case $state in
|
|
402
|
+
args)
|
|
403
|
+
case $words[1] in
|
|
404
|
+
run) _postman_performance_run ;;
|
|
405
|
+
esac
|
|
406
|
+
;;
|
|
407
|
+
esac
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
_postman_performance_commands() {
|
|
411
|
+
local -a sub
|
|
412
|
+
sub=(
|
|
413
|
+
'run:Run a performance test on a collection'
|
|
414
|
+
)
|
|
415
|
+
_describe -t commands 'performance command' sub
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
_postman_performance_run() {
|
|
419
|
+
_arguments \
|
|
420
|
+
'(-e --environment)'{-e,--environment}'[Specify an Id to a Postman Environment]:id' \
|
|
421
|
+
'(-g --globals)'{-g,--globals}'[Specify an Id to a Postman Globals]:id' \
|
|
422
|
+
'--vu-count[Number of virtual users (default\: 20)]:count' \
|
|
423
|
+
'(-d --duration)'{-d,--duration}'[Duration of the performance test in minutes (default\: 10)]:minutes' \
|
|
424
|
+
'(-p --load-profile)'{-p,--load-profile}'[Load profile type\: fixed, ramp-up, spike, peak (default\: "ramp-up")]:profile' \
|
|
425
|
+
'--data-file[Path to a JSON or CSV data file to use with the collection]:path:_files -g "*.(json)"' \
|
|
426
|
+
'--postman-api-key[API Key used to load the resources from the Postman API (Only supported in the US region, use '\''postman login --region'\'' to authenticate instead)]:apiKey' \
|
|
427
|
+
'--pass-if[Pass condition in format\: function(metric, value). Functions\: less_than, greater_than, less_than_eq, greater_than_eq. Metrics\: avg, p90, p95, p99, error_rate, rps. Example\: less_than(p95, 500) or less_than(error_rate, 5)]:condition' \
|
|
428
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
429
|
+
'*:collectionId:_files -g "*.(json)"'
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
_postman_flows() {
|
|
433
|
+
local context state state_descr line
|
|
434
|
+
typeset -A opt_args
|
|
435
|
+
_arguments -C \
|
|
436
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
437
|
+
'1: :_postman_flows_commands' \
|
|
438
|
+
'*::arg:->args'
|
|
439
|
+
case $state in
|
|
440
|
+
args)
|
|
441
|
+
case $words[1] in
|
|
442
|
+
list) _postman_flows_list ;;
|
|
443
|
+
trigger) _postman_flows_trigger ;;
|
|
444
|
+
deploy) _postman_flows_deploy ;;
|
|
445
|
+
run) _postman_flows_run ;;
|
|
446
|
+
update) _postman_flows_update ;;
|
|
447
|
+
list-runs) _postman_flows_list_runs ;;
|
|
448
|
+
get-run) _postman_flows_get_run ;;
|
|
449
|
+
esac
|
|
450
|
+
;;
|
|
451
|
+
esac
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
_postman_flows_commands() {
|
|
455
|
+
local -a sub
|
|
456
|
+
sub=(
|
|
457
|
+
'list:List all flows'
|
|
458
|
+
'trigger:Trigger a deployed flow'
|
|
459
|
+
'deploy:Deploy a flow (required to trigger it)'
|
|
460
|
+
'run:Run a single flow from a file (e.g. ./path/to/flow.json)'
|
|
461
|
+
'update:Update settings for a deployed flow'
|
|
462
|
+
'list-runs:List run history for a deployed flow'
|
|
463
|
+
'get-run:Analyze a specific flow run'
|
|
464
|
+
)
|
|
465
|
+
_describe -t commands 'flows command' sub
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
_postman_flows_list() {
|
|
469
|
+
_arguments \
|
|
470
|
+
'(-w --workspace)'{-w,--workspace}'[Specify the workspace ID to list flows from]:workspaceId' \
|
|
471
|
+
'(-p --paginate)'{-p,--paginate}'[Paginates the list of flows]' \
|
|
472
|
+
'(-f --filter)'{-f,--filter}'[Filter flows by name. Pattern may be a regex, or a name prefix.]:pattern' \
|
|
473
|
+
'(-s --sort)'{-s,--sort}'[Sort flows by criteria\: "name" or "updated" (default\: updated) (default\: "updated")]:criteria' \
|
|
474
|
+
'--verbose[Verbose output]' \
|
|
475
|
+
'--debug[Debug output]' \
|
|
476
|
+
'--json[JSON output]' \
|
|
477
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
_postman_flows_trigger() {
|
|
481
|
+
_arguments \
|
|
482
|
+
'(-i --input)'{-i,--input}'[Set key=value pairs in the trigger payload (e.g. --input foo=bar --input baz=qux) (default\: \[\])]:key=value:_files -g "*.(pem|crt|key)"' \
|
|
483
|
+
'(-f --input-file)'{-f,--input-file}'[Set payload values from JSON files (e.g. --input-file ./inputs.json --input-file ./config.json) (default\: \[\])]:path.json:_files -g "*.(json)"' \
|
|
484
|
+
'(-q --query)'{-q,--query}'[Set query parameters as key=value pairs (e.g. --query foo=bar --query baz=qux) (default\: \[\])]:key=value:_files -g "*.(pem|crt|key)"' \
|
|
485
|
+
'--headers[Set custom headers as key=value pairs (e.g. --headers X-API-Key=12345 --headers User-Agent=MyApp) (default\: \[\])]:key=value:_files -g "*.(pem|crt|key)"' \
|
|
486
|
+
'(-n --dry-run)'{-n,--dry-run}'[Show the flow requestURL and payload that would be sent without making the actual request (default\: false)]' \
|
|
487
|
+
'--show-secrets[Show actual authentication tokens in dry-run output (otherwise secrets are masked) (default\: false)]' \
|
|
488
|
+
'(-r --result)'{-r,--result}'[Show only the response body (default\: false)]' \
|
|
489
|
+
'(-s --scenario)'{-s,--scenario}'[Use a named scenario from the flow definition to construct the input payload, headers, and query parameters (overridden by --headers/--query)]:name' \
|
|
490
|
+
'--verbose[Verbose output]' \
|
|
491
|
+
'--debug[Debug output]' \
|
|
492
|
+
'--json[JSON output]' \
|
|
493
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
494
|
+
'*:flowId:'
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
_postman_flows_deploy() {
|
|
498
|
+
_arguments \
|
|
499
|
+
'(-p --path)'{-p,--path}'[Specify the URL path for the trigger]:path:_files -g "*.(json)"' \
|
|
500
|
+
'(-t --timeout)'{-t,--timeout}'[Specify the HTTP session timeout (5000ms to 60000ms) (default\: "10000ms")]:timeout' \
|
|
501
|
+
'(-a --auth)'{-a,--auth}'[Enable authentication for the trigger (default\: false)]' \
|
|
502
|
+
'--verbose[Verbose output]' \
|
|
503
|
+
'--debug[Debug output]' \
|
|
504
|
+
'--json[JSON output]' \
|
|
505
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
506
|
+
'*:flowId:'
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
_postman_flows_run() {
|
|
510
|
+
_arguments \
|
|
511
|
+
'(-i --input)'{-i,--input}'[Set flow inputs as key=value pairs (e.g. --input foo=bar --input baz=qux) (default\: \[\])]:key=value:_files -g "*.(pem|crt|key)"' \
|
|
512
|
+
'(-f --input-file)'{-f,--input-file}'[Set flow inputs from JSON files (e.g. --input-file ./inputs.json --input-file ./config.json) (default\: \[\])]:path.json:_files -g "*.(json)"' \
|
|
513
|
+
'(-s --scenario)'{-s,--scenario}'[Use a pre-built scenario as flow inputs (by scenario name). Can be combined with --input and --input-file to override values.]:name' \
|
|
514
|
+
'(-e --environment)'{-e,--environment}'[Specify a path to a Postman Environment file (JSON or YAML)]:path:_files -g "*.(json)"' \
|
|
515
|
+
'--working-dir[Specify the path to the working directory]:path:_files -/' \
|
|
516
|
+
'--verbose[Show detailed information of flow run and each request (method, URL, assertions)]' \
|
|
517
|
+
'--no-truncate[Show full output without truncating long values]' \
|
|
518
|
+
'--output[Save execution result to a file (supported\: json)]:format' \
|
|
519
|
+
'--reporters[Save a test results report to a file (supported\: html)]:format' \
|
|
520
|
+
'(-x --suppress-exit-code)'{-x,--suppress-exit-code}'[Specify whether or not to override the default exit code for the current run]' \
|
|
521
|
+
'--workspace[Workspace ID required for flows that contain connector blocks. Find it in the Postman app URL\: https\://postman.com/workspace/<workspaceId>]:workspaceId' \
|
|
522
|
+
'--verbose[Verbose output]' \
|
|
523
|
+
'--debug[Debug output]' \
|
|
524
|
+
'--json[JSON output]' \
|
|
525
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
526
|
+
'*:path:_files -g "*.(json)"'
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
_postman_flows_update() {
|
|
530
|
+
_arguments \
|
|
531
|
+
'(-t --trigger)'{-t,--trigger}'[Enable or disable the flow trigger]:on|off' \
|
|
532
|
+
'(-a --auth)'{-a,--auth}'[Enable or disable authentication for the flow trigger]:on|off' \
|
|
533
|
+
'--verbose[Verbose output]' \
|
|
534
|
+
'--debug[Debug output]' \
|
|
535
|
+
'--json[JSON output]' \
|
|
536
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
537
|
+
'*:flowId:'
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
_postman_flows_list_runs() {
|
|
541
|
+
_arguments \
|
|
542
|
+
'(-w --workspace)'{-w,--workspace}'[Specify the workspace ID]:workspaceId' \
|
|
543
|
+
'(-f --flow)'{-f,--flow}'[Filter sessions by flow ID]:flowId' \
|
|
544
|
+
'(-r --range)'{-r,--range}'[Time range to list runs (e.g. 30m, 2h, 3d) (default\: "1h")]:range' \
|
|
545
|
+
'--verbose[Verbose output]' \
|
|
546
|
+
'--debug[Debug output]' \
|
|
547
|
+
'--json[JSON output]' \
|
|
548
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
_postman_flows_get_run() {
|
|
552
|
+
_arguments \
|
|
553
|
+
'(-r --run-id)'{-r,--run-id}'[Specify the run ID to analyze]:runId' \
|
|
554
|
+
'(-l --logs)'{-l,--logs}'[Show detailed event log (default\: false)]' \
|
|
555
|
+
'--filter[Filter event log by block ID prefix (can be specified multiple times) (default\: \[\])]:blockId' \
|
|
556
|
+
'--verbose[Verbose output]' \
|
|
557
|
+
'--debug[Debug output]' \
|
|
558
|
+
'--json[JSON output]' \
|
|
559
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
_postman_request() {
|
|
563
|
+
_arguments \
|
|
564
|
+
'(-H --header)'{-H,--header}'[Add HTTP header in key\:value format. Can be used multiple times. Example\: -H "Content-Type\:application/json" -H "X-API-Key\:abc123" (default\: \[\])]:header' \
|
|
565
|
+
'(-d --body)'{-d,--body}'[Request body content. Supports\: inline string, @filepath for file content, or "-" for stdin. Example\: --body '\''{"name"\:"John"}'\'' or --body @data.json]:body' \
|
|
566
|
+
'(-f --form)'{-f,--form}'[Add multipart/form-data field in key=value format. Can be used multiple times. For file uploads use key=@filepath. Example\: -f "name=John" -f "avatar=@photo.jpg" (default\: \[\])]:field' \
|
|
567
|
+
'(-e --environment)'{-e,--environment}'[Load Postman Environment by UUID or file path. Variables in URL, headers, and body will be resolved. Example\: -e dev.postman_environment.json]:path:_files -g "*.(json)"' \
|
|
568
|
+
'--timeout[Request timeout in milliseconds. Request will fail if no response within this time. (default\: 300000)]:n' \
|
|
569
|
+
'--redirects-ignore[Prevents Postman CLI from automatically following 3XX redirect responses. By default, redirects are followed.]' \
|
|
570
|
+
'--redirects-max[Maximum number of redirects to follow. Default is unlimited. Useful for preventing redirect loops.]:n' \
|
|
571
|
+
'--redirects-follow-method[Preserves the original HTTP method when following redirects. By default, redirects are followed with GET method.]' \
|
|
572
|
+
'--redirects-remove-referrer[Removes the Referer header when following redirects. By default, Referer header is sent with redirects.]' \
|
|
573
|
+
'--retry[Number of retry attempts for failed requests (4xx, 5xx, network errors). Useful for flaky endpoints or rate-limited APIs. (default\: 0)]:n' \
|
|
574
|
+
'--retry-delay[Delay between retry attempts in milliseconds. (default\: 1000)]:ms' \
|
|
575
|
+
'--script-pre-request[Add JavaScript script to run before the request. Can be inline JS or @filepath to load from file. Scripts have access to pm.* APIs. Example\: --script-pre-request "pm.environment.set('\''timestamp'\'', Date.now());" or --script-pre-request @setup.js]:script' \
|
|
576
|
+
'--script-post-request[Add JavaScript script to run after the request. Can be inline JS or @filepath to load from file. Scripts have access to pm.* APIs. Example\: --script-post-request "console.log(pm.response.json());" or --script-post-request @validate.js]:script' \
|
|
577
|
+
'(-o --output)'{-o,--output}'[Save complete response to JSON file.Useful for debugging or further processing.]:path:_files -g "*.(json)"' \
|
|
578
|
+
'--verbose[Show detailed request and response information including headers, body, and metadata.]' \
|
|
579
|
+
'--response-only[suppress all output except response body. Useful for piping to other commands.]' \
|
|
580
|
+
'--debug[Debug mode\: show detailed execution information including retry attempts, redirects, and timing breakdowns.]' \
|
|
581
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
582
|
+
'--auth-basic-username[Supply authentication parameters dynamically.]:value' \
|
|
583
|
+
'--auth-basic-password[Supply authentication parameters dynamically.]:value' \
|
|
584
|
+
'--auth-bearer-token[Supply authentication parameters dynamically.]:value' \
|
|
585
|
+
'--auth-digest-username[Supply authentication parameters dynamically.]:value' \
|
|
586
|
+
'--auth-digest-password[Supply authentication parameters dynamically.]:value' \
|
|
587
|
+
'--auth-oauth1-consumerKey[Supply authentication parameters dynamically.]:value' \
|
|
588
|
+
'--auth-oauth1-consumerSecret[Supply authentication parameters dynamically.]:value' \
|
|
589
|
+
'--auth-oauth1-token[Supply authentication parameters dynamically.]:value' \
|
|
590
|
+
'--auth-oauth1-tokenSecret[Supply authentication parameters dynamically.]:value' \
|
|
591
|
+
'--auth-oauth2-accessToken[Supply authentication parameters dynamically.]:value' \
|
|
592
|
+
'--auth-oauth2-tokenType[Supply authentication parameters dynamically.]:value' \
|
|
593
|
+
'--auth-hawk-authId[Supply authentication parameters dynamically.]:value' \
|
|
594
|
+
'--auth-hawk-authKey[Supply authentication parameters dynamically.]:value' \
|
|
595
|
+
'--auth-hawk-algorithm[Supply authentication parameters dynamically.]:value' \
|
|
596
|
+
'--auth-aws-accessKey[Supply authentication parameters dynamically.]:value' \
|
|
597
|
+
'--auth-aws-secretKey[Supply authentication parameters dynamically.]:value' \
|
|
598
|
+
'--auth-aws-region[Supply authentication parameters dynamically.]:value' \
|
|
599
|
+
'--auth-aws-service[Supply authentication parameters dynamically.]:value' \
|
|
600
|
+
'--auth-aws-sessionToken[Supply authentication parameters dynamically.]:value' \
|
|
601
|
+
'--auth-ntlm-username[Supply authentication parameters dynamically.]:value' \
|
|
602
|
+
'--auth-ntlm-password[Supply authentication parameters dynamically.]:value' \
|
|
603
|
+
'--auth-ntlm-domain[Supply authentication parameters dynamically.]:value' \
|
|
604
|
+
'--auth-ntlm-workstation[Supply authentication parameters dynamically.]:value' \
|
|
605
|
+
'--auth-apikey-key[Supply authentication parameters dynamically.]:value' \
|
|
606
|
+
'--auth-apikey-value[Supply authentication parameters dynamically.]:value' \
|
|
607
|
+
'--auth-apikey-in[Supply authentication parameters dynamically.]:value' \
|
|
608
|
+
'*:url:'
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
_postman_sdk() {
|
|
612
|
+
local context state state_descr line
|
|
613
|
+
typeset -A opt_args
|
|
614
|
+
_arguments -C \
|
|
615
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
616
|
+
'1: :_postman_sdk_commands' \
|
|
617
|
+
'*::arg:->args'
|
|
618
|
+
case $state in
|
|
619
|
+
args)
|
|
620
|
+
case $words[1] in
|
|
621
|
+
init) _postman_sdk_init ;;
|
|
622
|
+
generate|build) _postman_sdk_generate ;;
|
|
623
|
+
track) _postman_sdk_track ;;
|
|
624
|
+
list|ls) _postman_sdk_list ;;
|
|
625
|
+
fetch|get) _postman_sdk_fetch ;;
|
|
626
|
+
connect) _postman_sdk_connect ;;
|
|
627
|
+
connections) _postman_sdk_connections ;;
|
|
628
|
+
esac
|
|
629
|
+
;;
|
|
630
|
+
esac
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
_postman_sdk_commands() {
|
|
634
|
+
local -a sub
|
|
635
|
+
sub=(
|
|
636
|
+
'init:Create or update .postman/config.json with an SDK configuration stub.'
|
|
637
|
+
'generate:Generate a new SDK from a Postman collection or specification.'
|
|
638
|
+
'build:Alias for generate'
|
|
639
|
+
'track:Enable change tracking for a generated SDK. Adds file hashes to .manifest.json so that the next `sdk generate` can detect your edits and preserve them via 3-way merge.'
|
|
640
|
+
'list:List SDK builds for a collection, extensible collection, or specification.'
|
|
641
|
+
'ls:Alias for list'
|
|
642
|
+
'fetch:Download SDKs from a build by its ID.'
|
|
643
|
+
'get:Alias for fetch'
|
|
644
|
+
'connect:Connect a collection or specification to a GitHub repository for automatic SDK pull requests'
|
|
645
|
+
'connections:Manage GitHub connections that drive automatic SDK pull requests'
|
|
646
|
+
)
|
|
647
|
+
_describe -t commands 'sdk command' sub
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
_postman_sdk_init() {
|
|
651
|
+
_arguments \
|
|
652
|
+
'(-y --yes)'{-y,--yes}'[Skip prompts and overwrite existing sdk config]' \
|
|
653
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
_postman_sdk_generate() {
|
|
657
|
+
_arguments \
|
|
658
|
+
'(-l --language)'{-l,--language}'[Target language(s) for SDK generation. Specify one or more languages. \[choices\: "typescript", "python", "java", "go", "csharp", "php", "ruby", "cli", "kotlin", "rust"\]]:languages...' \
|
|
659
|
+
'--all[Generate SDKs for all supported languages]' \
|
|
660
|
+
'(-o --output-dir)'{-o,--output-dir}'[Directory where the generated SDK will be saved (default\: "./sdks")]:path:_files -/' \
|
|
661
|
+
'--name[Name for the generated SDK package]:name' \
|
|
662
|
+
'--sdk-version[Version number for the generated SDK]:version' \
|
|
663
|
+
'--config[Path to SDK generation config file (JSON). If not specified, will look for .postman/config.json (sdk key).]:path:_files -g "*.(json)"' \
|
|
664
|
+
'(-y --yes)'{-y,--yes}'[Skip all confirmation prompts and overwrite existing files]' \
|
|
665
|
+
'--overwrite[Overwrite existing files without confirmation]' \
|
|
666
|
+
'--verbose[Show detailed generation progress and logs]' \
|
|
667
|
+
'--log-level[Set build log detail level. "warn" (default) shows errors/warnings inline and collapses info notes; "info" expands all log entries (default\: "warn")]:level' \
|
|
668
|
+
'--no-track-changes[Disable change tracking. By default, file hashes are written into .manifest.json to enable edit detection on the next regeneration.]' \
|
|
669
|
+
'--no-merge[Skip custom code merge even if user edits are detected. Forces a fresh generation.]' \
|
|
670
|
+
'--conflict-strategy[Strategy for handling merge conflicts\: "mark" inserts conflict markers (default), "ours" keeps user edits, "theirs" keeps generated code]:strategy' \
|
|
671
|
+
'--no-emit[Skip downloading and saving SDK artifacts to disk. Useful in CI when the build only needs to trigger server-side pull requests.]' \
|
|
672
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
673
|
+
'*:idOrPath:'
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
_postman_sdk_track() {
|
|
677
|
+
_arguments \
|
|
678
|
+
'(-l --language)'{-l,--language}'[Language(s) to track. \[choices\: "typescript", "python", "java", "go", "csharp", "php", "ruby", "cli", "kotlin", "rust"\]]:languages...' \
|
|
679
|
+
'(-o --output-dir)'{-o,--output-dir}'[Base directory containing generated SDKs (default\: "./sdks")]:path:_files -/' \
|
|
680
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
_postman_sdk_list() {
|
|
684
|
+
_arguments \
|
|
685
|
+
'(-s --status)'{-s,--status}'[Filter builds by status (case-insensitive) \[choices\: in-progress, success, failure\]]:status' \
|
|
686
|
+
'(-o --output)'{-o,--output}'[Output format \[choices\: "json", "table"\] (default\: "table")]:format' \
|
|
687
|
+
'--log-level[Set build log detail level. "warn" (default) shows errors/warnings inline and collapses info notes; "info" expands all log entries (default\: "warn")]:level' \
|
|
688
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
689
|
+
'*:id:'
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
_postman_sdk_fetch() {
|
|
693
|
+
_arguments \
|
|
694
|
+
'(-o --output-dir)'{-o,--output-dir}'[Directory to save the downloaded SDK(s) (default\: "./sdks")]:path:_files -/' \
|
|
695
|
+
'(-l --language)'{-l,--language}'[Download only the specified language (e.g., typescript, python)]:language' \
|
|
696
|
+
'--overwrite[Overwrite existing files without confirmation]' \
|
|
697
|
+
'--verbose[Show detailed download progress]' \
|
|
698
|
+
'--log-level[Set build log detail level. "warn" (default) shows errors/warnings inline and collapses info notes; "info" expands all log entries (default\: "warn")]:level' \
|
|
699
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
700
|
+
'*:buildId:'
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
_postman_sdk_connect() {
|
|
704
|
+
_arguments \
|
|
705
|
+
'(-l --language)'{-l,--language}'[SDK language (required) \[choices\: typescript, python, java, go, csharp, php, ruby, cli, kotlin, rust\]]:language' \
|
|
706
|
+
'(-r --repo)'{-r,--repo}'[GitHub repository in <owner>/<name> form (alternative to --repo-owner + --repo-name)]:owner/name' \
|
|
707
|
+
'--repo-owner[GitHub repository owner (user or org)]:owner' \
|
|
708
|
+
'--repo-name[GitHub repository name]:name' \
|
|
709
|
+
'(-b --branch)'{-b,--branch}'[Target branch for SDK pull requests (default\: "main")]:branch' \
|
|
710
|
+
'--push-to-base[Push SDK updates directly to the base branch instead of opening a pull request (default\: false)]' \
|
|
711
|
+
'--enable-npm-publishing[Inject a GitHub Actions workflow that publishes to npm on merge (TypeScript only) (default\: false)]' \
|
|
712
|
+
'--auth-provider[OAuth provider used by the server when pushing (choices\: githubapp, github) (default\: "githubapp")]:provider' \
|
|
713
|
+
'--verbose[Show extra logging]' \
|
|
714
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
715
|
+
'*:id:'
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
_postman_sdk_connections() {
|
|
719
|
+
local context state state_descr line
|
|
720
|
+
typeset -A opt_args
|
|
721
|
+
_arguments -C \
|
|
722
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
723
|
+
'1: :_postman_sdk_connections_commands' \
|
|
724
|
+
'*::arg:->args'
|
|
725
|
+
case $state in
|
|
726
|
+
args)
|
|
727
|
+
case $words[1] in
|
|
728
|
+
list|ls) _postman_sdk_connections_list ;;
|
|
729
|
+
delete|rm) _postman_sdk_connections_delete ;;
|
|
730
|
+
esac
|
|
731
|
+
;;
|
|
732
|
+
esac
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
_postman_sdk_connections_commands() {
|
|
736
|
+
local -a sub
|
|
737
|
+
sub=(
|
|
738
|
+
'list:List GitHub connections for a collection or specification'
|
|
739
|
+
'ls:Alias for list'
|
|
740
|
+
'delete:Delete a GitHub connection for a collection or specification'
|
|
741
|
+
'rm:Alias for delete'
|
|
742
|
+
)
|
|
743
|
+
_describe -t commands 'connections command' sub
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
_postman_sdk_connections_list() {
|
|
747
|
+
_arguments \
|
|
748
|
+
'--refresh[Refresh PR statuses from GitHub before listing (slower) (default\: false)]' \
|
|
749
|
+
'--json[Output raw JSON instead of formatted text (default\: false)]' \
|
|
750
|
+
'--verbose[Show extra logging]' \
|
|
751
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
752
|
+
'*:id:'
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
_postman_sdk_connections_delete() {
|
|
756
|
+
_arguments \
|
|
757
|
+
'(-y --yes)'{-y,--yes}'[Skip the confirmation prompt (default\: false)]' \
|
|
758
|
+
'--verbose[Show extra logging]' \
|
|
759
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
760
|
+
'*:connectionId:'
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
_postman_mock() {
|
|
764
|
+
local context state state_descr line
|
|
765
|
+
typeset -A opt_args
|
|
766
|
+
_arguments -C \
|
|
767
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
768
|
+
'1: :_postman_mock_commands' \
|
|
769
|
+
'*::arg:->args'
|
|
770
|
+
case $state in
|
|
771
|
+
args)
|
|
772
|
+
case $words[1] in
|
|
773
|
+
run) _postman_mock_run ;;
|
|
774
|
+
esac
|
|
775
|
+
;;
|
|
776
|
+
esac
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
_postman_mock_commands() {
|
|
780
|
+
local -a sub
|
|
781
|
+
sub=(
|
|
782
|
+
'run:Start a local mock server given a manifest file.'
|
|
783
|
+
)
|
|
784
|
+
_describe -t commands 'mock command' sub
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
_postman_mock_run() {
|
|
788
|
+
_arguments \
|
|
789
|
+
'(-e --environment)'{-e,--environment}'[Path to an environment file (JSON or YAML) for pm.environment]:path:_files -g "*.(json)"' \
|
|
790
|
+
'(-g --globals)'{-g,--globals}'[Path to a globals file (JSON or YAML) for pm.globals]:path:_files -g "*.(json)"' \
|
|
791
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
792
|
+
'*:manifestPath:'
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
_postman_application() {
|
|
796
|
+
local context state state_descr line
|
|
797
|
+
typeset -A opt_args
|
|
798
|
+
_arguments -C \
|
|
799
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
800
|
+
'1: :_postman_application_commands' \
|
|
801
|
+
'*::arg:->args'
|
|
802
|
+
case $state in
|
|
803
|
+
args)
|
|
804
|
+
case $words[1] in
|
|
805
|
+
init) _postman_application_init ;;
|
|
806
|
+
test) _postman_application_test ;;
|
|
807
|
+
esac
|
|
808
|
+
;;
|
|
809
|
+
esac
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
_postman_application_commands() {
|
|
813
|
+
local -a sub
|
|
814
|
+
sub=(
|
|
815
|
+
'init:Initialise a postman.config.cjs file with target collections, environment, and test command.'
|
|
816
|
+
'test:Run a command first (primary task), then match captured traffic against Postman collections and run assertions.'
|
|
817
|
+
)
|
|
818
|
+
_describe -t commands 'application command' sub
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
_postman_application_init() {
|
|
822
|
+
_arguments \
|
|
823
|
+
'--target-collection[Collection name or path for the default target (repeatable) (default\: \[\])]:name' \
|
|
824
|
+
'--target-environment[Environment name or path for the default target (last value wins) (default\: \[\])]:name' \
|
|
825
|
+
'--filter-urlpatterns[Comma-separated URL patterns to exclude from captured traffic (default\: \[\])]:patterns' \
|
|
826
|
+
'--filter-methods[Comma-separated HTTP methods to exclude from captured traffic (default\: \[\])]:methods' \
|
|
827
|
+
'--filter-headers[Comma-separated request header filters in header=value form (default\: \[\])]:headers' \
|
|
828
|
+
'--command[Command to run your tests (e.g. "npx playwright test")]:cmd' \
|
|
829
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
_postman_application_test() {
|
|
833
|
+
_arguments \
|
|
834
|
+
'--target[Select a target from postman.config.js targets block (default\: "default")]:name' \
|
|
835
|
+
'--target-collection[Collection override for the selected target (repeatable) (default\: \[\])]:path:_files -g "*.(json)"' \
|
|
836
|
+
'--target-environment[Environment override for the selected target (last value wins) (default\: \[\])]:path:_files -g "*.(json)"' \
|
|
837
|
+
'--command[Command to run first (primary task). Overrides config.]:cmd' \
|
|
838
|
+
'--network-log[Directory to scan for captured artifacts, or a direct path to a Playwright JSON report / NDJSON capture file. When a directory is given, recursively discovers `*.json` Playwright reports plus their `trace.zip` attachments, and `network-capture-*.ndjson` at the top level. By default, scans Playwright config `outputDir`, test-results/, then pm-results/.]:path:_files -g "*.(json)"' \
|
|
839
|
+
'--capture-only[Skip collection matching and tests; capture traffic and save a V3 collection organised by host]' \
|
|
840
|
+
'--output[Output directory for captured collection (default\: pm-results/captured/; used with --capture-only)]:path:_files -g "*.(json)"' \
|
|
841
|
+
'--force[Overwrite the output directory if it exists and is not empty (used with --capture-only)]' \
|
|
842
|
+
'--report-events[Send application test run results and analytics to Postman]' \
|
|
843
|
+
'--verbose[Show detailed per-request matching, sandbox errors, and debug information]' \
|
|
844
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
_postman_simulate() {
|
|
848
|
+
local context state state_descr line
|
|
849
|
+
typeset -A opt_args
|
|
850
|
+
_arguments -C \
|
|
851
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
852
|
+
'1: :_postman_simulate_commands' \
|
|
853
|
+
'*::arg:->args'
|
|
854
|
+
case $state in
|
|
855
|
+
args)
|
|
856
|
+
case $words[1] in
|
|
857
|
+
run) _postman_simulate_run ;;
|
|
858
|
+
esac
|
|
859
|
+
;;
|
|
860
|
+
esac
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
_postman_simulate_commands() {
|
|
864
|
+
local -a sub
|
|
865
|
+
sub=(
|
|
866
|
+
'run:Start mocks with fault-injection scenarios defined in a .sim.yaml file'
|
|
867
|
+
)
|
|
868
|
+
_describe -t commands 'simulate command' sub
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
_postman_simulate_run() {
|
|
872
|
+
_arguments \
|
|
873
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
874
|
+
'*:filepath:_files -g "*.(json)"'
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
_postman_context() {
|
|
878
|
+
local context state state_descr line
|
|
879
|
+
typeset -A opt_args
|
|
880
|
+
_arguments -C \
|
|
881
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
882
|
+
'1: :_postman_context_commands' \
|
|
883
|
+
'*::arg:->args'
|
|
884
|
+
case $state in
|
|
885
|
+
args)
|
|
886
|
+
case $words[1] in
|
|
887
|
+
instructions) _postman_context_instructions ;;
|
|
888
|
+
collection) _postman_context_collection ;;
|
|
889
|
+
request) _postman_context_request ;;
|
|
890
|
+
folder) _postman_context_folder ;;
|
|
891
|
+
response) _postman_context_response ;;
|
|
892
|
+
workspace) _postman_context_workspace ;;
|
|
893
|
+
environment) _postman_context_environment ;;
|
|
894
|
+
esac
|
|
895
|
+
;;
|
|
896
|
+
esac
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
_postman_context_commands() {
|
|
900
|
+
local -a sub
|
|
901
|
+
sub=(
|
|
902
|
+
'instructions:Get agent instructions for using Postman Context with AI coding agents.'
|
|
903
|
+
'collection:Collection commands'
|
|
904
|
+
'request:Request commands'
|
|
905
|
+
'folder:Folder commands'
|
|
906
|
+
'response:Response commands'
|
|
907
|
+
'workspace:Workspace commands'
|
|
908
|
+
'environment:Environment commands'
|
|
909
|
+
)
|
|
910
|
+
_describe -t commands 'context command' sub
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
_postman_context_instructions() {
|
|
914
|
+
_arguments \
|
|
915
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
916
|
+
'*:topic:'
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
_postman_context_collection() {
|
|
920
|
+
local context state state_descr line
|
|
921
|
+
typeset -A opt_args
|
|
922
|
+
_arguments -C \
|
|
923
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
924
|
+
'1: :_postman_context_collection_commands' \
|
|
925
|
+
'*::arg:->args'
|
|
926
|
+
case $state in
|
|
927
|
+
args)
|
|
928
|
+
case $words[1] in
|
|
929
|
+
get) _postman_context_collection_get ;;
|
|
930
|
+
esac
|
|
931
|
+
;;
|
|
932
|
+
esac
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
_postman_context_collection_commands() {
|
|
936
|
+
local -a sub
|
|
937
|
+
sub=(
|
|
938
|
+
'get:Get a collection'\''s metadata and a map of its folders and requests. Returns collection info (name, description, variables, auth) plus a recursive tree of folders and requests.'
|
|
939
|
+
)
|
|
940
|
+
_describe -t commands 'collection command' sub
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
_postman_context_collection_get() {
|
|
944
|
+
_arguments \
|
|
945
|
+
'(-c --collection-id)'{-c,--collection-id}'[Collection ID]:id' \
|
|
946
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
_postman_context_request() {
|
|
950
|
+
local context state state_descr line
|
|
951
|
+
typeset -A opt_args
|
|
952
|
+
_arguments -C \
|
|
953
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
954
|
+
'1: :_postman_context_request_commands' \
|
|
955
|
+
'*::arg:->args'
|
|
956
|
+
case $state in
|
|
957
|
+
args)
|
|
958
|
+
case $words[1] in
|
|
959
|
+
get) _postman_context_request_get ;;
|
|
960
|
+
context) _postman_context_request_context ;;
|
|
961
|
+
esac
|
|
962
|
+
;;
|
|
963
|
+
esac
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
_postman_context_request_commands() {
|
|
967
|
+
local -a sub
|
|
968
|
+
sub=(
|
|
969
|
+
'get:Get a request from a collection'
|
|
970
|
+
'context:Fetch all context about a request and return it as a Markdown document.'
|
|
971
|
+
)
|
|
972
|
+
_describe -t commands 'request command' sub
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
_postman_context_request_get() {
|
|
976
|
+
_arguments \
|
|
977
|
+
'(-r --request-id)'{-r,--request-id}'[Request ID]:id' \
|
|
978
|
+
'(-c --collection-id)'{-c,--collection-id}'[Collection ID]:id' \
|
|
979
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
_postman_context_request_context() {
|
|
983
|
+
_arguments \
|
|
984
|
+
'(-c --collection-id)'{-c,--collection-id}'[Collection ID]:id' \
|
|
985
|
+
'(-r --request-id)'{-r,--request-id}'[Request ID]:id' \
|
|
986
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
_postman_context_folder() {
|
|
990
|
+
local context state state_descr line
|
|
991
|
+
typeset -A opt_args
|
|
992
|
+
_arguments -C \
|
|
993
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
994
|
+
'1: :_postman_context_folder_commands' \
|
|
995
|
+
'*::arg:->args'
|
|
996
|
+
case $state in
|
|
997
|
+
args)
|
|
998
|
+
case $words[1] in
|
|
999
|
+
get) _postman_context_folder_get ;;
|
|
1000
|
+
esac
|
|
1001
|
+
;;
|
|
1002
|
+
esac
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
_postman_context_folder_commands() {
|
|
1006
|
+
local -a sub
|
|
1007
|
+
sub=(
|
|
1008
|
+
'get:Get a folder from a collection'
|
|
1009
|
+
)
|
|
1010
|
+
_describe -t commands 'folder command' sub
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
_postman_context_folder_get() {
|
|
1014
|
+
_arguments \
|
|
1015
|
+
'--folder-id[Folder ID]:id' \
|
|
1016
|
+
'(-c --collection-id)'{-c,--collection-id}'[Collection ID]:id' \
|
|
1017
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
_postman_context_response() {
|
|
1021
|
+
local context state state_descr line
|
|
1022
|
+
typeset -A opt_args
|
|
1023
|
+
_arguments -C \
|
|
1024
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1025
|
+
'1: :_postman_context_response_commands' \
|
|
1026
|
+
'*::arg:->args'
|
|
1027
|
+
case $state in
|
|
1028
|
+
args)
|
|
1029
|
+
case $words[1] in
|
|
1030
|
+
get) _postman_context_response_get ;;
|
|
1031
|
+
esac
|
|
1032
|
+
;;
|
|
1033
|
+
esac
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
_postman_context_response_commands() {
|
|
1037
|
+
local -a sub
|
|
1038
|
+
sub=(
|
|
1039
|
+
'get:Get a saved response example from a collection'
|
|
1040
|
+
)
|
|
1041
|
+
_describe -t commands 'response command' sub
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
_postman_context_response_get() {
|
|
1045
|
+
_arguments \
|
|
1046
|
+
'--id[Response ID]:id' \
|
|
1047
|
+
'(-c --collection-id)'{-c,--collection-id}'[Collection ID]:id' \
|
|
1048
|
+
'(-r --request-id)'{-r,--request-id}'[Request ID]:id' \
|
|
1049
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
_postman_context_workspace() {
|
|
1053
|
+
local context state state_descr line
|
|
1054
|
+
typeset -A opt_args
|
|
1055
|
+
_arguments -C \
|
|
1056
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1057
|
+
'1: :_postman_context_workspace_commands' \
|
|
1058
|
+
'*::arg:->args'
|
|
1059
|
+
case $state in
|
|
1060
|
+
args)
|
|
1061
|
+
case $words[1] in
|
|
1062
|
+
get) _postman_context_workspace_get ;;
|
|
1063
|
+
esac
|
|
1064
|
+
;;
|
|
1065
|
+
esac
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
_postman_context_workspace_commands() {
|
|
1069
|
+
local -a sub
|
|
1070
|
+
sub=(
|
|
1071
|
+
'get:Get a workspace by ID'
|
|
1072
|
+
)
|
|
1073
|
+
_describe -t commands 'workspace command' sub
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
_postman_context_workspace_get() {
|
|
1077
|
+
_arguments \
|
|
1078
|
+
'(-w --workspace-id)'{-w,--workspace-id}'[Workspace ID]:id' \
|
|
1079
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
_postman_context_environment() {
|
|
1083
|
+
local context state state_descr line
|
|
1084
|
+
typeset -A opt_args
|
|
1085
|
+
_arguments -C \
|
|
1086
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1087
|
+
'1: :_postman_context_environment_commands' \
|
|
1088
|
+
'*::arg:->args'
|
|
1089
|
+
case $state in
|
|
1090
|
+
args)
|
|
1091
|
+
case $words[1] in
|
|
1092
|
+
get) _postman_context_environment_get ;;
|
|
1093
|
+
esac
|
|
1094
|
+
;;
|
|
1095
|
+
esac
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
_postman_context_environment_commands() {
|
|
1099
|
+
local -a sub
|
|
1100
|
+
sub=(
|
|
1101
|
+
'get:Get a single environment by ID'
|
|
1102
|
+
)
|
|
1103
|
+
_describe -t commands 'environment command' sub
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
_postman_context_environment_get() {
|
|
1107
|
+
_arguments \
|
|
1108
|
+
'(-e --environment-id)'{-e,--environment-id}'[Environment ID]:id' \
|
|
1109
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
_postman_search() {
|
|
1113
|
+
local context state state_descr line
|
|
1114
|
+
typeset -A opt_args
|
|
1115
|
+
_arguments -C \
|
|
1116
|
+
'--ownership[Ownership\: organization (or org), external, all (default\: "organization")]:ownership' \
|
|
1117
|
+
'(-n --limit)'{-n,--limit}'[Max results per page. Max allowed limit\: 25 (default\: 10)]:limit' \
|
|
1118
|
+
'--cursor[Cursor for pagination]:cursor' \
|
|
1119
|
+
'(-o --output)'{-o,--output}'[Output format\: default (card list), json (detailed JSON) (default\: "default")]:format' \
|
|
1120
|
+
'--filter[Filter expression (e.g. "workspaceId=ws-123 AND visibility=public")]:expression' \
|
|
1121
|
+
'--filter-json[Filter as raw JSON. Only a top-level "$and" list of condition objects is supported. "$or" and nested groups are not supported in --filter-json. Each condition\: { "<property>"\: { "<operator>"\: <value> } }. If both --filter and --filter-json are provided, --filter-json takes precedence.]:json' \
|
|
1122
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1123
|
+
'1: :_postman_search_commands' \
|
|
1124
|
+
'*::arg:->args'
|
|
1125
|
+
case $state in
|
|
1126
|
+
args)
|
|
1127
|
+
case $words[1] in
|
|
1128
|
+
requests) _postman_search_requests ;;
|
|
1129
|
+
collections) _postman_search_collections ;;
|
|
1130
|
+
workspaces) _postman_search_workspaces ;;
|
|
1131
|
+
flows) _postman_search_flows ;;
|
|
1132
|
+
specs) _postman_search_specs ;;
|
|
1133
|
+
mocks) _postman_search_mocks ;;
|
|
1134
|
+
environments) _postman_search_environments ;;
|
|
1135
|
+
esac
|
|
1136
|
+
;;
|
|
1137
|
+
esac
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
_postman_search_commands() {
|
|
1141
|
+
local -a sub
|
|
1142
|
+
sub=(
|
|
1143
|
+
'requests:Search for requests by name or keyword.'
|
|
1144
|
+
'collections:Search for collections by name or keyword.'
|
|
1145
|
+
'workspaces:Search for workspaces by name or keyword.'
|
|
1146
|
+
'flows:Search for flows by name or keyword.'
|
|
1147
|
+
'specs:Search for API specs by name or keyword.'
|
|
1148
|
+
'mocks:Search for mocks by name or keyword.'
|
|
1149
|
+
'environments:Search for environments by name or keyword.'
|
|
1150
|
+
)
|
|
1151
|
+
_describe -t commands 'search command' sub
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
_postman_search_requests() {
|
|
1155
|
+
_arguments \
|
|
1156
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1157
|
+
'*:query:'
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
_postman_search_collections() {
|
|
1161
|
+
_arguments \
|
|
1162
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1163
|
+
'*:query:'
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
_postman_search_workspaces() {
|
|
1167
|
+
_arguments \
|
|
1168
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1169
|
+
'*:query:'
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
_postman_search_flows() {
|
|
1173
|
+
_arguments \
|
|
1174
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1175
|
+
'*:query:'
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
_postman_search_specs() {
|
|
1179
|
+
_arguments \
|
|
1180
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1181
|
+
'*:query:'
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
_postman_search_mocks() {
|
|
1185
|
+
_arguments \
|
|
1186
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1187
|
+
'*:query:'
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
_postman_search_environments() {
|
|
1191
|
+
_arguments \
|
|
1192
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1193
|
+
'*:query:'
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
_postman_webhook() {
|
|
1197
|
+
local context state state_descr line
|
|
1198
|
+
typeset -A opt_args
|
|
1199
|
+
_arguments -C \
|
|
1200
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1201
|
+
'1: :_postman_webhook_commands' \
|
|
1202
|
+
'*::arg:->args'
|
|
1203
|
+
case $state in
|
|
1204
|
+
args)
|
|
1205
|
+
case $words[1] in
|
|
1206
|
+
create) _postman_webhook_create ;;
|
|
1207
|
+
start) _postman_webhook_start ;;
|
|
1208
|
+
pause) _postman_webhook_pause ;;
|
|
1209
|
+
list) _postman_webhook_list ;;
|
|
1210
|
+
delete) _postman_webhook_delete ;;
|
|
1211
|
+
status) _postman_webhook_status ;;
|
|
1212
|
+
forward) _postman_webhook_forward ;;
|
|
1213
|
+
esac
|
|
1214
|
+
;;
|
|
1215
|
+
esac
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
_postman_webhook_commands() {
|
|
1219
|
+
local -a sub
|
|
1220
|
+
sub=(
|
|
1221
|
+
'create:Create a new webhook and print its public URL.'
|
|
1222
|
+
'start:Activate a webhook so it can receive requests.'
|
|
1223
|
+
'pause:Pause a webhook so it no longer accepts requests.'
|
|
1224
|
+
'list:List all webhooks in a workspace.'
|
|
1225
|
+
'delete:Permanently delete a webhook.'
|
|
1226
|
+
'status:Show details for a webhook.'
|
|
1227
|
+
'forward:Forward incoming webhook requests to a local port.'
|
|
1228
|
+
)
|
|
1229
|
+
_describe -t commands 'webhook command' sub
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
_postman_webhook_create() {
|
|
1233
|
+
_arguments \
|
|
1234
|
+
'(-t --title)'{-t,--title}'[Name for the webhook (default\: "CLI Webhook")]:title' \
|
|
1235
|
+
'(-w --workspace)'{-w,--workspace}'[Postman workspace ID (falls back to .postman/resources.yaml or .postman/config.json)]:workspaceId' \
|
|
1236
|
+
'--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
|
|
1237
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
_postman_webhook_start() {
|
|
1241
|
+
_arguments \
|
|
1242
|
+
'(-w --workspace)'{-w,--workspace}'[Postman workspace ID]:workspaceId' \
|
|
1243
|
+
'--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
|
|
1244
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1245
|
+
'*:webhookIdOrUrl:'
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
_postman_webhook_pause() {
|
|
1249
|
+
_arguments \
|
|
1250
|
+
'(-w --workspace)'{-w,--workspace}'[Postman workspace ID]:workspaceId' \
|
|
1251
|
+
'--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
|
|
1252
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1253
|
+
'*:webhookIdOrUrl:'
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
_postman_webhook_list() {
|
|
1257
|
+
_arguments \
|
|
1258
|
+
'(-w --workspace)'{-w,--workspace}'[Postman workspace ID (falls back to .postman/resources.yaml or .postman/config.json)]:workspaceId' \
|
|
1259
|
+
'--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
|
|
1260
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
_postman_webhook_delete() {
|
|
1264
|
+
_arguments \
|
|
1265
|
+
'(-w --workspace)'{-w,--workspace}'[Postman workspace ID]:workspaceId' \
|
|
1266
|
+
'--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
|
|
1267
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1268
|
+
'*:webhookId:'
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
_postman_webhook_status() {
|
|
1272
|
+
_arguments \
|
|
1273
|
+
'(-w --workspace)'{-w,--workspace}'[Postman workspace ID]:workspaceId' \
|
|
1274
|
+
'--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
|
|
1275
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1276
|
+
'*:webhookId:'
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
_postman_webhook_forward() {
|
|
1280
|
+
_arguments \
|
|
1281
|
+
'(-w --workspace)'{-w,--workspace}'[Postman workspace ID]:workspaceId' \
|
|
1282
|
+
'--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
|
|
1283
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1284
|
+
'*:port:'
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
# When loaded via fpath + compinit, the file body becomes the function body of
|
|
1288
|
+
# `_postman`. In that case `funcstack[1]` is `_postman` and we must actually
|
|
1289
|
+
# invoke the completion. When sourced directly, this is a no-op — `_postman`
|
|
1290
|
+
# is registered via `compdef` at the top of this file and called later by the
|
|
1291
|
+
# completion system on TAB.
|
|
1292
|
+
if [ "$funcstack[1]" = "_postman" ]; then
|
|
1293
|
+
_postman
|
|
1294
|
+
fi
|