postman-cli-completion 1.71.0 → 1.73.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.
@@ -1,6 +1,6 @@
1
1
  #compdef postman
2
2
  compdef _postman postman
3
- # Zsh completion for Postman CLI (postman v1.71.0)
3
+ # Zsh completion for Postman CLI (postman v1.73.0)
4
4
  # Auto-generated by scripts/generate.mjs — DO NOT EDIT
5
5
  # Source: spec/commands.json
6
6
  # https://github.com/yokawasa/postman-cli-completion
@@ -10,47 +10,47 @@ _postman() {
10
10
  typeset -A opt_args
11
11
 
12
12
  _arguments -C \
13
- '(-v --version)'{-v,--version}'[output the version number]' \
13
+ '--color[Enable/Disable colored output (auto|on|off)]:value:(auto on off)' \
14
+ '(-h --help)'{-h,--help}'[Show help for command]' \
14
15
  '--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]' \
16
+ '(-v --version)'{-v,--version}'[Show postman version]' \
17
17
  '1: :_postman_commands' \
18
18
  '*::arg:->args'
19
19
 
20
20
  case $state in
21
21
  args)
22
22
  case $words[1] in
23
- login) _postman_login ;;
24
- signup) _postman_signup ;;
25
- logout) _postman_logout ;;
26
- init) _postman_init ;;
27
- whoami) _postman_whoami ;;
28
- feedback) _postman_feedback ;;
29
- update) _postman_update ;;
30
- skills) _postman_skills ;;
23
+ api) _postman_api ;;
31
24
  collection) _postman_collection ;;
25
+ dataset) _postman_dataset ;;
32
26
  environment) _postman_environment ;;
27
+ flows|fl) _postman_flows ;;
33
28
  globals) _postman_globals ;;
34
- api) _postman_api ;;
35
- runner) _postman_runner ;;
36
- spec) _postman_spec ;;
29
+ mock) _postman_mock ;;
37
30
  monitor) _postman_monitor ;;
38
- workspace|ws) _postman_workspace ;;
39
- team) _postman_team ;;
40
- performance) _postman_performance ;;
41
- flows|fl) _postman_flows ;;
42
31
  request) _postman_request ;;
32
+ runner) _postman_runner ;;
43
33
  sdk) _postman_sdk ;;
44
- mock) _postman_mock ;;
45
- application|app) _postman_application ;;
46
- simulation) _postman_simulation ;;
47
- describe) _postman_describe ;;
34
+ spec) _postman_spec ;;
35
+ workspace|ws) _postman_workspace ;;
48
36
  context-graph) _postman_context_graph ;;
37
+ describe) _postman_describe ;;
38
+ init) _postman_init ;;
49
39
  search) _postman_search ;;
50
- webhook) _postman_webhook ;;
51
- dataset) _postman_dataset ;;
40
+ skills) _postman_skills ;;
41
+ login) _postman_login ;;
42
+ logout) _postman_logout ;;
43
+ signup) _postman_signup ;;
44
+ whoami) _postman_whoami ;;
45
+ application|app) _postman_application ;;
52
46
  dependency) _postman_dependency ;;
47
+ feedback) _postman_feedback ;;
48
+ performance) _postman_performance ;;
53
49
  secret) _postman_secret ;;
50
+ simulation) _postman_simulation ;;
51
+ team) _postman_team ;;
52
+ update) _postman_update ;;
53
+ webhook) _postman_webhook ;;
54
54
  esac
55
55
  ;;
56
56
  esac
@@ -59,141 +59,89 @@ _postman() {
59
59
  _postman_commands() {
60
60
  local -a commands
61
61
  commands=(
62
- 'login:Authenticate with Postman to access your resources.'
63
- 'signup:Sign up to keep the work you created as a guest (claims your guest workspace). Waits and signs this CLI in once the sign-up is completed in a browser — opening that browser here on a terminal, or printing the URL to hand over when output is piped.'
64
- 'logout:Delete the stored Postman API key.'
65
- 'init:Set up Postman artifacts and agent instructions in a repository.'
66
- 'whoami:Show the Postman account or guest session this CLI session is using.'
67
- 'feedback:Submit feedback about CLI usability, gaps, and improvement suggestions.'
68
- 'update:Update Postman CLI using the original installation method.'
69
- 'skills:Check and update the agent skills in this repository.'
70
- 'collection:Run and test your Postman collections directly from the command line.'
71
- 'environment:Work with local Postman environments from the command line. Also read cloud environments by ID.'
72
- 'globals:Work with local Postman globals from the command line. Also read cloud globals by workspace.'
73
62
  'api:Publish and test your APIs directly from the command line'
74
- 'runner:Where your monitors execute\: run and inspect your own self-hosted runners, and list the Postman-operated regions available to your team.'
75
- 'spec:Lint and validate Specifications from the command line'
76
- 'monitor:Run and manage Postman monitors.'
77
- 'workspace:Manage workspace resources.'
78
- 'ws:Alias for workspace'
79
- 'team:Work with the teams inside your organisation.'
80
- 'performance:Manage performance tests on your collections.'
81
- 'flows:Manage and interact with flows.'
63
+ 'collection:Run and test your Postman collections directly from the command line'
64
+ 'dataset:Work with Postman datasets in local YAML files or the cloud'
65
+ 'environment:Work with local and cloud Postman environments'
66
+ 'flows:Manage and interact with flows'
82
67
  'fl:Alias for flows'
83
- 'request:Send HTTP requests from the command line with full Postman capabilities including authentication, environment variables, assertions, retries, and detailed output control.'
84
- 'sdk:Generate and manage your SDKs directly from the command line.'
85
- 'mock:Create, run, and manage Postman mocks — in your repository or in Postman cloud.'
86
- 'application:Application-level commands\: initialise config and run tests.'
68
+ 'globals:Work with local and cloud Postman globals'
69
+ 'mock:Create, run, and manage Postman mocks'
70
+ 'monitor:Run and manage Postman monitors'
71
+ 'request:Send HTTP requests with full Postman capabilities'
72
+ 'runner:Start and inspect self-hosted runners, and list Postman-operated regions'
73
+ 'sdk:Generate and manage your SDKs directly from the command line'
74
+ 'spec:Lint and validate specifications from the command line'
75
+ 'workspace:Manage workspace resources'
76
+ 'ws:Alias for workspace'
77
+ 'context-graph:Ask natural-language questions about your team'\''s Context Graph'
78
+ 'describe:Get API context for AI coding agents directly from the command line'
79
+ 'init:Set up Postman artifacts and agent instructions in a repository'
80
+ 'search:Search for Postman element types'
81
+ 'skills:Check and update the agent skills in this repository'
82
+ 'login:Authenticate with Postman to access your resources'
83
+ 'logout:Delete the stored Postman API key'
84
+ 'signup:Sign up to keep the work you created as a guest'
85
+ 'whoami:Show the Postman account or guest session this CLI session is using'
86
+ 'application:Application-level commands\: initialise config and run tests'
87
87
  'app:Alias for application'
88
- 'simulation:Create, run and manage simulations — serve several mocks behind one address.'
89
- 'describe:\[Beta\] Get API context for AI coding agents directly from the command line.'
90
- 'context-graph:Ask natural-language questions about your team'\''s Context Graph.'
91
- 'search:Search for Postman element types (requests, collections, workspaces, and more).'
92
- 'webhook:Create and manage Postman webhooks.'
93
- 'dataset:Work with Postman datasets in local YAML files or the cloud.'
94
- 'dependency:Manage workspace dependencies (Postman entities reused from other workspaces).'
95
- 'secret:Create and manage Postman secrets in a team'\''s shared vault.'
88
+ 'dependency:Manage workspace dependencies reused from other workspaces'
89
+ 'feedback:Submit feedback about CLI usability, gaps, and improvements'
90
+ 'performance:Manage performance tests on your collections'
91
+ 'secret:Create and manage Postman secrets in a team'\''s shared vault'
92
+ 'simulation:Create, run and manage simulations'
93
+ 'team:Work with the teams inside your organisation'
94
+ 'update:Update Postman CLI using the original installation method'
95
+ 'webhook:Create and manage Postman webhooks'
96
96
  )
97
97
  _describe -t commands 'postman command' commands
98
98
  }
99
99
 
100
- _postman_login() {
101
- _arguments \
102
- '--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' \
103
- '--with-api-key[Specify the API key directly.]:apikey' \
104
- '--region[Specify the region for authentication. Use "eu" for EU region.]:region:(us eu)' \
105
- '--verbose[Show detailed error information]' \
106
- '(-h --help)'{-h,--help}'[display help for command]'
107
- }
108
-
109
- _postman_signup() {
110
- _arguments \
111
- '--guest[Start working as an anonymous guest instead of signing up — no account or browser needed, so it works anywhere. Your work is saved to a temporary workspace you can keep later by running `postman signup`.]' \
112
- '--json[Print the sign-up details as machine-readable JSON.]' \
113
- '(-h --help)'{-h,--help}'[display help for command]'
114
- }
115
-
116
- _postman_logout() {
117
- _arguments \
118
- '--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' \
119
- '(-h --help)'{-h,--help}'[display help for command]'
120
- }
121
-
122
- _postman_init() {
123
- _arguments \
124
- '--json[Emit machine-readable output for agents]' \
125
- '--dry-run[Report what would happen without writing anything]' \
126
- '--no-fetch[Use the skills bundled with this CLI instead of fetching the latest]' \
127
- '--spec[Which spec is authoritative, when more than one could be]:path:_files -g "*.(yaml|yml|json)"' \
128
- '--visibility[Create and bind a workspace non-interactively (personal, team)]:status' \
129
- '(-y --yes)'{-y,--yes}'[Accept the default for every question instead of asking or stopping]' \
130
- '--report-events[Dispatch init events to the API Catalog and Application Inventory ingestion pipelines (requires login)]' \
131
- '(-h --help)'{-h,--help}'[display help for command]' \
132
- '*:path:_files -g "*.json"'
133
- }
134
-
135
- _postman_whoami() {
136
- _arguments \
137
- '--json[Print current identity as machine-readable JSON.]' \
138
- '(-h --help)'{-h,--help}'[display help for command]'
139
- }
140
-
141
- _postman_feedback() {
142
- _arguments \
143
- '--type[Feedback type\: cli_gap, improvement_suggestion, bug_report, feature_request, general (default\: general)]:type' \
144
- '--context[Command or feature context this feedback is about]:context' \
145
- '--json[Print result as machine-readable JSON]' \
146
- '(-h --help)'{-h,--help}'[display help for command]' \
147
- '*:text:'
148
- }
149
-
150
- _postman_update() {
151
- _arguments \
152
- '--check[Check whether a Postman CLI update is available.]' \
153
- '(-h --help)'{-h,--help}'[display help for command]'
154
- }
155
-
156
- _postman_skills() {
100
+ _postman_api() {
157
101
  local context state state_descr line
158
102
  typeset -A opt_args
159
103
  _arguments -C \
160
104
  '(-h --help)'{-h,--help}'[display help for command]' \
161
- '1: :_postman_skills_commands' \
105
+ '1: :_postman_api_commands' \
162
106
  '*::arg:->args'
163
107
  case $state in
164
108
  args)
165
109
  case $words[1] in
166
- status) _postman_skills_status ;;
167
- update) _postman_skills_update ;;
110
+ lint) _postman_api_lint ;;
111
+ publish) _postman_api_publish ;;
168
112
  esac
169
113
  ;;
170
114
  esac
171
115
  }
172
116
 
173
- _postman_skills_commands() {
117
+ _postman_api_commands() {
174
118
  local -a sub
175
119
  sub=(
176
- 'status:Report whether this repository'\''s skills are up to date.'
177
- 'update:Fetch the latest skills into this repository.'
120
+ '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'
121
+ '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.'
178
122
  )
179
- _describe -t commands 'skills command' sub
123
+ _describe -t commands 'api command' sub
180
124
  }
181
125
 
182
- _postman_skills_status() {
126
+ _postman_api_lint() {
183
127
  _arguments \
184
- '--json[Emit machine-readable output for agents]' \
185
- '--strict[Exit non-zero when the skills are not current]' \
128
+ '--integration-id[Specify the integration ID for the report.]:integration-id' \
129
+ '(-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' \
130
+ '(-x --suppress-exit-code)'{-x,--suppress-exit-code}'[Specify whether or not to override the default exit code for the current run]' \
186
131
  '(-h --help)'{-h,--help}'[display help for command]' \
187
- '*:path:_files -g "*.json"'
132
+ '*:api:'
188
133
  }
189
134
 
190
- _postman_skills_update() {
135
+ _postman_api_publish() {
191
136
  _arguments \
192
- '--json[Emit machine-readable output for agents]' \
193
- '--dry-run[Report what would change without writing anything]' \
194
- '--force[Overwrite skill files that were edited locally]' \
137
+ '--name[Specify the name of the version to publish.]:name' \
138
+ '--release-notes[Specify release notes for the version to publish.]:releaseNotes' \
139
+ '--collections[Specify the collections to publish. If API is connected to a repository, provide file path instead of IDs.]:collectionIds/paths...:_files -g "*.json"' \
140
+ '--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' \
141
+ '--do-not-poll[Specify whether or not to poll for completion status of the publish action.]' \
142
+ '(-x --suppress-exit-code)'{-x,--suppress-exit-code}'[Specify whether or not to override the default exit code for the current run.]' \
195
143
  '(-h --help)'{-h,--help}'[display help for command]' \
196
- '*:path:_files -g "*.json"'
144
+ '*:apiId:'
197
145
  }
198
146
 
199
147
  _postman_collection() {
@@ -706,736 +654,1018 @@ _postman_collection_run() {
706
654
  '--export-cookie-jar[Exports the cookie jar to a file after completing the run]:path:_files -g "*.json"' \
707
655
  '--verbose[Show detailed information of collection run and each request sent]' \
708
656
  '--mock[Start a mock server for the run, its path if it lives in your repository (relative or absolute, e.g. ./postman/mocks/orders) or its id if it lives in Postman cloud (fetched then run locally). An id needs `postman login` (or --postman-api-key).]:pathOrId:_files -g "*.json"' \
709
- '--port[Port for the --mock server (e.g. 4010), or "auto" for a free one. Defaults to the mock'\''s configured port. Only valid with --mock.]:port' \
657
+ '--port[Port for the --mock server or --simulation (e.g. 4010), or "auto" for a free one. Defaults to the configured port. Only valid with --mock or --simulation.]:port' \
710
658
  '--use-mock[Redirect requests for a URL or {{variable}} to a mock during the run. Format\: "<url> mock|mock-server\:<path|id> \[scenario\]". Repeat the flag to redirect several URLs (one --use-mock each). Use "mock\:<path>" for a mock in your repository (path relative or absolute, e.g. ./postman/mocks/orders), "mock\:<id>" for a mock in Postman cloud (fetched then run locally), or "mock-server\:<id>" to send requests to a deployed mock server. An id needs `postman login` (or --postman-api-key). The optional third field picks a scenario (defaults to "default"). (default\: \[\])]:mapping' \
711
- '--simulate[Start mock servers with fault-injection scenarios from a .sim.yaml file]:path:_files -g "*.(sim.yaml|yaml|yml)"' \
712
- '--simulation[Simulation id to record start history against when using --simulate.]:id' \
713
- '--simulate-workspace[Workspace that owns the --simulate run, for recording its start history.]:id' \
714
- '--no-simulate-history[Do not record the --simulate run in the simulation'\''s start history.]' \
715
- '--report-events[Dispatch run events, including git-native v3 collection run results, to the API Catalog and Application Inventory ingestion pipelines (on by default)]' \
716
- '--no-report-events[Do not dispatch run events to the API Catalog and Application Inventory ingestion pipelines]' \
659
+ '--simulation[Run the mocks in a simulation for the run, its .sim.yaml path if it lives in your repository (relative or absolute, e.g. ./postman/simulations/checkout.sim.yaml) or its id if it lives in Postman cloud (fetched then run locally). Members share one port and are addressed by routeKey (e.g. http\://localhost\:3000/<routeKey>/path). An id needs `postman login` (or --postman-api-key).]:pathOrId:_files -g "*.json"' \
660
+ '(-w --workspace)'{-w,--workspace}'[Workspace to record the --simulation run'\''s start history against. Defaults to the simulation'\''s own workspace (when run by id) or the linked project'\''s workspace.]:workspaceId' \
661
+ '--report-events[Dispatch run events, including git-native v3 collection run results and any --simulation start history, to the API Catalog and Application Inventory ingestion pipelines (on by default)]' \
662
+ '--no-report-events[Do not dispatch run events (results, --simulation start history, and analytics) to the API Catalog and Application Inventory ingestion pipelines]' \
717
663
  '(-h --help)'{-h,--help}'[display help for command]' \
718
664
  '*:collectionId/Path:_files -g "*.json"'
719
665
  }
720
666
 
721
- _postman_environment() {
667
+ _postman_dataset() {
722
668
  local context state state_descr line
723
669
  typeset -A opt_args
724
670
  _arguments -C \
725
671
  '(-h --help)'{-h,--help}'[display help for command]' \
726
- '1: :_postman_environment_commands' \
672
+ '1: :_postman_dataset_commands' \
727
673
  '*::arg:->args'
728
674
  case $state in
729
675
  args)
730
676
  case $words[1] in
731
- new) _postman_environment_new ;;
732
- list) _postman_environment_list ;;
733
- get) _postman_environment_get ;;
734
- delete) _postman_environment_delete ;;
735
- var) _postman_environment_var ;;
736
- lint) _postman_environment_lint ;;
677
+ list) _postman_dataset_list ;;
678
+ get) _postman_dataset_get ;;
679
+ query) _postman_dataset_query ;;
680
+ create) _postman_dataset_create ;;
681
+ delete) _postman_dataset_delete ;;
682
+ source) _postman_dataset_source ;;
683
+ view) _postman_dataset_view ;;
684
+ jdbc) _postman_dataset_jdbc ;;
737
685
  esac
738
686
  ;;
739
687
  esac
740
688
  }
741
689
 
742
- _postman_environment_commands() {
690
+ _postman_dataset_commands() {
743
691
  local -a sub
744
692
  sub=(
745
- 'new:Scaffold a local environment file, or create one in a Postman workspace with --workspace.'
746
- 'list:List environments in a Postman workspace.'
747
- 'get:Read an environment by ID or local environment file path.'
748
- 'delete:Delete an environment by ID or local environment file path. Prompts unless --yes is passed.'
749
- 'var:Read and update environment variables.'
750
- 'lint:Run linting on a local Postman environment at the given file or directory path.'
693
+ 'list:List local dataset YAMLs under a path, or (no path) a workspace'\''s cloud datasets.'
694
+ 'get:Print a dataset'\''s metadata and structure summary (local YAML path or cloud id).'
695
+ 'query:Run an ad-hoc SQL query against a dataset (local YAML path or cloud id).'
696
+ 'create:Scaffold a new .dataset.yaml at <path>, or (no path, with -w) create a cloud dataset.'
697
+ 'delete:Permanently remove a dataset\: a local .dataset.yaml or a cloud dataset id.'
698
+ 'source:Inspect and manage a dataset'\''s datasources.'
699
+ 'view:Inspect and manage saved views on a dataset.'
700
+ 'jdbc:Inspect JDBC drivers before attaching one to a dataset.'
751
701
  )
752
- _describe -t commands 'environment command' sub
702
+ _describe -t commands 'dataset command' sub
753
703
  }
754
704
 
755
- _postman_environment_new() {
705
+ _postman_dataset_list() {
756
706
  _arguments \
757
- '(-w --workspace)'{-w,--workspace}'[Create the environment in a cloud Postman workspace instead of scaffolding it locally. Required when the current directory is not a local Postman workspace.]:workspaceId' \
758
- '--force[Overwrite an existing local environment file.]' \
759
- '--verbose[Verbose output]' \
760
- '--json[JSON output]' \
707
+ '(-w --workspace)'{-w,--workspace}'[Postman workspace ID (cloud list)]:id' \
708
+ '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
709
+ '--json[Output as JSON instead of a table]' \
761
710
  '(-h --help)'{-h,--help}'[display help for command]' \
762
- '*:name:'
711
+ '*:pathOrDir:_files -g "*.json"'
763
712
  }
764
713
 
765
- _postman_environment_list() {
714
+ _postman_dataset_get() {
766
715
  _arguments \
767
- '(-w --workspace)'{-w,--workspace}'[Workspace ID to list environments from.]:workspaceId' \
768
- '(-f --filter)'{-f,--filter}'[Filter environments by name.]:name' \
769
- '--verbose[Verbose output]' \
770
- '--json[JSON output]' \
716
+ '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
717
+ '--no-populate[Skip fetching datasources/views for a cloud dataset]' \
718
+ '--json[Output the full dataset as JSON]' \
771
719
  '(-h --help)'{-h,--help}'[display help for command]' \
772
- '*:workspacePath:'
720
+ '*:datasetPathOrId:'
773
721
  }
774
722
 
775
- _postman_environment_get() {
723
+ _postman_dataset_query() {
776
724
  _arguments \
777
- '--verbose[Verbose output]' \
778
- '--json[JSON output]' \
725
+ '(-q --query)'{-q,--query}'[SQL query to execute (e.g. "SELECT * FROM users LIMIT 10")]:sql' \
726
+ '(-s --source)'{-s,--source}'[Execute directly against a database datasource; without --source, use federated SQLite]:nameOrIdOrSlug' \
727
+ '(-p --param)'{-p,--param}'[Bind values to $1, $2, ... in order; pass multiple values after -p or repeat -p]:value...' \
728
+ '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
729
+ '--json[Output rows as JSON instead of a table]' \
730
+ '--debug[Include safe classified dataset diagnostics]' \
779
731
  '(-h --help)'{-h,--help}'[display help for command]' \
780
- '*:environment:_files -g "*.json"'
732
+ '*:datasetPathOrId:'
781
733
  }
782
734
 
783
- _postman_environment_delete() {
735
+ _postman_dataset_create() {
784
736
  _arguments \
785
- '(-y --yes)'{-y,--yes}'[Delete without asking for confirmation first]' \
786
- '--verbose[Verbose output]' \
787
- '--json[JSON output]' \
737
+ '(-n --name)'{-n,--name}'[Human-readable name for the dataset]:name' \
738
+ '(-d --description)'{-d,--description}'[Optional description]:desc' \
739
+ '--dataset-id[Override the generated dataset id (local only; defaults to a random v4 UUID)]:uuid' \
740
+ '--force[Overwrite an existing file at <path>]' \
741
+ '(-w --workspace)'{-w,--workspace}'[Postman workspace ID (create a cloud dataset)]:id' \
742
+ '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
788
743
  '(-h --help)'{-h,--help}'[display help for command]' \
789
- '*:environment:_files -g "*.json"'
744
+ '*:path:_files -g "*.json"'
790
745
  }
791
746
 
792
- _postman_environment_var() {
747
+ _postman_dataset_delete() {
748
+ _arguments \
749
+ '(-y --yes)'{-y,--yes}'[Skip the confirmation prompt]' \
750
+ '--keep-resources[Preserve the local resource directory even when it is empty (local only)]' \
751
+ '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
752
+ '(-h --help)'{-h,--help}'[display help for command]' \
753
+ '*:datasetPathOrId:'
754
+ }
755
+
756
+ _postman_dataset_source() {
793
757
  local context state state_descr line
794
758
  typeset -A opt_args
795
759
  _arguments -C \
796
760
  '(-h --help)'{-h,--help}'[display help for command]' \
797
- '1: :_postman_environment_var_commands' \
761
+ '1: :_postman_dataset_source_commands' \
798
762
  '*::arg:->args'
799
763
  case $state in
800
764
  args)
801
765
  case $words[1] in
802
- set) _postman_environment_var_set ;;
803
- get) _postman_environment_var_get ;;
804
- unset) _postman_environment_var_unset ;;
766
+ list) _postman_dataset_source_list ;;
767
+ add) _postman_dataset_source_add ;;
768
+ remove) _postman_dataset_source_remove ;;
769
+ update) _postman_dataset_source_update ;;
770
+ test) _postman_dataset_source_test ;;
805
771
  esac
806
772
  ;;
807
773
  esac
808
774
  }
809
775
 
810
- _postman_environment_var_commands() {
776
+ _postman_dataset_source_commands() {
811
777
  local -a sub
812
778
  sub=(
813
- 'set:Set one variable in an environment, or link it to a shared-vault secret.'
814
- 'get:Read one variable value from an environment.'
815
- 'unset:Remove one variable from an environment.'
779
+ 'list:List the datasources defined on a dataset (local YAML path or cloud id).'
780
+ 'add:Add a datasource to a dataset.'
781
+ 'remove:Remove a datasource from a dataset (local YAML path or cloud id).'
782
+ 'update:Update fields on an existing datasource. Only the flags you provide are changed.'
783
+ 'test:Open and close a real connection using a source'\''s stored configuration.'
816
784
  )
817
- _describe -t commands 'var command' sub
785
+ _describe -t commands 'source command' sub
818
786
  }
819
787
 
820
- _postman_environment_var_set() {
788
+ _postman_dataset_source_list() {
821
789
  _arguments \
822
- '(-e --environment)'{-e,--environment}'[Cloud Environment ID or local environment file path.]:environment:_files -g "*.json"' \
823
- '--secret-id[Link this variable to a shared-vault secret instead of an inline value (from `secret create`'\''s output).]:id' \
824
- '--vault-id[Vault id for --secret-id (auto-resolved from --workspace when omitted).]:id' \
825
- '(-w --workspace)'{-w,--workspace}'[Workspace to resolve --vault-id from when --secret-id is given without --vault-id (falls back to .postman/resources.yaml).]:workspaceId' \
826
- '--verbose[Verbose output]' \
827
- '--json[JSON output]' \
828
- '(-h --help)'{-h,--help}'[display help for command]' \
829
- '*:value:'
790
+ '(-d --dataset)'{-d,--dataset}'[Dataset whose sources to list — a local .dataset.yaml path or a cloud dataset id]:datasetPathOrId' \
791
+ '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
792
+ '--json[Output sources as JSON instead of a table]' \
793
+ '(-h --help)'{-h,--help}'[display help for command]'
830
794
  }
831
795
 
832
- _postman_environment_var_get() {
796
+ _postman_dataset_source_add() {
833
797
  _arguments \
834
- '(-e --environment)'{-e,--environment}'[Cloud Environment ID or local environment file path.]:environment:_files -g "*.json"' \
835
- '--verbose[Verbose output]' \
836
- '--json[JSON output]' \
798
+ '(-d --dataset)'{-d,--dataset}'[Dataset to add the source to; positional target is also accepted for v1.45 compatibility]:datasetPathOrId' \
799
+ '(-n --name)'{-n,--name}'[Logical name for the source (becomes the SQL table name when it loads a file or a database --table). Required for every source except a spreadsheet, whose worksheets are each named source_<worksheet>]:name' \
800
+ '--source-id[Override the generated source id (local dataset only)]:uuid' \
801
+ '--format[Use this format instead of extension/type inference; file contents are not sniffed. A spreadsheet (xlsx/xls/ods) is added as one source per worksheet, each named source_<worksheet>]:csv|json|xlsx|xls|ods|jdbc|mysql|postgres|sqlserver' \
802
+ '--type[Source kind; local is inferred from --file, jdbc from --driver-jar]:local|mysql|postgresql|sqlserver|jdbc' \
803
+ '--file[Path to a local CSV/JSON/spreadsheet file (absolute or cwd-relative)]:path:_files -g "*.json"' \
804
+ '--ref-only[Reference the file in place; do NOT copy into data_dir (local dataset)]' \
805
+ '--force[When copying, overwrite an existing file at the destination (local dataset)]' \
806
+ '--upload[Cloud dataset only\: upload --file as a postmancloudfile source (runs via /exec). Without --upload, --file is registered as a local_filesystem source read by the local engine. Either way a cloud dataset takes csv/json only — add a spreadsheet to a local .dataset.yaml, where each worksheet becomes its own source.]' \
807
+ '--driver-jar[JDBC driver JAR(s). Repeatable, or pass several after one flag]:path...:_files -g "*.json"' \
808
+ '--driver-class[Driver class. Auto-resolved when the JAR contains exactly one]:fqcn' \
809
+ '--driver-name[Label for this driver type (defaults to the JAR filename)]:label' \
810
+ '--url-template[JDBC URL with {{placeholders}}, e.g. jdbc\:postgresql\://{{host}}\:{{port}}/{{database}}]:template' \
811
+ '--var[Value for a {{placeholder}}. Repeatable. Use vault\:<vaultId>/<secretId> for a secret. WARNING\: a literal value is visible in `ps` output and shell history, and is stored in clear text in the dataset YAML (local) or sent in the request body (cloud). Prefer a Shared Vault reference.]:name=value...' \
812
+ '--prop[Driver connection property. Repeatable. Same vault\: syntax as --var]:name=value...' \
813
+ '--vars-file[JSON object of --var values; "-" reads stdin. Supports {"$vaultId"\:..,"$secretId"\:..} objects, and keeps secrets out of argv entirely]:path:_files -g "*.json"' \
814
+ '--from-source[Reuse another source'\''s driver JAR, class and URL template]:name' \
815
+ '--java-path[Java runtime to use. Machine-local only - never written to the dataset. Also read from POSTMAN_JDBC_JAVA_PATH]:path:_files -g "*.json"' \
816
+ '--no-test[Skip the pre-write connection test. Note that resolving the driver class still starts a JVM — on a machine with no Java, pass --driver-class (or --from-source) too]' \
817
+ '--ssh-target-host-variable[Template variable holding the tunnelled host (inferred when omitted)]:name' \
818
+ '--ssh-target-port-variable[Template variable holding the tunnelled port (inferred when omitted)]:name' \
819
+ '--json[Emit the result as JSON instead of prose]' \
820
+ '--host[DB host (mysql/postgresql/sqlserver)]:host' \
821
+ '--port[DB port (defaults to 1433 for sqlserver)]:port' \
822
+ '--user[DB user. WARNING\: a literal value is visible in `ps` output and shell history, and is stored in clear text in the dataset YAML (local) or sent in the request body (cloud). Prefer a Shared Vault reference.]:user' \
823
+ '--password[DB password. WARNING\: a literal value is visible in `ps` output and shell history, and is stored in clear text in the dataset YAML (local) or sent in the request body (cloud). Prefer a Shared Vault reference.]:password' \
824
+ '--database[DB database name]:db' \
825
+ '--table[DB table to load (required for sqlserver). Leave it out to connect to the whole database; query it with `dataset query -s <source>` or `dataset view create -s <source>`]:table' \
826
+ '--ssh-host[SSH bastion host]:host' \
827
+ '--ssh-port[SSH bastion port]:port' \
828
+ '--ssh-user[SSH bastion user]:user' \
829
+ '--ssh-private-key[Path to the SSH private key. WARNING\: the path is visible in `ps` output and shell history; key contents are read locally at execution time and are not stored in the dataset config.]:filepath:_files -g "*.(pem|crt|key)"' \
830
+ '--ssh-host-key[SSH bastion public host key]:publicKey' \
831
+ '--ssh-host-key-vault-id[Shared Vault ID containing the SSH public host key]:id' \
832
+ '--ssh-host-key-secret-id[Shared Vault secret ID containing the SSH public host key]:id' \
833
+ '--ssh-insecure-skip-host-key-verification[WARNING\: disable SSH host-key verification; use only for trusted local testing]' \
834
+ '--schema[DB schema (postgresql/sqlserver; defaults to dbo for sqlserver)]:schema' \
835
+ '--encrypt[SQL Server TLS encryption (default\: true)]:true|false' \
836
+ '--trust-server-certificate[SQL Server\: skip certificate verification (default\: false; insecure)]:true|false' \
837
+ '--tls-certificate[SQL Server CA/server certificate file path]:path:_files -g "*.(pem|crt|key)"' \
838
+ '--host-name-in-certificate[SQL Server certificate hostname override]:hostname' \
839
+ '--tls-min-version[SQL Server minimum TLS version (default\: 1.2)]:1.2|1.3' \
840
+ '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
837
841
  '(-h --help)'{-h,--help}'[display help for command]' \
838
- '*:key:_files -g "*.json"'
842
+ '*:datasetPathOrId:'
839
843
  }
840
844
 
841
- _postman_environment_var_unset() {
845
+ _postman_dataset_source_remove() {
842
846
  _arguments \
843
- '(-e --environment)'{-e,--environment}'[Cloud Environment ID or local environment file path.]:environment:_files -g "*.json"' \
844
- '--verbose[Verbose output]' \
845
- '--json[JSON output]' \
847
+ '(-d --dataset)'{-d,--dataset}'[Dataset the source belongs to — a local .dataset.yaml path or a cloud dataset id]:datasetPathOrId' \
848
+ '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
846
849
  '(-h --help)'{-h,--help}'[display help for command]' \
847
- '*:key:_files -g "*.json"'
850
+ '*:sourceNameOrId:'
848
851
  }
849
852
 
850
- _postman_environment_lint() {
853
+ _postman_dataset_source_update() {
851
854
  _arguments \
852
- '(-f --fail-severity)'{-f,--fail-severity}'[Exit with failure if diagnostics at this level or above are present. \[choices\: "error", "warning"\] (default\: "error")]:value' \
853
- '(-o --output)'{-o,--output}'[Output format\: cli (human-readable), table, json, or csv. (default\: "cli")]:value' \
854
- '(-h --help)'{-h,--help}'[display help for command]' \
855
- '*:path:_files -g "*.json"'
856
- }
857
-
858
- _postman_globals() {
859
- local context state state_descr line
860
- typeset -A opt_args
861
- _arguments -C \
855
+ '(-d --dataset)'{-d,--dataset}'[Dataset the source belongs to — a local .dataset.yaml path or a cloud dataset id]:datasetPathOrId' \
856
+ '(-n --name)'{-n,--name}'[Rename the source]:name' \
857
+ '--format[Change the format (local dataset only; cloud source formats are immutable). A spreadsheet format is not offered here\: this command changes the format field alone and cannot pin a worksheet, so the source would not compile. Add the workbook with `dataset source add` instead, which makes one worksheet-pinned source per sheet]:csv|json|jdbc|mysql|postgres|sqlserver' \
858
+ '--file[Replace the source file (local dataset only; cloud file replacement is unsupported)]:path:_files -g "*.json"' \
859
+ '--ref-only[With --file, reference in place instead of copying (local dataset only)]' \
860
+ '--force[With --file, overwrite the copied destination (local dataset only)]' \
861
+ '--driver-jar[Replace the JDBC driver JAR(s)]:path...:_files -g "*.json"' \
862
+ '--driver-class[Replace the JDBC driver class]:fqcn' \
863
+ '--driver-name[Rename the JDBC driver type label]:label' \
864
+ '--url-template[Replace the JDBC URL template]:template' \
865
+ '--var[Set a JDBC template variable. Merges onto the existing values. Use vault\:<vaultId>/<secretId> for a secret. WARNING\: a literal value is visible in `ps` output and shell history, and is stored in clear text in the dataset YAML (local) or sent in the request body (cloud). Prefer a Shared Vault reference.]:name=value...' \
866
+ '--prop[Set a JDBC connection property. Merges, same vault\: syntax]:name=value...' \
867
+ '--unset-var[Remove a JDBC template variable. Merging alone can never remove a key]:name...' \
868
+ '--unset-prop[Remove a JDBC connection property]:name...' \
869
+ '--vars-file[JSON object of --var values; "-" reads stdin]:path:_files -g "*.json"' \
870
+ '--ssh-target-host-variable[Template variable holding the tunnelled host (JDBC)]:name' \
871
+ '--ssh-target-port-variable[Template variable holding the tunnelled port (JDBC)]:name' \
872
+ '--java-path[Java runtime for JDBC operations. Machine-local only]:path:_files -g "*.json"' \
873
+ '--host[Update DB host (mysql/postgresql/sqlserver)]:host' \
874
+ '--port[Update DB port]:port' \
875
+ '--user[Update DB user. WARNING\: a literal value is visible in `ps` output and shell history, and is stored in clear text in the dataset YAML (local) or sent in the request body (cloud). Prefer a Shared Vault reference.]:user' \
876
+ '--password[Update DB password. WARNING\: a literal value is visible in `ps` output and shell history, and is stored in clear text in the dataset YAML (local) or sent in the request body (cloud). Prefer a Shared Vault reference.]:password' \
877
+ '--database[Update DB database name]:db' \
878
+ '--table[Update the DB table to load. A source without a table connects to the whole database; query it with `dataset query -s <source>` or `dataset view create -s <source>`]:table' \
879
+ '--ssh-host[Update SSH bastion host]:host' \
880
+ '--ssh-port[Update SSH bastion port]:port' \
881
+ '--ssh-user[Update SSH bastion user]:user' \
882
+ '--ssh-private-key[Update the SSH private-key file path. WARNING\: the path is visible in `ps` output and shell history; key contents are read locally and are not stored in the dataset config.]:filepath:_files -g "*.(pem|crt|key)"' \
883
+ '--ssh-host-key[Update the SSH bastion public host key]:publicKey' \
884
+ '--ssh-host-key-vault-id[Update the Shared Vault ID containing the SSH public host key]:id' \
885
+ '--ssh-host-key-secret-id[Update the Shared Vault secret ID containing the SSH public host key]:id' \
886
+ '--ssh-insecure-skip-host-key-verification[WARNING\: disable SSH host-key verification; use only for trusted local testing]' \
887
+ '--schema[Update DB schema (postgresql/sqlserver)]:schema' \
888
+ '--encrypt[Update SQL Server TLS encryption]:true|false' \
889
+ '--trust-server-certificate[Update SQL Server certificate verification (true is insecure)]:true|false' \
890
+ '--tls-certificate[Update SQL Server CA/server certificate file path]:path:_files -g "*.(pem|crt|key)"' \
891
+ '--host-name-in-certificate[Update SQL Server certificate hostname override]:hostname' \
892
+ '--tls-min-version[Update SQL Server minimum TLS version]:1.2|1.3' \
893
+ '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
894
+ '--json[Emit the result as JSON instead of prose]' \
862
895
  '(-h --help)'{-h,--help}'[display help for command]' \
863
- '1: :_postman_globals_commands' \
864
- '*::arg:->args'
865
- case $state in
866
- args)
867
- case $words[1] in
868
- get) _postman_globals_get ;;
869
- var) _postman_globals_var ;;
870
- lint) _postman_globals_lint ;;
871
- esac
872
- ;;
873
- esac
874
- }
875
-
876
- _postman_globals_commands() {
877
- local -a sub
878
- sub=(
879
- 'get:Read local workspace globals from the default file, or cloud globals with --workspace.'
880
- 'var:Read and update variables in the workspace globals singleton.'
881
- 'lint:Run linting on a local Postman globals file at the given file or directory path.'
882
- )
883
- _describe -t commands 'globals command' sub
896
+ '*:sourceNameOrId:'
884
897
  }
885
898
 
886
- _postman_globals_get() {
899
+ _postman_dataset_source_test() {
887
900
  _arguments \
888
- '(-w --workspace)'{-w,--workspace}'[Workspace ID to read globals from.]:workspaceId' \
889
- '--workspace-path[Local Postman workspace path. Defaults to the current directory.]:path:_files -g "*.json"' \
890
- '--verbose[Verbose output]' \
891
- '--json[JSON output]' \
901
+ '(-d --dataset)'{-d,--dataset}'[Dataset the source belongs to — a local .dataset.yaml path or a cloud dataset id]:datasetPathOrId' \
902
+ '(-n --name)'{-n,--name}'[Source to test]:name' \
903
+ '--java-path[Java runtime to use for a JDBC source. Machine-local only; also read from POSTMAN_JDBC_JAVA_PATH]:path:_files -g "*.json"' \
904
+ '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
905
+ '--json[Emit the result as JSON instead of prose]' \
892
906
  '(-h --help)'{-h,--help}'[display help for command]'
893
907
  }
894
908
 
895
- _postman_globals_var() {
909
+ _postman_dataset_view() {
896
910
  local context state state_descr line
897
911
  typeset -A opt_args
898
912
  _arguments -C \
899
913
  '(-h --help)'{-h,--help}'[display help for command]' \
900
- '1: :_postman_globals_var_commands' \
914
+ '1: :_postman_dataset_view_commands' \
901
915
  '*::arg:->args'
902
916
  case $state in
903
917
  args)
904
918
  case $words[1] in
905
- set) _postman_globals_var_set ;;
906
- get) _postman_globals_var_get ;;
907
- unset) _postman_globals_var_unset ;;
919
+ list) _postman_dataset_view_list ;;
920
+ run) _postman_dataset_view_run ;;
921
+ create) _postman_dataset_view_create ;;
922
+ delete) _postman_dataset_view_delete ;;
923
+ update) _postman_dataset_view_update ;;
908
924
  esac
909
925
  ;;
910
926
  esac
911
927
  }
912
928
 
913
- _postman_globals_var_commands() {
929
+ _postman_dataset_view_commands() {
914
930
  local -a sub
915
931
  sub=(
916
- 'set:Set one variable in local workspace globals, or link it to a shared-vault secret.'
917
- 'get:Read one variable from local workspace globals, or cloud globals with --workspace.'
918
- 'unset:Remove one variable from local workspace globals, or cloud globals with --workspace.'
932
+ 'list:List the saved views defined on a dataset (local YAML path or cloud id).'
933
+ 'run:Execute a saved view against a dataset and print the rows.'
934
+ 'create:Add a saved view to a dataset (local YAML path or cloud id).'
935
+ 'delete:Remove a saved view from a dataset (local YAML path or cloud id).'
936
+ 'update:Update name and/or query on an existing view (local YAML path or cloud id).'
919
937
  )
920
- _describe -t commands 'var command' sub
938
+ _describe -t commands 'view command' sub
921
939
  }
922
940
 
923
- _postman_globals_var_set() {
941
+ _postman_dataset_view_list() {
924
942
  _arguments \
925
- '(-w --workspace)'{-w,--workspace}'[Workspace ID whose cloud globals should be updated.]:workspaceId' \
926
- '--secret-id[Link this variable to a shared-vault secret instead of an inline value (from `secret create`'\''s output).]:id' \
927
- '--vault-id[Vault id for --secret-id (auto-resolved from --workspace when omitted).]:id' \
928
- '--workspace-path[Local Postman workspace path. Defaults to the current directory.]:path:_files -g "*.json"' \
929
- '--verbose[Verbose output]' \
930
- '--json[JSON output]' \
931
- '(-h --help)'{-h,--help}'[display help for command]' \
932
- '*:value:'
943
+ '(-d --dataset)'{-d,--dataset}'[Dataset whose views to list — a local .dataset.yaml path or a cloud dataset id]:datasetPathOrId' \
944
+ '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
945
+ '--json[Output views as JSON instead of a table]' \
946
+ '(-h --help)'{-h,--help}'[display help for command]'
933
947
  }
934
948
 
935
- _postman_globals_var_get() {
949
+ _postman_dataset_view_run() {
936
950
  _arguments \
937
- '(-w --workspace)'{-w,--workspace}'[Workspace ID whose cloud globals should be read.]:workspaceId' \
938
- '--workspace-path[Local Postman workspace path. Defaults to the current directory.]:path:_files -g "*.json"' \
939
- '--verbose[Verbose output]' \
940
- '--json[JSON output]' \
951
+ '(-d --dataset)'{-d,--dataset}'[Dataset the view belongs to — a local .dataset.yaml path or a cloud dataset id]:datasetPathOrId' \
952
+ '(-p --param)'{-p,--param}'[Bind values to $1, $2, ... in order; pass multiple values after -p or repeat -p]:value...' \
953
+ '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
954
+ '--json[Output rows as JSON instead of a table]' \
955
+ '--debug[Include safe classified dataset diagnostics]' \
941
956
  '(-h --help)'{-h,--help}'[display help for command]' \
942
- '*:key:_files -g "*.json"'
957
+ '*:viewNameOrId:'
943
958
  }
944
959
 
945
- _postman_globals_var_unset() {
960
+ _postman_dataset_view_create() {
946
961
  _arguments \
947
- '(-w --workspace)'{-w,--workspace}'[Workspace ID whose cloud globals should be updated.]:workspaceId' \
948
- '--workspace-path[Local Postman workspace path. Defaults to the current directory.]:path:_files -g "*.json"' \
949
- '--verbose[Verbose output]' \
950
- '--json[JSON output]' \
962
+ '(-d --dataset)'{-d,--dataset}'[Dataset to add the view to — a local .dataset.yaml path or a cloud dataset id]:datasetPathOrId' \
963
+ '(-n --name)'{-n,--name}'[View name]:name' \
964
+ '(-q --query)'{-q,--query}'[SQL query the view executes]:sql' \
965
+ '(-s --source)'{-s,--source}'[Bind the view to one datasource and run the query natively against it, instead of through the federated SQLite layer. Same reference `dataset query -s` takes]:nameOrIdOrSlug' \
966
+ '--view-id[Override the generated view id (local only; cloud assigns its own)]:uuid' \
967
+ '--json[Emit the result as JSON instead of prose]' \
968
+ '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
969
+ '(-h --help)'{-h,--help}'[display help for command]'
970
+ }
971
+
972
+ _postman_dataset_view_delete() {
973
+ _arguments \
974
+ '(-d --dataset)'{-d,--dataset}'[Dataset the view belongs to — a local .dataset.yaml path or a cloud dataset id]:datasetPathOrId' \
975
+ '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
951
976
  '(-h --help)'{-h,--help}'[display help for command]' \
952
- '*:key:_files -g "*.json"'
977
+ '*:viewNameOrId:'
953
978
  }
954
979
 
955
- _postman_globals_lint() {
980
+ _postman_dataset_view_update() {
956
981
  _arguments \
957
- '(-f --fail-severity)'{-f,--fail-severity}'[Exit with failure if diagnostics at this level or above are present. \[choices\: "error", "warning"\] (default\: "error")]:value' \
958
- '(-o --output)'{-o,--output}'[Output format\: cli (human-readable), table, json, or csv. (default\: "cli")]:value' \
982
+ '(-d --dataset)'{-d,--dataset}'[Dataset the view belongs to — a local .dataset.yaml path or a cloud dataset id]:datasetPathOrId' \
983
+ '(-n --name)'{-n,--name}'[New view name]:name' \
984
+ '(-q --query)'{-q,--query}'[New SQL query]:sql' \
985
+ '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
959
986
  '(-h --help)'{-h,--help}'[display help for command]' \
960
- '*:path:_files -g "*.json"'
987
+ '*:viewNameOrId:'
961
988
  }
962
989
 
963
- _postman_api() {
990
+ _postman_dataset_jdbc() {
964
991
  local context state state_descr line
965
992
  typeset -A opt_args
966
993
  _arguments -C \
967
994
  '(-h --help)'{-h,--help}'[display help for command]' \
968
- '1: :_postman_api_commands' \
995
+ '1: :_postman_dataset_jdbc_commands' \
969
996
  '*::arg:->args'
970
997
  case $state in
971
998
  args)
972
999
  case $words[1] in
973
- lint) _postman_api_lint ;;
974
- publish) _postman_api_publish ;;
1000
+ inspect) _postman_dataset_jdbc_inspect ;;
975
1001
  esac
976
1002
  ;;
977
1003
  esac
978
1004
  }
979
1005
 
980
- _postman_api_commands() {
1006
+ _postman_dataset_jdbc_commands() {
981
1007
  local -a sub
982
1008
  sub=(
983
- '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'
984
- '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.'
1009
+ 'inspect:Detect Java, list driver classes, suggest a URL template and read driver properties.'
985
1010
  )
986
- _describe -t commands 'api command' sub
1011
+ _describe -t commands 'jdbc command' sub
987
1012
  }
988
1013
 
989
- _postman_api_lint() {
990
- _arguments \
991
- '--integration-id[Specify the integration ID for the report.]:integration-id' \
992
- '(-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' \
993
- '(-x --suppress-exit-code)'{-x,--suppress-exit-code}'[Specify whether or not to override the default exit code for the current run]' \
994
- '(-h --help)'{-h,--help}'[display help for command]' \
995
- '*:api:'
996
- }
997
-
998
- _postman_api_publish() {
1014
+ _postman_dataset_jdbc_inspect() {
999
1015
  _arguments \
1000
- '--name[Specify the name of the version to publish.]:name' \
1001
- '--release-notes[Specify release notes for the version to publish.]:releaseNotes' \
1002
- '--collections[Specify the collections to publish. If API is connected to a repository, provide file path instead of IDs.]:collectionIds/paths...:_files -g "*.json"' \
1003
- '--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' \
1004
- '--do-not-poll[Specify whether or not to poll for completion status of the publish action.]' \
1005
- '(-x --suppress-exit-code)'{-x,--suppress-exit-code}'[Specify whether or not to override the default exit code for the current run.]' \
1016
+ '--driver-class[Introspect this class instead of auto-selecting]:fqcn' \
1017
+ '--url-template[Use this URL template instead of the one inferred from the JAR filename]:template' \
1018
+ '--java-path[Java runtime to use. Machine-local only — never written to a dataset. Also read from POSTMAN_JDBC_JAVA_PATH.]:path:_files -g "*.json"' \
1019
+ '--json[Emit the discovery result as JSON]' \
1006
1020
  '(-h --help)'{-h,--help}'[display help for command]' \
1007
- '*:apiId:'
1021
+ '*:jar...:'
1008
1022
  }
1009
1023
 
1010
- _postman_runner() {
1024
+ _postman_environment() {
1011
1025
  local context state state_descr line
1012
1026
  typeset -A opt_args
1013
1027
  _arguments -C \
1014
1028
  '(-h --help)'{-h,--help}'[display help for command]' \
1015
- '1: :_postman_runner_commands' \
1029
+ '1: :_postman_environment_commands' \
1016
1030
  '*::arg:->args'
1017
1031
  case $state in
1018
1032
  args)
1019
1033
  case $words[1] in
1020
- start) _postman_runner_start ;;
1021
- list) _postman_runner_list ;;
1022
- regions) _postman_runner_regions ;;
1034
+ new) _postman_environment_new ;;
1035
+ list) _postman_environment_list ;;
1036
+ get) _postman_environment_get ;;
1037
+ delete) _postman_environment_delete ;;
1038
+ var) _postman_environment_var ;;
1039
+ lint) _postman_environment_lint ;;
1023
1040
  esac
1024
1041
  ;;
1025
1042
  esac
1026
1043
  }
1027
1044
 
1028
- _postman_runner_commands() {
1045
+ _postman_environment_commands() {
1029
1046
  local -a sub
1030
1047
  sub=(
1031
- 'start:Start a self-hosted runner in your own network.'
1032
- 'list:List the team'\''s registered self-hosted runners.'
1033
- 'regions:List the region and private-runner values valid for monitor create/update --runner, with the static IP Postman runs each one from, where your team has access to it.'
1048
+ 'new:Scaffold a local environment file, or create one in a Postman workspace with --workspace.'
1049
+ 'list:List environments in a Postman workspace.'
1050
+ 'get:Read an environment by ID or local environment file path.'
1051
+ 'delete:Delete an environment by ID or local environment file path. Prompts unless --yes is passed.'
1052
+ 'var:Read and update environment variables.'
1053
+ 'lint:Run linting on a local Postman environment at the given file or directory path.'
1034
1054
  )
1035
- _describe -t commands 'runner command' sub
1055
+ _describe -t commands 'environment command' sub
1036
1056
  }
1037
1057
 
1038
- _postman_runner_start() {
1058
+ _postman_environment_new() {
1039
1059
  _arguments \
1040
- '--id[The ID of the runner to execute]:id' \
1041
- '--key[The secret key for the runner]:key:_files -g "*.(pem|crt|key)"' \
1042
- '--region[Region this runner reports to -- use "eu" for the EU region]:region' \
1043
- '--proxy[External proxy URL, for example http\://proxy.com or http\://proxy.com\:8080]:url' \
1044
- '--egress-proxy[Enable built-in egress proxy]' \
1045
- '--egress-proxy-authz-url[Custom egress proxy authorization service base URL]:url' \
1046
- '--ssl-extra-ca-certs[Additional trusted CA certificates (PEM file, can contain multiple certs)]:path:_files -g "*.(pem|crt|key)"' \
1047
- '--dataset-jdbc-driver-dir[Folder on this machine holding the JDBC driver .jar files you put there. Required to run a dataset that uses a JDBC source. Drivers are loaded only from this folder and matched by file name; driver paths saved in the dataset are ignored]:path:_files -/' \
1048
- '--metrics[Enable the metrics server for health checks]' \
1049
- '--metrics-port[Port for the metrics server (default\: "9090")]:port' \
1050
- '--report-events[Dispatch run events to the API Catalog and Application Inventory ingestion pipelines (on by default)]' \
1051
- '--no-report-events[Do not dispatch run events to the API Catalog and Application Inventory ingestion pipelines]' \
1052
- '(-h --help)'{-h,--help}'[display help for command]'
1060
+ '(-w --workspace)'{-w,--workspace}'[Create the environment in a cloud Postman workspace instead of scaffolding it locally. Required when the current directory is not a local Postman workspace.]:workspaceId' \
1061
+ '--force[Overwrite an existing local environment file.]' \
1062
+ '--verbose[Verbose output]' \
1063
+ '--json[JSON output]' \
1064
+ '(-h --help)'{-h,--help}'[display help for command]' \
1065
+ '*:name:'
1053
1066
  }
1054
1067
 
1055
- _postman_runner_list() {
1068
+ _postman_environment_list() {
1056
1069
  _arguments \
1057
- '--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
1058
- '(-w --workspace)'{-w,--workspace}'[Filter to runners in this workspace]:id' \
1059
- '--json[Output the runner list as JSON instead of a table]' \
1060
- '(-h --help)'{-h,--help}'[display help for command]'
1070
+ '(-w --workspace)'{-w,--workspace}'[Workspace ID to list environments from.]:workspaceId' \
1071
+ '(-f --filter)'{-f,--filter}'[Filter environments by name.]:name' \
1072
+ '--verbose[Verbose output]' \
1073
+ '--json[JSON output]' \
1074
+ '(-h --help)'{-h,--help}'[display help for command]' \
1075
+ '*:workspacePath:'
1061
1076
  }
1062
1077
 
1063
- _postman_runner_regions() {
1078
+ _postman_environment_get() {
1064
1079
  _arguments \
1065
- '--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
1066
- '--json[Output the region list as JSON instead of a table]' \
1067
- '(-h --help)'{-h,--help}'[display help for command]'
1080
+ '--verbose[Verbose output]' \
1081
+ '--json[JSON output]' \
1082
+ '(-h --help)'{-h,--help}'[display help for command]' \
1083
+ '*:environment:_files -g "*.json"'
1068
1084
  }
1069
1085
 
1070
- _postman_spec() {
1086
+ _postman_environment_delete() {
1087
+ _arguments \
1088
+ '(-y --yes)'{-y,--yes}'[Delete without asking for confirmation first]' \
1089
+ '--verbose[Verbose output]' \
1090
+ '--json[JSON output]' \
1091
+ '(-h --help)'{-h,--help}'[display help for command]' \
1092
+ '*:environment:_files -g "*.json"'
1093
+ }
1094
+
1095
+ _postman_environment_var() {
1071
1096
  local context state state_descr line
1072
1097
  typeset -A opt_args
1073
1098
  _arguments -C \
1074
1099
  '(-h --help)'{-h,--help}'[display help for command]' \
1075
- '1: :_postman_spec_commands' \
1100
+ '1: :_postman_environment_var_commands' \
1076
1101
  '*::arg:->args'
1077
1102
  case $state in
1078
1103
  args)
1079
1104
  case $words[1] in
1080
- lint) _postman_spec_lint ;;
1081
- ai-readiness) _postman_spec_ai_readiness ;;
1082
- list) _postman_spec_list ;;
1083
- get) _postman_spec_get ;;
1084
- file) _postman_spec_file ;;
1085
- create) _postman_spec_create ;;
1086
- generate) _postman_spec_generate ;;
1087
- sync) _postman_spec_sync ;;
1088
- delete) _postman_spec_delete ;;
1105
+ set) _postman_environment_var_set ;;
1106
+ get) _postman_environment_var_get ;;
1107
+ unset) _postman_environment_var_unset ;;
1089
1108
  esac
1090
1109
  ;;
1091
1110
  esac
1092
1111
  }
1093
1112
 
1094
- _postman_spec_commands() {
1113
+ _postman_environment_var_commands() {
1095
1114
  local -a sub
1096
1115
  sub=(
1097
- 'lint:Run linting on the given specification by ID or local file path.'
1098
- 'ai-readiness:Score an OpenAPI specification for AI readiness by ID or local file path.'
1099
- 'list:List local spec files under a path, or (no path) a workspace'\''s cloud specs.'
1100
- 'get:Read a spec definition, including every file of a multi-file spec.'
1101
- 'file:Get, add, update, or remove files in a spec (cloud ID or local directory).'
1102
- 'create:Create a new spec in a workspace, or (with path) scaffold a local spec file.'
1103
- 'generate:Generate artifacts from a specification.'
1104
- 'sync:Sync a generated collection with its source specification.'
1105
- 'delete:Delete a spec by its cloud ID or local file path. Cannot be undone.'
1116
+ 'set:Set one variable in an environment, or link it to a shared-vault secret.'
1117
+ 'get:Read one variable value from an environment.'
1118
+ 'unset:Remove one variable from an environment.'
1106
1119
  )
1107
- _describe -t commands 'spec command' sub
1120
+ _describe -t commands 'var command' sub
1108
1121
  }
1109
1122
 
1110
- _postman_spec_lint() {
1123
+ _postman_environment_var_set() {
1111
1124
  _arguments \
1112
- '(-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' \
1113
- '(-o --output)'{-o,--output}'[Output format for the results. \[choices\: "json", "csv"\]]:value' \
1114
- '--workspace-id[The workspace ID to use for fetching governance rulesets.]:value' \
1115
- '--report-events[Dispatch events to the API Catalog and Application Inventory ingestion pipelines (on by default)]' \
1116
- '--no-report-events[Do not dispatch events to the API Catalog and Application Inventory ingestion pipelines]' \
1125
+ '(-e --environment)'{-e,--environment}'[Cloud Environment ID or local environment file path.]:environment:_files -g "*.json"' \
1126
+ '--secret-id[Link this variable to a shared-vault secret instead of an inline value (from `secret create`'\''s output).]:id' \
1127
+ '--vault-id[Vault id for --secret-id (auto-resolved from --workspace when omitted).]:id' \
1128
+ '(-w --workspace)'{-w,--workspace}'[Workspace to resolve --vault-id from when --secret-id is given without --vault-id (falls back to .postman/resources.yaml).]:workspaceId' \
1129
+ '--verbose[Verbose output]' \
1130
+ '--json[JSON output]' \
1117
1131
  '(-h --help)'{-h,--help}'[display help for command]' \
1118
- '*:spec:'
1132
+ '*:value:'
1119
1133
  }
1120
1134
 
1121
- _postman_spec_ai_readiness() {
1135
+ _postman_environment_var_get() {
1122
1136
  _arguments \
1123
- '(-o --output)'{-o,--output}'[Output format for the results. \[choices\: "cli", "json", "html"\]]:value' \
1124
- '--export[Write the report to this file instead of stdout. A directory receives the report under a name derived from the specification. Requires --output html.]:path:_files -g "*.json"' \
1125
- '--min-score[Exit with a non-zero code if the overall score is below this threshold (0-100).]:n' \
1137
+ '(-e --environment)'{-e,--environment}'[Cloud Environment ID or local environment file path.]:environment:_files -g "*.json"' \
1138
+ '--verbose[Verbose output]' \
1139
+ '--json[JSON output]' \
1126
1140
  '(-h --help)'{-h,--help}'[display help for command]' \
1127
- '*:spec:'
1141
+ '*:key:_files -g "*.json"'
1128
1142
  }
1129
1143
 
1130
- _postman_spec_list() {
1144
+ _postman_environment_var_unset() {
1131
1145
  _arguments \
1132
- '(-w --workspace)'{-w,--workspace}'[Workspace ID (defaults to .postman/resources.yaml binding)]:id' \
1133
- '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
1134
- '--json[Output as JSON]' \
1146
+ '(-e --environment)'{-e,--environment}'[Cloud Environment ID or local environment file path.]:environment:_files -g "*.json"' \
1147
+ '--verbose[Verbose output]' \
1148
+ '--json[JSON output]' \
1135
1149
  '(-h --help)'{-h,--help}'[display help for command]' \
1136
- '*:pathOrDir:_files -g "*.json"'
1150
+ '*:key:_files -g "*.json"'
1137
1151
  }
1138
1152
 
1139
- _postman_spec_get() {
1153
+ _postman_environment_lint() {
1140
1154
  _arguments \
1141
- '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
1142
- '--json[Output as JSON (full spec definition)]' \
1155
+ '(-f --fail-severity)'{-f,--fail-severity}'[Exit with failure if diagnostics at this level or above are present. \[choices\: "error", "warning"\] (default\: "error")]:value' \
1156
+ '(-o --output)'{-o,--output}'[Output format\: cli (human-readable), table, json, or csv. (default\: "cli")]:value' \
1143
1157
  '(-h --help)'{-h,--help}'[display help for command]' \
1144
- '*:spec...:'
1158
+ '*:path:_files -g "*.json"'
1145
1159
  }
1146
1160
 
1147
- _postman_spec_file() {
1161
+ _postman_flows() {
1148
1162
  local context state state_descr line
1149
1163
  typeset -A opt_args
1150
1164
  _arguments -C \
1151
1165
  '(-h --help)'{-h,--help}'[display help for command]' \
1152
- '1: :_postman_spec_file_commands' \
1166
+ '1: :_postman_flows_commands' \
1153
1167
  '*::arg:->args'
1154
1168
  case $state in
1155
1169
  args)
1156
1170
  case $words[1] in
1157
- get) _postman_spec_file_get ;;
1158
- add) _postman_spec_file_add ;;
1159
- update) _postman_spec_file_update ;;
1160
- rm) _postman_spec_file_rm ;;
1171
+ list) _postman_flows_list ;;
1172
+ trigger) _postman_flows_trigger ;;
1173
+ deploy) _postman_flows_deploy ;;
1174
+ run) _postman_flows_run ;;
1175
+ update) _postman_flows_update ;;
1176
+ list-runs) _postman_flows_list_runs ;;
1177
+ get-run) _postman_flows_get_run ;;
1161
1178
  esac
1162
1179
  ;;
1163
1180
  esac
1164
1181
  }
1165
1182
 
1166
- _postman_spec_file_commands() {
1183
+ _postman_flows_commands() {
1167
1184
  local -a sub
1168
1185
  sub=(
1169
- 'get:Show a file in a spec\: its path, size and content.'
1170
- 'add:Add a new file to a spec.'
1171
- 'update:Update an existing file in a spec.'
1172
- 'rm:Remove a file from a spec.'
1186
+ 'list:List all flows'
1187
+ 'trigger:Trigger a deployed flow'
1188
+ 'deploy:Deploy a flow (required to trigger it)'
1189
+ 'run:Run a single flow from a file (e.g. ./path/to/flow.json)'
1190
+ 'update:Update settings for a deployed flow'
1191
+ 'list-runs:List run history for a deployed flow'
1192
+ 'get-run:Analyze a specific flow run'
1173
1193
  )
1174
- _describe -t commands 'file command' sub
1194
+ _describe -t commands 'flows command' sub
1175
1195
  }
1176
1196
 
1177
- _postman_spec_file_get() {
1197
+ _postman_flows_list() {
1178
1198
  _arguments \
1179
- '--json[Output as JSON]' \
1180
- '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
1181
- '(-h --help)'{-h,--help}'[display help for command]' \
1182
- '*:filePath:_files -g "*.json"'
1199
+ '(-w --workspace)'{-w,--workspace}'[Specify the workspace ID to list flows from]:workspaceId' \
1200
+ '(-p --paginate)'{-p,--paginate}'[Paginates the list of flows]' \
1201
+ '(-f --filter)'{-f,--filter}'[Filter flows by name. Pattern may be a regex, or a name prefix.]:pattern' \
1202
+ '(-s --sort)'{-s,--sort}'[Sort flows by criteria\: "name" or "updated" (default\: updated) (default\: "updated")]:criteria' \
1203
+ '--verbose[Verbose output]' \
1204
+ '--debug[Debug output]' \
1205
+ '--json[JSON output]' \
1206
+ '(-h --help)'{-h,--help}'[display help for command]'
1183
1207
  }
1184
1208
 
1185
- _postman_spec_file_add() {
1209
+ _postman_flows_trigger() {
1186
1210
  _arguments \
1187
- '(-c --content)'{-c,--content}'[File content (reads from stdin if omitted)]:content' \
1188
- '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
1211
+ '(-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)"' \
1212
+ '(-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"' \
1213
+ '(-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)"' \
1214
+ '--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)"' \
1215
+ '(-n --dry-run)'{-n,--dry-run}'[Show the flow requestURL and payload that would be sent without making the actual request (default\: false)]' \
1216
+ '--show-secrets[Show actual authentication tokens in dry-run output (otherwise secrets are masked) (default\: false)]' \
1217
+ '(-r --result)'{-r,--result}'[Show only the response body (default\: false)]' \
1218
+ '(-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' \
1219
+ '--verbose[Verbose output]' \
1220
+ '--debug[Debug output]' \
1221
+ '--json[JSON output]' \
1189
1222
  '(-h --help)'{-h,--help}'[display help for command]' \
1190
- '*:filePath:_files -g "*.json"'
1223
+ '*:flowId:'
1191
1224
  }
1192
1225
 
1193
- _postman_spec_file_update() {
1226
+ _postman_flows_deploy() {
1194
1227
  _arguments \
1195
- '(-c --content)'{-c,--content}'[New file content (reads from stdin if omitted)]:content' \
1196
- '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
1228
+ '(-p --path)'{-p,--path}'[Specify the URL path for the trigger]:path:_files -g "*.json"' \
1229
+ '(-t --timeout)'{-t,--timeout}'[Specify the HTTP session timeout (5000ms to 60000ms) (default\: "10000ms")]:timeout' \
1230
+ '(-a --auth)'{-a,--auth}'[Enable authentication for the trigger (default\: false)]' \
1231
+ '--verbose[Verbose output]' \
1232
+ '--debug[Debug output]' \
1233
+ '--json[JSON output]' \
1197
1234
  '(-h --help)'{-h,--help}'[display help for command]' \
1198
- '*:filePath:_files -g "*.json"'
1235
+ '*:flowId:'
1199
1236
  }
1200
1237
 
1201
- _postman_spec_file_rm() {
1238
+ _postman_flows_run() {
1202
1239
  _arguments \
1203
- '(-y --yes)'{-y,--yes}'[Skip confirmation prompt]' \
1204
- '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
1205
- '(-h --help)'{-h,--help}'[display help for command]' \
1206
- '*:filePath:_files -g "*.json"'
1207
- }
1208
-
1209
- _postman_spec_create() {
1210
- _arguments \
1211
- '(-n --name)'{-n,--name}'[Specification name / title]:name' \
1212
- '(-t --type)'{-t,--type}'[Spec type\: openapi, asyncapi, graphql, protobuf, smithy (default\: openapi) (default\: "openapi")]:type' \
1213
- '--spec-version[Spec version (e.g. 3.1 for openapi, 3 for protobuf)]:ver' \
1214
- '(-f --format)'{-f,--format}'[File format\: yaml or json (openapi/asyncapi only, default\: yaml) (default\: "yaml")]:fmt' \
1215
- '(-w --workspace)'{-w,--workspace}'[Workspace ID (cloud create, defaults to .postman/resources.yaml)]:id' \
1216
- '--force[Overwrite an existing local file]' \
1217
- '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
1240
+ '(-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)"' \
1241
+ '(-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"' \
1242
+ '(-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' \
1243
+ '--iteration-data-dataset[\[BETA\] Run the flow once per row of a dataset view. Accepts a local .dataset.yaml path or a cloud dataset id (cloud requires login). Requires --iteration-data-view. Dataset columns feed the flow inputs (see --map-column).]:pathOrId:_files -g "*.(json|csv)"' \
1244
+ '--iteration-data-view[\[BETA\] Name or id of the view (within --iteration-data-dataset) whose rows drive the run.]:nameOrId' \
1245
+ '(-m --map-column)'{-m,--map-column}'[\[BETA\] Bind a flow input to a dataset column (e.g. -m isActive=active). Repeatable. Inputs whose name matches a column bind automatically. (default\: \[\])]:input=column' \
1246
+ '(-e --environment)'{-e,--environment}'[Specify a path to a Postman Environment file (JSON or YAML)]:path:_files -g "*.json"' \
1247
+ '--working-dir[Specify the path to the working directory]:path:_files -/' \
1248
+ '--no-insecure-file-read[Prevent reading dataset files situated outside of the working directory (applies to --iteration-data-dataset)]' \
1249
+ '--verbose[Show detailed information of flow run and each request (method, URL, assertions)]' \
1250
+ '--no-truncate[Show full output without truncating long values]' \
1251
+ '--output[Save execution result to a file (supported\: json)]:format' \
1252
+ '--reporters[Save a test results report to a file (supported\: html)]:format' \
1253
+ '(-x --suppress-exit-code)'{-x,--suppress-exit-code}'[Specify whether or not to override the default exit code for the current run]' \
1254
+ '--workspace[Workspace ID required for flows that contain connector blocks. Find it in the Postman app URL\: https\://postman.com/workspace/<workspaceId>]:workspaceId' \
1255
+ '--report-events[Dispatch events to the API Catalog and Application Inventory ingestion pipelines (on by default)]' \
1256
+ '--no-report-events[Do not dispatch events to the API Catalog and Application Inventory ingestion pipelines]' \
1257
+ '--verbose[Verbose output]' \
1258
+ '--debug[Debug output]' \
1259
+ '--json[JSON output]' \
1218
1260
  '(-h --help)'{-h,--help}'[display help for command]' \
1219
1261
  '*:path:_files -g "*.json"'
1220
1262
  }
1221
1263
 
1222
- _postman_spec_generate() {
1223
- local context state state_descr line
1224
- typeset -A opt_args
1225
- _arguments -C \
1264
+ _postman_flows_update() {
1265
+ _arguments \
1266
+ '(-t --trigger)'{-t,--trigger}'[Enable or disable the flow trigger]:on|off' \
1267
+ '(-a --auth)'{-a,--auth}'[Enable or disable authentication for the flow trigger]:on|off' \
1268
+ '--verbose[Verbose output]' \
1269
+ '--debug[Debug output]' \
1270
+ '--json[JSON output]' \
1226
1271
  '(-h --help)'{-h,--help}'[display help for command]' \
1227
- '1: :_postman_spec_generate_commands' \
1228
- '*::arg:->args'
1229
- case $state in
1230
- args)
1231
- case $words[1] in
1232
- collection) _postman_spec_generate_collection ;;
1233
- esac
1234
- ;;
1235
- esac
1272
+ '*:flowId:'
1236
1273
  }
1237
1274
 
1238
- _postman_spec_generate_commands() {
1239
- local -a sub
1240
- sub=(
1241
- 'collection:Generate a Postman collection from a specification.'
1242
- )
1243
- _describe -t commands 'generate command' sub
1275
+ _postman_flows_list_runs() {
1276
+ _arguments \
1277
+ '(-w --workspace)'{-w,--workspace}'[Specify the workspace ID]:workspaceId' \
1278
+ '(-f --flow)'{-f,--flow}'[Filter sessions by flow ID]:flowId' \
1279
+ '(-r --range)'{-r,--range}'[Time range to list runs (e.g. 30m, 2h, 3d) (default\: "1h")]:range' \
1280
+ '--verbose[Verbose output]' \
1281
+ '--debug[Debug output]' \
1282
+ '--json[JSON output]' \
1283
+ '(-h --help)'{-h,--help}'[display help for command]'
1244
1284
  }
1245
1285
 
1246
- _postman_spec_generate_collection() {
1286
+ _postman_flows_get_run() {
1247
1287
  _arguments \
1248
- '(-n --name)'{-n,--name}'[Collection name]:name' \
1249
- '--folder-strategy[Folder strategy\: Paths or Tags (default\: Paths) (default\: "Paths")]:strategy' \
1250
- '(-w --workspace)'{-w,--workspace}'[Workspace ID (cloud mode)]:id' \
1251
- '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
1252
- '--force[Overwrite the collection if one with this name already exists (local mode)]' \
1253
- '(-h --help)'{-h,--help}'[display help for command]' \
1254
- '*:spec:'
1288
+ '(-r --run-id)'{-r,--run-id}'[Specify the run ID to analyze]:runId' \
1289
+ '(-l --logs)'{-l,--logs}'[Show detailed event log (default\: false)]' \
1290
+ '--filter[Filter event log by block ID prefix (can be specified multiple times) (default\: \[\])]:blockId' \
1291
+ '--verbose[Verbose output]' \
1292
+ '--debug[Debug output]' \
1293
+ '--json[JSON output]' \
1294
+ '(-h --help)'{-h,--help}'[display help for command]'
1255
1295
  }
1256
1296
 
1257
- _postman_spec_sync() {
1297
+ _postman_globals() {
1258
1298
  local context state state_descr line
1259
1299
  typeset -A opt_args
1260
1300
  _arguments -C \
1261
1301
  '(-h --help)'{-h,--help}'[display help for command]' \
1262
- '1: :_postman_spec_sync_commands' \
1302
+ '1: :_postman_globals_commands' \
1263
1303
  '*::arg:->args'
1264
1304
  case $state in
1265
1305
  args)
1266
1306
  case $words[1] in
1267
- collection) _postman_spec_sync_collection ;;
1307
+ get) _postman_globals_get ;;
1308
+ var) _postman_globals_var ;;
1309
+ lint) _postman_globals_lint ;;
1268
1310
  esac
1269
1311
  ;;
1270
1312
  esac
1271
1313
  }
1272
1314
 
1273
- _postman_spec_sync_commands() {
1315
+ _postman_globals_commands() {
1274
1316
  local -a sub
1275
1317
  sub=(
1276
- 'collection:Sync a collection from a linked specification (local path or cloud UUID).'
1318
+ 'get:Read local workspace globals from the default file, or cloud globals with --workspace.'
1319
+ 'var:Read and update variables in the workspace globals singleton.'
1320
+ 'lint:Run linting on a local Postman globals file at the given file or directory path.'
1277
1321
  )
1278
- _describe -t commands 'sync command' sub
1279
- }
1280
-
1281
- _postman_spec_sync_collection() {
1282
- _arguments \
1283
- '--collection-id[Collection ID to sync (required for cloud mode)]:id' \
1284
- '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
1285
- '--force[Overwrite hand-written scripts that the spec would otherwise drop]' \
1286
- '(-h --help)'{-h,--help}'[display help for command]' \
1287
- '*:spec:'
1322
+ _describe -t commands 'globals command' sub
1288
1323
  }
1289
1324
 
1290
- _postman_spec_delete() {
1325
+ _postman_globals_get() {
1291
1326
  _arguments \
1292
- '(-y --yes)'{-y,--yes}'[Delete without asking for confirmation first]' \
1293
- '--api-key[Postman API key, used with a cloud ID (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
1294
- '(-h --help)'{-h,--help}'[display help for command]' \
1295
- '*:spec:'
1327
+ '(-w --workspace)'{-w,--workspace}'[Workspace ID to read globals from.]:workspaceId' \
1328
+ '--workspace-path[Local Postman workspace path. Defaults to the current directory.]:path:_files -g "*.json"' \
1329
+ '--verbose[Verbose output]' \
1330
+ '--json[JSON output]' \
1331
+ '(-h --help)'{-h,--help}'[display help for command]'
1296
1332
  }
1297
1333
 
1298
- _postman_monitor() {
1334
+ _postman_globals_var() {
1299
1335
  local context state state_descr line
1300
1336
  typeset -A opt_args
1301
1337
  _arguments -C \
1302
1338
  '(-h --help)'{-h,--help}'[display help for command]' \
1303
- '1: :_postman_monitor_commands' \
1339
+ '1: :_postman_globals_var_commands' \
1304
1340
  '*::arg:->args'
1305
1341
  case $state in
1306
1342
  args)
1307
1343
  case $words[1] in
1308
- run) _postman_monitor_run ;;
1309
- create) _postman_monitor_create ;;
1310
- update) _postman_monitor_update ;;
1311
- delete) _postman_monitor_delete ;;
1312
- jobs) _postman_monitor_jobs ;;
1313
- runs) _postman_monitor_runs ;;
1314
- list) _postman_monitor_list ;;
1315
- get) _postman_monitor_get ;;
1316
- metrics) _postman_monitor_metrics ;;
1317
- pause) _postman_monitor_pause ;;
1318
- resume) _postman_monitor_resume ;;
1344
+ set) _postman_globals_var_set ;;
1345
+ get) _postman_globals_var_get ;;
1346
+ unset) _postman_globals_var_unset ;;
1319
1347
  esac
1320
1348
  ;;
1321
1349
  esac
1322
1350
  }
1323
1351
 
1324
- _postman_monitor_commands() {
1352
+ _postman_globals_var_commands() {
1325
1353
  local -a sub
1326
1354
  sub=(
1327
- 'run:Invoke a monitor run and display results.'
1328
- 'create:Create a collection-based monitor.'
1329
- 'update:Update a monitor'\''s schedule, runner, notifications, request selection or run options.'
1330
- 'delete:Permanently delete a monitor. Prompts for confirmation unless --yes is passed.'
1331
- 'jobs:Inspect a monitor'\''s jobs and their per-region runs.'
1332
- 'runs:Inspect a monitor run'\''s attempts.'
1333
- 'list:List the monitors visible to you.'
1334
- 'get:Show a monitor'\''s configuration.'
1335
- 'metrics:Show per-request latency and outcome history for a monitor.'
1336
- 'pause:Pause a monitor, so it stops firing on schedule.'
1337
- 'resume:Resume a paused monitor, so it fires on schedule again.'
1355
+ 'set:Set one variable in local workspace globals, or link it to a shared-vault secret.'
1356
+ 'get:Read one variable from local workspace globals, or cloud globals with --workspace.'
1357
+ 'unset:Remove one variable from local workspace globals, or cloud globals with --workspace.'
1338
1358
  )
1339
- _describe -t commands 'monitor command' sub
1359
+ _describe -t commands 'var command' sub
1340
1360
  }
1341
1361
 
1342
- _postman_monitor_run() {
1362
+ _postman_globals_var_set() {
1343
1363
  _arguments \
1344
- '--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session, then a guest session)]:key:_files -g "*.(pem|crt|key)"' \
1345
- '(-x --suppress-exit-code)'{-x,--suppress-exit-code}'[Specify whether or not to override the default exit code for the current run]' \
1346
- '(-t --timeout)'{-t,--timeout}'[Maximum wait time for run completion in milliseconds (default\: 15 minutes) (default\: 900000)]:ms' \
1347
- '--async[Submit the run and return immediately with its job id and Postman URL, without waiting for completion]' \
1348
- '--json[Output the run'\''s verdict as JSON instead of a table, printing nothing else]' \
1364
+ '(-w --workspace)'{-w,--workspace}'[Workspace ID whose cloud globals should be updated.]:workspaceId' \
1365
+ '--secret-id[Link this variable to a shared-vault secret instead of an inline value (from `secret create`'\''s output).]:id' \
1366
+ '--vault-id[Vault id for --secret-id (auto-resolved from --workspace when omitted).]:id' \
1367
+ '--workspace-path[Local Postman workspace path. Defaults to the current directory.]:path:_files -g "*.json"' \
1368
+ '--verbose[Verbose output]' \
1369
+ '--json[JSON output]' \
1349
1370
  '(-h --help)'{-h,--help}'[display help for command]' \
1350
- '*:monitorId:'
1371
+ '*:value:'
1351
1372
  }
1352
1373
 
1353
- _postman_monitor_create() {
1374
+ _postman_globals_var_get() {
1354
1375
  _arguments \
1355
- '(-c --collection)'{-c,--collection}'[Collection to monitor -- accepts the id shown in the Postman app, prefixed or bare]:id' \
1356
- '--name[Monitor name (defaults to the linked collection'\''s own name)]:name' \
1357
- '(-e --environment)'{-e,--environment}'[Environment to run the monitored collection with]:id' \
1358
- '(-w --workspace)'{-w,--workspace}'[Workspace to create the monitor in (defaults to the workspace named in the local .postman/resources.yaml manifest; required if neither is available)]:id' \
1359
- '--schedule[Cron expression for the monitor'\''s schedule]:cron' \
1360
- '--timezone[Time zone for --schedule, for example America/New_York (defaults to the host machine'\''s own zone)]:tz' \
1361
- '--runner[A Postman region name (see `postman runner regions`) or the id of a self-hosted runner created in Postman (list existing ones with `postman runner list`) to run from (repeatable) (default\: \[\])]:value' \
1362
- '(-i --item)'{-i,--item}'[Id of a request or folder in the collection to run, in the order given (repeatable; ids only, not names or paths; defaults to every request; list ids with `postman collection get <collection-id> --json`) (default\: \[\])]:id' \
1363
- '--notify-email[Email to notify on a run failure or error (repeatable) (default\: \[\])]:email' \
1364
- '--notification-limit[Consecutive failure notifications to send before muting them]:n' \
1365
- '--retry[Times to retry a failed run]:n' \
1366
- '--timeout[Request timeout in milliseconds]:ms' \
1367
- '--delay[Delay between requests in milliseconds]:ms' \
1368
- '--strict-ssl[Fail the run when the target'\''s TLS certificate cannot be verified]' \
1369
- '--insecure[Skip TLS certificate verification for the monitored target]' \
1370
- '--follow-redirects[Follow HTTP redirects during the run]' \
1371
- '--block-redirects[Do not follow HTTP redirects during the run]' \
1372
- '--dataset-id[Dataset to use as iteration data (used together with --dataset-view-id)]:id' \
1373
- '--dataset-view-id[Dataset view to iterate (used together with --dataset-id)]:id' \
1374
- '--iteration-count[Number of iterations to run]:n' \
1375
- '--iteration-strategy[How iteration data is consumed, for example round_robin, repeat_last or stop_at_end (requires --iteration-count, --dataset-id and --dataset-view-id)]:strategy' \
1376
- '--no-run-now[Do not trigger an immediate run after creating the monitor]' \
1377
- '--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session, then a guest session)]:key:_files -g "*.(pem|crt|key)"' \
1378
- '--json[Output as JSON instead of a table]' \
1379
- '(-h --help)'{-h,--help}'[display help for command]'
1376
+ '(-w --workspace)'{-w,--workspace}'[Workspace ID whose cloud globals should be read.]:workspaceId' \
1377
+ '--workspace-path[Local Postman workspace path. Defaults to the current directory.]:path:_files -g "*.json"' \
1378
+ '--verbose[Verbose output]' \
1379
+ '--json[JSON output]' \
1380
+ '(-h --help)'{-h,--help}'[display help for command]' \
1381
+ '*:key:_files -g "*.json"'
1380
1382
  }
1381
1383
 
1382
- _postman_monitor_update() {
1384
+ _postman_globals_var_unset() {
1383
1385
  _arguments \
1384
- '--name[New monitor name]:name' \
1385
- '--schedule[New cron expression for the monitor'\''s schedule]:cron' \
1386
- '--timezone[Time zone for --schedule, for example America/New_York (defaults to the host machine'\''s own zone)]:tz' \
1387
- '--runner[A Postman region name (see `postman runner regions`) or the id of a self-hosted runner created in Postman (list existing ones with `postman runner list`) to run from (repeatable; replaces the current set) (default\: \[\])]:value' \
1388
- '(-i --item)'{-i,--item}'[Id of a request or folder in the collection to run, in the order given (repeatable; ids only, not names or paths; replaces the saved selection; list ids with `postman collection get <collection-id> --json`) (default\: \[\])]:id' \
1389
- '--clear-items[Remove the saved selection so the monitor runs every request in its collection]' \
1390
- '--notify-email[Email to notify on a run failure or error (repeatable; replaces the current list) (default\: \[\])]:email' \
1391
- '--clear-notifications[Remove every notification recipient]' \
1392
- '(-e --environment)'{-e,--environment}'[Environment to run the monitored collection with (replaces the current one)]:id' \
1393
- '--clear-environment[Run the monitored collection with no environment]' \
1394
- '--notification-limit[Consecutive failure notifications to send before muting them]:n' \
1395
- '--retry[Times to retry a failed run]:n' \
1396
- '--timeout[Request timeout in milliseconds]:ms' \
1397
- '--delay[Delay between requests in milliseconds]:ms' \
1398
- '--strict-ssl[Fail the run when the target'\''s TLS certificate cannot be verified]' \
1399
- '--insecure[Skip TLS certificate verification for the monitored target]' \
1400
- '--follow-redirects[Follow HTTP redirects during the run]' \
1401
- '--block-redirects[Do not follow HTTP redirects during the run]' \
1402
- '--dataset-id[Dataset to use as iteration data (used together with --dataset-view-id)]:id' \
1403
- '--dataset-view-id[Dataset view to iterate (used together with --dataset-id)]:id' \
1404
- '--iteration-count[Number of iterations to run]:n' \
1405
- '--iteration-strategy[How iteration data is consumed, for example round_robin, repeat_last or stop_at_end (requires --iteration-count, --dataset-id and --dataset-view-id)]:strategy' \
1406
- '--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session, then a guest session)]:key:_files -g "*.(pem|crt|key)"' \
1407
- '--json[Output as JSON instead of a table]' \
1386
+ '(-w --workspace)'{-w,--workspace}'[Workspace ID whose cloud globals should be updated.]:workspaceId' \
1387
+ '--workspace-path[Local Postman workspace path. Defaults to the current directory.]:path:_files -g "*.json"' \
1388
+ '--verbose[Verbose output]' \
1389
+ '--json[JSON output]' \
1408
1390
  '(-h --help)'{-h,--help}'[display help for command]' \
1409
- '*:monitorId:'
1391
+ '*:key:_files -g "*.json"'
1410
1392
  }
1411
1393
 
1412
- _postman_monitor_delete() {
1394
+ _postman_globals_lint() {
1413
1395
  _arguments \
1414
- '(-y --yes)'{-y,--yes}'[Skip the confirmation prompt]' \
1415
- '--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session, then a guest session)]:key:_files -g "*.(pem|crt|key)"' \
1416
- '--json[Output the outcome, including any failure, as JSON instead of a plain message]' \
1396
+ '(-f --fail-severity)'{-f,--fail-severity}'[Exit with failure if diagnostics at this level or above are present. \[choices\: "error", "warning"\] (default\: "error")]:value' \
1397
+ '(-o --output)'{-o,--output}'[Output format\: cli (human-readable), table, json, or csv. (default\: "cli")]:value' \
1417
1398
  '(-h --help)'{-h,--help}'[display help for command]' \
1418
- '*:monitorId:'
1399
+ '*:path:_files -g "*.json"'
1419
1400
  }
1420
1401
 
1421
- _postman_monitor_jobs() {
1402
+ _postman_mock() {
1422
1403
  local context state state_descr line
1423
1404
  typeset -A opt_args
1424
1405
  _arguments -C \
1425
1406
  '(-h --help)'{-h,--help}'[display help for command]' \
1426
- '1: :_postman_monitor_jobs_commands' \
1407
+ '1: :_postman_mock_commands' \
1427
1408
  '*::arg:->args'
1428
1409
  case $state in
1429
1410
  args)
1430
1411
  case $words[1] in
1431
- list) _postman_monitor_jobs_list ;;
1432
- get) _postman_monitor_jobs_get ;;
1412
+ generate) _postman_mock_generate ;;
1413
+ run) _postman_mock_run ;;
1414
+ push) _postman_mock_push ;;
1415
+ deploy) _postman_mock_deploy ;;
1416
+ get) _postman_mock_get ;;
1417
+ list) _postman_mock_list ;;
1418
+ log) _postman_mock_log ;;
1419
+ delete) _postman_mock_delete ;;
1433
1420
  esac
1434
1421
  ;;
1435
1422
  esac
1436
1423
  }
1437
1424
 
1438
- _postman_monitor_jobs_commands() {
1425
+ _postman_mock_commands() {
1426
+ local -a sub
1427
+ sub=(
1428
+ 'generate:Generate a mock from a Postman collection or an OpenAPI file, or from a built-in sample shopping-cart mock (POST /cart/items, GET /cart, POST /checkout). Writes a local mock by default, or a cloud mock with --workspace.'
1429
+ 'run:Start a mock using its path if it lives in your repository, or its id if it lives in Postman cloud (fetched and run locally).'
1430
+ 'push:Upload a mock from your repository to Postman cloud (creates it the first time, updates it after).'
1431
+ 'deploy:Turn a mock in Postman cloud into a live mock server others can call over the internet.'
1432
+ 'get:Show a mock'\''s details using its path if it lives in your repository, or its id if it lives in Postman cloud.'
1433
+ 'list:List the mocks in your repository or Postman cloud workspace'
1434
+ 'log:Show the requests a live mock server has received and the responses it sent, using its id.'
1435
+ 'delete:Delete a mock using its path if it lives in your repository, or its id if it lives in Postman cloud. Cannot be undone.'
1436
+ )
1437
+ _describe -t commands 'mock command' sub
1438
+ }
1439
+
1440
+ _postman_mock_generate() {
1441
+ _arguments \
1442
+ '(-o --output)'{-o,--output}'[Folder to save the mock in. Relative or absolute, e.g. ./postman/mocks/orders. Defaults to postman/mocks/<name>.]:dir:_files -g "*.json"' \
1443
+ '(-n --name)'{-n,--name}'[Name for the mock. Taken from the source when you provide one; required for the sample.]:name' \
1444
+ '--port[Port the mock runs on (e.g. 4010) (default\: 4500)]:port' \
1445
+ '--force[Overwrite the mock'\''s files if the target folder already has one]' \
1446
+ '(-u --update)'{-u,--update}'[Update an existing mock from the source instead of creating a new one. Path to the mock, relative or absolute, e.g. ./postman/mocks/orders. Cannot be used with --output.]:mockPath:_files -g "*.json"' \
1447
+ '(-w --workspace)'{-w,--workspace}'[Save the mock to this Postman cloud workspace (by id) instead of your repository. Cannot be used with --output, --force, or --update.]:id' \
1448
+ '--api-key[Postman API key to use with --workspace (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
1449
+ '(-x --suppress-exit-code)'{-x,--suppress-exit-code}'[Always exit with code 0, even on failure]' \
1450
+ '(-h --help)'{-h,--help}'[display help for command]' \
1451
+ '*:sourcePath:'
1452
+ }
1453
+
1454
+ _postman_mock_run() {
1455
+ _arguments \
1456
+ '(-e --environment)'{-e,--environment}'[Path to a file of environment variables for the mock. Relative or absolute, e.g. ./postman/environments/dev.environment.yaml]:path:_files -g "*.json"' \
1457
+ '(-g --globals)'{-g,--globals}'[Path to a file of global variables for the mock. Relative or absolute, e.g. ./globals.json]:path:_files -g "*.json"' \
1458
+ '(-p --port)'{-p,--port}'[Port to run on (e.g. 4010), or "auto" for a free one. Defaults to the mock'\''s configured port.]:port' \
1459
+ '--api-key[Postman API key, used with a Postman cloud id (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
1460
+ '(-w --workspace)'{-w,--workspace}'[Workspace that owns the run, for recording its start history. Auto-resolved for a Postman cloud id; required to record history for a path.]:id' \
1461
+ '--no-history[Do not record this run in the mock'\''s start history.]' \
1462
+ '--output[Live output format\: auto (default, human-readable logs) or ndjson (one JSON event per line on stdout, ending with a "summary" event — for CI or other non-interactive use) (default\: "auto")]:format' \
1463
+ '--dataset[Pass --dataset multiple times to load several .dataset.yaml files (or directories containing them). Each is made available to the mock'\''s handlers as pm.datasets(<id>). (default\: \[\])]:pathOrDir:_files -g "*.json"' \
1464
+ '(-h --help)'{-h,--help}'[display help for command]' \
1465
+ '*:mockIdOrPath:_files -g "*.json"'
1466
+ }
1467
+
1468
+ _postman_mock_push() {
1469
+ _arguments \
1470
+ '(-w --workspace)'{-w,--workspace}'[Postman cloud workspace to upload to, by id (defaults to the workspace already linked to this project)]:id' \
1471
+ '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
1472
+ '(-h --help)'{-h,--help}'[display help for command]' \
1473
+ '*:mockPath:_files -g "*.json"'
1474
+ }
1475
+
1476
+ _postman_mock_deploy() {
1477
+ _arguments \
1478
+ '(-w --workspace)'{-w,--workspace}'[Postman cloud workspace that will own the server, by id (defaults to the workspace already linked to this project)]:id' \
1479
+ '(-n --name)'{-n,--name}'[Name for the mock server (you are asked for one if you skip this)]:name' \
1480
+ '(-s --slug)'{-s,--slug}'[Short label used in the server'\''s web address, e.g. "my-mock" (you are asked for one if you skip this)]:slug' \
1481
+ '--public[Let anyone with the link reach the server. Private by default (callers must send a Postman API key).]' \
1482
+ '--auto-deploy[Update the live server automatically whenever the mock changes (off by default)]' \
1483
+ '(-y --yes)'{-y,--yes}'[Use the defaults and skip all questions (private, no auto-deploy)]' \
1484
+ '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
1485
+ '(-h --help)'{-h,--help}'[display help for command]' \
1486
+ '*:mockId:_files -g "*.json"'
1487
+ }
1488
+
1489
+ _postman_mock_get() {
1490
+ _arguments \
1491
+ '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
1492
+ '--json[Print the details as machine-readable data instead of a table]' \
1493
+ '(-h --help)'{-h,--help}'[display help for command]' \
1494
+ '*:mockIdOrPath:_files -g "*.json"'
1495
+ }
1496
+
1497
+ _postman_mock_list() {
1498
+ _arguments \
1499
+ '(-w --workspace)'{-w,--workspace}'[Postman cloud workspace whose mocks to list, by id (defaults to the workspace already linked to this project)]:id' \
1500
+ '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
1501
+ '--json[Print the list as machine-readable data instead of a table]' \
1502
+ '(-h --help)'{-h,--help}'[display help for command]' \
1503
+ '*:pathOrDir:_files -g "*.json"'
1504
+ }
1505
+
1506
+ _postman_mock_log() {
1507
+ _arguments \
1508
+ '--limit[Most entries to show (defaults to 50 when printing machine-readable output)]:n' \
1509
+ '--method[Show only requests of this type (e.g. GET, POST)]:method' \
1510
+ '--status[Show only these response codes (e.g. 404, or 5xx for any 500-series)]:code|range' \
1511
+ '--path[Show only requests to matching addresses (use * and ? as wildcards, e.g. /users/*)]:pattern' \
1512
+ '--since[Show entries from this long ago until now (e.g. 2h = the last 2 hours)]:duration' \
1513
+ '--until[Hide entries newer than this (e.g. 30m = skip the most recent 30 minutes)]:duration' \
1514
+ '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
1515
+ '--json[Print entries as machine-readable data instead of the scrollable view]' \
1516
+ '(-h --help)'{-h,--help}'[display help for command]' \
1517
+ '*:mockServerId:_files -g "*.json"'
1518
+ }
1519
+
1520
+ _postman_mock_delete() {
1521
+ _arguments \
1522
+ '(-y --yes)'{-y,--yes}'[Delete without asking for confirmation first]' \
1523
+ '--api-key[Postman API key, used with a Postman cloud id (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
1524
+ '(-h --help)'{-h,--help}'[display help for command]' \
1525
+ '*:mockIdOrPath:_files -g "*.json"'
1526
+ }
1527
+
1528
+ _postman_monitor() {
1529
+ local context state state_descr line
1530
+ typeset -A opt_args
1531
+ _arguments -C \
1532
+ '(-h --help)'{-h,--help}'[display help for command]' \
1533
+ '1: :_postman_monitor_commands' \
1534
+ '*::arg:->args'
1535
+ case $state in
1536
+ args)
1537
+ case $words[1] in
1538
+ run) _postman_monitor_run ;;
1539
+ create) _postman_monitor_create ;;
1540
+ update) _postman_monitor_update ;;
1541
+ delete) _postman_monitor_delete ;;
1542
+ jobs) _postman_monitor_jobs ;;
1543
+ runs) _postman_monitor_runs ;;
1544
+ list) _postman_monitor_list ;;
1545
+ get) _postman_monitor_get ;;
1546
+ metrics) _postman_monitor_metrics ;;
1547
+ pause) _postman_monitor_pause ;;
1548
+ resume) _postman_monitor_resume ;;
1549
+ esac
1550
+ ;;
1551
+ esac
1552
+ }
1553
+
1554
+ _postman_monitor_commands() {
1555
+ local -a sub
1556
+ sub=(
1557
+ 'run:Invoke a monitor run and display results.'
1558
+ 'create:Create a collection-based monitor.'
1559
+ 'update:Update a monitor'\''s schedule, runner, notifications, request selection or run options.'
1560
+ 'delete:Permanently delete a monitor. Prompts for confirmation unless --yes is passed.'
1561
+ 'jobs:Inspect a monitor'\''s jobs and their per-region runs.'
1562
+ 'runs:Inspect a monitor run'\''s attempts.'
1563
+ 'list:List the monitors visible to you.'
1564
+ 'get:Show a monitor'\''s configuration.'
1565
+ 'metrics:Show per-request latency and outcome history for a monitor.'
1566
+ 'pause:Pause a monitor, so it stops firing on schedule.'
1567
+ 'resume:Resume a paused monitor, so it fires on schedule again.'
1568
+ )
1569
+ _describe -t commands 'monitor command' sub
1570
+ }
1571
+
1572
+ _postman_monitor_run() {
1573
+ _arguments \
1574
+ '--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session, then a guest session)]:key:_files -g "*.(pem|crt|key)"' \
1575
+ '(-x --suppress-exit-code)'{-x,--suppress-exit-code}'[Specify whether or not to override the default exit code for the current run]' \
1576
+ '(-t --timeout)'{-t,--timeout}'[Maximum wait time for run completion in milliseconds (default\: 15 minutes) (default\: 900000)]:ms' \
1577
+ '--async[Submit the run and return immediately with its job id and Postman URL, without waiting for completion]' \
1578
+ '--json[Output the run'\''s verdict as JSON instead of a table, printing nothing else]' \
1579
+ '(-h --help)'{-h,--help}'[display help for command]' \
1580
+ '*:monitorId:'
1581
+ }
1582
+
1583
+ _postman_monitor_create() {
1584
+ _arguments \
1585
+ '(-c --collection)'{-c,--collection}'[Collection to monitor -- accepts the id shown in the Postman app, prefixed or bare]:id' \
1586
+ '--name[Monitor name (defaults to the linked collection'\''s own name)]:name' \
1587
+ '(-e --environment)'{-e,--environment}'[Environment to run the monitored collection with]:id' \
1588
+ '(-w --workspace)'{-w,--workspace}'[Workspace to create the monitor in (defaults to the workspace named in the local .postman/resources.yaml manifest; required if neither is available)]:id' \
1589
+ '--schedule[Cron expression for the monitor'\''s schedule]:cron' \
1590
+ '--timezone[Time zone for --schedule, for example America/New_York (defaults to the host machine'\''s own zone)]:tz' \
1591
+ '--runner[A Postman region name (see `postman runner regions`) or the id of a self-hosted runner created in Postman (list existing ones with `postman runner list`) to run from (repeatable) (default\: \[\])]:value' \
1592
+ '(-i --item)'{-i,--item}'[Id of a request or folder in the collection to run, in the order given (repeatable; ids only, not names or paths; defaults to every request; list ids with `postman collection get <collection-id> --json`) (default\: \[\])]:id' \
1593
+ '--notify-email[Email to notify on a run failure or error (repeatable) (default\: \[\])]:email' \
1594
+ '--notification-limit[Consecutive failure notifications to send before muting them]:n' \
1595
+ '--retry[Times to retry a failed run]:n' \
1596
+ '--timeout[Request timeout in milliseconds]:ms' \
1597
+ '--delay[Delay between requests in milliseconds]:ms' \
1598
+ '--strict-ssl[Fail the run when the target'\''s TLS certificate cannot be verified]' \
1599
+ '--insecure[Skip TLS certificate verification for the monitored target]' \
1600
+ '--follow-redirects[Follow HTTP redirects during the run]' \
1601
+ '--block-redirects[Do not follow HTTP redirects during the run]' \
1602
+ '--dataset-id[Dataset to use as iteration data (used together with --dataset-view-id)]:id' \
1603
+ '--dataset-view-id[Dataset view to iterate (used together with --dataset-id)]:id' \
1604
+ '--iteration-count[Number of iterations to run]:n' \
1605
+ '--iteration-strategy[How iteration data is consumed, for example round_robin, repeat_last or stop_at_end (requires --iteration-count, --dataset-id and --dataset-view-id)]:strategy' \
1606
+ '--no-run-now[Do not trigger an immediate run after creating the monitor]' \
1607
+ '--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session, then a guest session)]:key:_files -g "*.(pem|crt|key)"' \
1608
+ '--json[Output as JSON instead of a table]' \
1609
+ '(-h --help)'{-h,--help}'[display help for command]'
1610
+ }
1611
+
1612
+ _postman_monitor_update() {
1613
+ _arguments \
1614
+ '--name[New monitor name]:name' \
1615
+ '--schedule[New cron expression for the monitor'\''s schedule]:cron' \
1616
+ '--timezone[Time zone for --schedule, for example America/New_York (defaults to the host machine'\''s own zone)]:tz' \
1617
+ '--runner[A Postman region name (see `postman runner regions`) or the id of a self-hosted runner created in Postman (list existing ones with `postman runner list`) to run from (repeatable; replaces the current set) (default\: \[\])]:value' \
1618
+ '(-i --item)'{-i,--item}'[Id of a request or folder in the collection to run, in the order given (repeatable; ids only, not names or paths; replaces the saved selection; list ids with `postman collection get <collection-id> --json`) (default\: \[\])]:id' \
1619
+ '--clear-items[Remove the saved selection so the monitor runs every request in its collection]' \
1620
+ '--notify-email[Email to notify on a run failure or error (repeatable; replaces the current list) (default\: \[\])]:email' \
1621
+ '--clear-notifications[Remove every notification recipient]' \
1622
+ '(-e --environment)'{-e,--environment}'[Environment to run the monitored collection with (replaces the current one)]:id' \
1623
+ '--clear-environment[Run the monitored collection with no environment]' \
1624
+ '--notification-limit[Consecutive failure notifications to send before muting them]:n' \
1625
+ '--retry[Times to retry a failed run]:n' \
1626
+ '--timeout[Request timeout in milliseconds]:ms' \
1627
+ '--delay[Delay between requests in milliseconds]:ms' \
1628
+ '--strict-ssl[Fail the run when the target'\''s TLS certificate cannot be verified]' \
1629
+ '--insecure[Skip TLS certificate verification for the monitored target]' \
1630
+ '--follow-redirects[Follow HTTP redirects during the run]' \
1631
+ '--block-redirects[Do not follow HTTP redirects during the run]' \
1632
+ '--dataset-id[Dataset to use as iteration data (used together with --dataset-view-id)]:id' \
1633
+ '--dataset-view-id[Dataset view to iterate (used together with --dataset-id)]:id' \
1634
+ '--iteration-count[Number of iterations to run]:n' \
1635
+ '--iteration-strategy[How iteration data is consumed, for example round_robin, repeat_last or stop_at_end (requires --iteration-count, --dataset-id and --dataset-view-id)]:strategy' \
1636
+ '--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session, then a guest session)]:key:_files -g "*.(pem|crt|key)"' \
1637
+ '--json[Output as JSON instead of a table]' \
1638
+ '(-h --help)'{-h,--help}'[display help for command]' \
1639
+ '*:monitorId:'
1640
+ }
1641
+
1642
+ _postman_monitor_delete() {
1643
+ _arguments \
1644
+ '(-y --yes)'{-y,--yes}'[Skip the confirmation prompt]' \
1645
+ '--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session, then a guest session)]:key:_files -g "*.(pem|crt|key)"' \
1646
+ '--json[Output the outcome, including any failure, as JSON instead of a plain message]' \
1647
+ '(-h --help)'{-h,--help}'[display help for command]' \
1648
+ '*:monitorId:'
1649
+ }
1650
+
1651
+ _postman_monitor_jobs() {
1652
+ local context state state_descr line
1653
+ typeset -A opt_args
1654
+ _arguments -C \
1655
+ '(-h --help)'{-h,--help}'[display help for command]' \
1656
+ '1: :_postman_monitor_jobs_commands' \
1657
+ '*::arg:->args'
1658
+ case $state in
1659
+ args)
1660
+ case $words[1] in
1661
+ list) _postman_monitor_jobs_list ;;
1662
+ get) _postman_monitor_jobs_get ;;
1663
+ esac
1664
+ ;;
1665
+ esac
1666
+ }
1667
+
1668
+ _postman_monitor_jobs_commands() {
1439
1669
  local -a sub
1440
1670
  sub=(
1441
1671
  'list:List a monitor'\''s recent jobs.'
@@ -1555,411 +1785,6 @@ _postman_monitor_resume() {
1555
1785
  '*:monitorId:'
1556
1786
  }
1557
1787
 
1558
- _postman_workspace() {
1559
- local context state state_descr line
1560
- typeset -A opt_args
1561
- _arguments -C \
1562
- '(-h --help)'{-h,--help}'[display help for command]' \
1563
- '1: :_postman_workspace_commands' \
1564
- '*::arg:->args'
1565
- case $state in
1566
- args)
1567
- case $words[1] in
1568
- list) _postman_workspace_list ;;
1569
- prepare) _postman_workspace_prepare ;;
1570
- push) _postman_workspace_push ;;
1571
- lint) _postman_workspace_lint ;;
1572
- get) _postman_workspace_get ;;
1573
- create) _postman_workspace_create ;;
1574
- delete) _postman_workspace_delete ;;
1575
- pull) _postman_workspace_pull ;;
1576
- connect-git) _postman_workspace_connect_git ;;
1577
- disconnect-git) _postman_workspace_disconnect_git ;;
1578
- diff) _postman_workspace_diff ;;
1579
- esac
1580
- ;;
1581
- esac
1582
- }
1583
-
1584
- _postman_workspace_commands() {
1585
- local -a sub
1586
- sub=(
1587
- 'list:List all available Postman Workspaces'
1588
- 'prepare:Prepare local collections and environments for push by validating and regenerating IDs if needed.'
1589
- 'push:Push local workspace entities (collections, environments, specifications, mocks and more) to Postman workspace.'
1590
- 'lint:Lint the current local Postman workspace\: its configuration (.postman/resources.yaml) plus every discovered entity. Use --meta to lint only the configuration.'
1591
- 'get:Read a workspace'\''s metadata, and optionally the ids of what it holds.'
1592
- 'create:Create a Postman workspace and bind it to this git repository.'
1593
- 'delete:Permanently delete a workspace and everything in it. Prompts for confirmation unless --yes is passed.'
1594
- 'pull:Pull workspace entities from a Postman workspace into the local git-native folder.'
1595
- 'connect-git:Connect a Postman workspace to a local git repository.'
1596
- 'disconnect-git:Disconnect a Postman workspace from its local git repository.'
1597
- 'diff:Preview local-vs-cloud drift before pushing. Read-only\: nothing is created, updated or deleted.'
1598
- )
1599
- _describe -t commands 'workspace command' sub
1600
- }
1601
-
1602
- _postman_workspace_list() {
1603
- _arguments \
1604
- '(-f --filter)'{-f,--filter}'[Filter workspaces by name.]:name' \
1605
- '(-t --type)'{-t,--type}'[Filter workspaces by visibility type\: team, public, private, personal.]:type' \
1606
- '--cursor[Fetch the page of workspaces that follows this cursor.]:cursor' \
1607
- '--verbose[Verbose output]' \
1608
- '--debug[Debug output]' \
1609
- '--json[JSON output]' \
1610
- '(-h --help)'{-h,--help}'[display help for command]'
1611
- }
1612
-
1613
- _postman_workspace_prepare() {
1614
- _arguments \
1615
- '--verbose[Show detailed logging]' \
1616
- '--json[Print the outcome as machine-readable JSON.]' \
1617
- '(-h --help)'{-h,--help}'[display help for command]'
1618
- }
1619
-
1620
- _postman_workspace_push() {
1621
- _arguments \
1622
- '--no-prepare[Skip ID validation and auto-fix before pushing]' \
1623
- '(-y --yes)'{-y,--yes}'[Skip all confirmation prompts]' \
1624
- '--push-strategy[Push strategy. "force-sync"\: mirror the whole workspace — also DELETE cloud entities that have no local counterpart (destructive). Defaults to "default" (create/update only).]:strategy' \
1625
- '--json[Print the outcome as machine-readable JSON. Implies non-interactive\: use --yes to actually push.]' \
1626
- '--verbose[Show detailed logging]' \
1627
- '--report-events[Dispatch events to the API Catalog and Application Inventory ingestion pipelines (on by default)]' \
1628
- '--no-report-events[Do not dispatch events to the API Catalog and Application Inventory ingestion pipelines]' \
1629
- '(-h --help)'{-h,--help}'[display help for command]'
1630
- }
1631
-
1632
- _postman_workspace_lint() {
1633
- _arguments \
1634
- '(-f --fail-severity)'{-f,--fail-severity}'[Exit with failure if diagnostics at this level or above are present. \[choices\: "error", "warning", "info", "hint"\] (default\: "error")]:value' \
1635
- '(-o --output)'{-o,--output}'[Output format\: cli (human-readable), table, or json. (default\: "cli")]:value' \
1636
- '--meta[Only lint the workspace configuration (.postman/resources.yaml); skip per-entity linting.]' \
1637
- '--workspace-id[The workspace ID to use for fetching governance rulesets. Defaults to the id in .postman/resources.yaml.]:value' \
1638
- '--fix[Apply safe autofixes to repairable workspace lint issues.]' \
1639
- '(-h --help)'{-h,--help}'[display help for command]'
1640
- }
1641
-
1642
- _postman_workspace_get() {
1643
- _arguments \
1644
- '--elements[Also report the resources the workspace holds.]' \
1645
- '--json[Print the workspace as machine-readable JSON.]' \
1646
- '--timeout[Milliseconds to wait for the API (default 30000).]:ms' \
1647
- '(-h --help)'{-h,--help}'[display help for command]' \
1648
- '*:id:'
1649
- }
1650
-
1651
- _postman_workspace_create() {
1652
- _arguments \
1653
- '--visibility[Required. One of\: personal, private, team, public, partner.]:status' \
1654
- '--name[Workspace name (defaults to owner/repo from the git remote)]:name' \
1655
- '--summary[Optional workspace summary]:text' \
1656
- '--team-id[The team inside your organisation the workspace belongs to. Required for a team workspace when your organisation has teams inside it. Find it with `postman team list`.]:id' \
1657
- '--team-role[What a team or public workspace grants\: view or edit. Applies to the team named by --team-id, or to your whole organisation when none is named. Defaults to your team'\''s configured default.]:level' \
1658
- '--path[Directory to bind (defaults to the current directory)]:dir:_files -g "*.json"' \
1659
- '--no-connect[Create the workspace without binding it to the repository]' \
1660
- '--force[Create even when a workspace is already recorded for this repo]' \
1661
- '--json[Print the created workspace as machine-readable JSON.]' \
1662
- '(-h --help)'{-h,--help}'[display help for command]'
1663
- }
1664
-
1665
- _postman_workspace_delete() {
1666
- _arguments \
1667
- '(-y --yes)'{-y,--yes}'[Skip the confirmation prompt]' \
1668
- '--json[Print the outcome as machine-readable JSON]' \
1669
- '--verbose[Show detailed logging]' \
1670
- '--timeout[Abort the run after this many milliseconds. Defaults to 30000.]:ms' \
1671
- '(-h --help)'{-h,--help}'[display help for command]' \
1672
- '*:workspaceId:'
1673
- }
1674
-
1675
- _postman_workspace_pull() {
1676
- _arguments \
1677
- '(-y --yes)'{-y,--yes}'[Skip all confirmation prompts]' \
1678
- '--source-workspace[Pull from a different source workspace.]:workspaceId' \
1679
- '--json[Print the outcome as machine-readable JSON. Implies non-interactive\: use --yes to actually pull.]' \
1680
- '--verbose[Show detailed logging]' \
1681
- '(-h --help)'{-h,--help}'[display help for command]' \
1682
- '*:workspaceId:'
1683
- }
1684
-
1685
- _postman_workspace_connect_git() {
1686
- _arguments \
1687
- '--verbose[Show detailed logging]' \
1688
- '--json[Print the outcome as machine-readable JSON.]' \
1689
- '(-h --help)'{-h,--help}'[display help for command]' \
1690
- '*:path:_files -g "*.json"'
1691
- }
1692
-
1693
- _postman_workspace_disconnect_git() {
1694
- _arguments \
1695
- '(-y --yes)'{-y,--yes}'[Skip all confirmation prompts]' \
1696
- '--verbose[Show detailed logging]' \
1697
- '--json[Print the outcome as machine-readable JSON. Requires --yes to actually disconnect.]' \
1698
- '(-h --help)'{-h,--help}'[display help for command]' \
1699
- '*:workspaceId:'
1700
- }
1701
-
1702
- _postman_workspace_diff() {
1703
- _arguments \
1704
- '--push-strategy[Strategy to preview. "force-sync" also shows cloud entities that would be DELETED. Defaults to "force-sync".]:strategy' \
1705
- '--summary[Skip content comparison. Faster, but updates are listed without checking whether they changed.]' \
1706
- '--json[Print the diff as machine-readable JSON.]' \
1707
- '--exit-code[Exit with code 1 when a verified difference is found (for CI gates). Entity types with no comparison path are reported but do not fail the gate.]' \
1708
- '--verbose[Show detailed logging]' \
1709
- '--timeout[Abort the run after this many milliseconds. Defaults to 120000.]:ms' \
1710
- '(-h --help)'{-h,--help}'[display help for command]' \
1711
- '*:workspaceId:'
1712
- }
1713
-
1714
- _postman_team() {
1715
- local context state state_descr line
1716
- typeset -A opt_args
1717
- _arguments -C \
1718
- '(-h --help)'{-h,--help}'[display help for command]' \
1719
- '1: :_postman_team_commands' \
1720
- '*::arg:->args'
1721
- case $state in
1722
- args)
1723
- case $words[1] in
1724
- list) _postman_team_list ;;
1725
- esac
1726
- ;;
1727
- esac
1728
- }
1729
-
1730
- _postman_team_commands() {
1731
- local -a sub
1732
- sub=(
1733
- 'list:List the teams inside your organisation.'
1734
- )
1735
- _describe -t commands 'team command' sub
1736
- }
1737
-
1738
- _postman_team_list() {
1739
- _arguments \
1740
- '--can-create-workspace[Only list teams you could create a workspace in.]' \
1741
- '--json[Print the list as machine-readable JSON.]' \
1742
- '--timeout[Abort the run after this many milliseconds. Defaults to 30000.]:ms' \
1743
- '(-h --help)'{-h,--help}'[display help for command]'
1744
- }
1745
-
1746
- _postman_performance() {
1747
- local context state state_descr line
1748
- typeset -A opt_args
1749
- _arguments -C \
1750
- '(-h --help)'{-h,--help}'[display help for command]' \
1751
- '1: :_postman_performance_commands' \
1752
- '*::arg:->args'
1753
- case $state in
1754
- args)
1755
- case $words[1] in
1756
- run) _postman_performance_run ;;
1757
- list) _postman_performance_list ;;
1758
- get) _postman_performance_get ;;
1759
- esac
1760
- ;;
1761
- esac
1762
- }
1763
-
1764
- _postman_performance_commands() {
1765
- local -a sub
1766
- sub=(
1767
- 'run:Run a performance test on a collection'
1768
- 'list:List past performance runs for a collection, newest first.'
1769
- 'get:Get one performance run by ID.'
1770
- )
1771
- _describe -t commands 'performance command' sub
1772
- }
1773
-
1774
- _postman_performance_run() {
1775
- _arguments \
1776
- '(-e --environment)'{-e,--environment}'[Specify an Id to a Postman Environment]:id' \
1777
- '(-g --globals)'{-g,--globals}'[Specify an Id to a Postman Globals]:id' \
1778
- '--setup-collection[Collection UID to run before the performance test]:id' \
1779
- '--teardown-collection[Collection UID to run after the performance test]:id' \
1780
- '--peak-vu[Peak (maximum) virtual users (default\: 20)]:count' \
1781
- '--vu-count[Older name for --peak-vu]:count' \
1782
- '--base-vu[Base (floor) virtual users the run starts from, 1 or more. Not for --load-profile fixed, which runs flat]:count' \
1783
- '(-d --duration)'{-d,--duration}'[Duration of the performance test in minutes (default\: 1)]:minutes' \
1784
- '(-p --load-profile)'{-p,--load-profile}'[Load profile type\: fixed, ramp-up, spike, peak (default\: "ramp-up")]:profile' \
1785
- '(-s --load-segments)'{-s,--load-segments}'[Duration of each phase of the profile, comma separated, in order. ramp-up takes 2, spike 3, peak 4; fixed takes none. See the load-segment section below for which position is which phase]:durations' \
1786
- '--data-file[Path to a JSON or CSV data file to use with the collection]:path:_files -g "*.json"' \
1787
- '--ssl-client-cert-list[Path to a client certificates configuration file (JSON). Local runner only.]:path:_files -g "*.(pem|crt|key)"' \
1788
- '--ssl-client-cert[Path to a client certificate (PEM) for mTLS targets. Local runner only.]:path:_files -g "*.(pem|crt|key)"' \
1789
- '--ssl-client-key[Path to the client certificate private key. Local runner only.]:path:_files -g "*.(pem|crt|key)"' \
1790
- '--ssl-client-passphrase[Client certificate passphrase (for a protected key). Local runner only.]:passphrase' \
1791
- '(-k --insecure)'{-k,--insecure}'[Disable SSL certificate verification for the target. Local runner only.]' \
1792
- '--ssl-extra-ca-certs[Path to additionally trusted CA certificates (PEM) for the target. Local runner only.]:path:_files -g "*.(pem|crt|key)"' \
1793
- '--dataset-id[Use a Postman Dataset as iteration data (with --dataset-view-id)]:id' \
1794
- '--dataset-view-id[Dataset view to execute for iteration data (requires --dataset-id)]:id' \
1795
- '--dataset-distribution[How rows map to VUs\: round-robin (default), fixed, random]:strategy' \
1796
- '--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' \
1797
- '--output[Output format for live results\: auto (default, interactive dashboard) or ndjson (one JSON object per line on stdout, ending with a "summary" event — for CI or other non-interactive use) (default\: "auto")]:format' \
1798
- '--runner[Runner to execute the performance test on\: local, postman-cloud, or postman-cloud-static-ip (egress from your account region'\''s static-IP cluster) (default\: local)]:runner' \
1799
- '--disable-unicode[Forces Unicode compliant symbols to be replaced by their plain text equivalents]' \
1800
- '--pass-if[Pass condition in format\: function(metric, value) (repeatable; all conditions must hold). Functions\: less_than, greater_than, less_than_eq, greater_than_eq. Metrics\: avg, p90, p95, p99, error_rate, rps. Example\: less_than(p95, 500)]:condition' \
1801
- '--use-mock[Redirect a variable/host to a local code mock or cloud Mock Server (repeatable). Format\: "<{{var}}|host> mock|mock-server\:<path|id> \[scenario\]" (default\: \[\])]:mapping' \
1802
- '--dataset[Pass --dataset multiple times to load several .dataset.yaml files (or directories containing them). Each is made available to the handlers of the local mocks started by --use-mock as pm.datasets(<id>). Local runner only. (default\: \[\])]:pathOrDir:_files -g "*.json"' \
1803
- '(-h --help)'{-h,--help}'[display help for command]' \
1804
- '*:collectionId:_files -g "*.json"'
1805
- }
1806
-
1807
- _postman_performance_list() {
1808
- _arguments \
1809
- '(-c --collection-id)'{-c,--collection-id}'[Collection ID whose performance runs to list]:id' \
1810
- '--cursor[Pagination cursor from a previous page'\''s response]:token' \
1811
- '--output[Output format\: table (default) or json (default\: "table")]:format' \
1812
- '--json[Alias for --output json]' \
1813
- '--timeout[Milliseconds to wait for the service before failing (default\: "30000")]:ms' \
1814
- '(-h --help)'{-h,--help}'[display help for command]' \
1815
- '*:id:'
1816
- }
1817
-
1818
- _postman_performance_get() {
1819
- _arguments \
1820
- '--output[Output format\: table (default) or json (default\: "table")]:format' \
1821
- '--json[Alias for --output json]' \
1822
- '--timeout[Milliseconds to wait for the service before failing (default\: "30000")]:ms' \
1823
- '(-h --help)'{-h,--help}'[display help for command]' \
1824
- '*:runId:'
1825
- }
1826
-
1827
- _postman_flows() {
1828
- local context state state_descr line
1829
- typeset -A opt_args
1830
- _arguments -C \
1831
- '(-h --help)'{-h,--help}'[display help for command]' \
1832
- '1: :_postman_flows_commands' \
1833
- '*::arg:->args'
1834
- case $state in
1835
- args)
1836
- case $words[1] in
1837
- list) _postman_flows_list ;;
1838
- trigger) _postman_flows_trigger ;;
1839
- deploy) _postman_flows_deploy ;;
1840
- run) _postman_flows_run ;;
1841
- update) _postman_flows_update ;;
1842
- list-runs) _postman_flows_list_runs ;;
1843
- get-run) _postman_flows_get_run ;;
1844
- esac
1845
- ;;
1846
- esac
1847
- }
1848
-
1849
- _postman_flows_commands() {
1850
- local -a sub
1851
- sub=(
1852
- 'list:List all flows'
1853
- 'trigger:Trigger a deployed flow'
1854
- 'deploy:Deploy a flow (required to trigger it)'
1855
- 'run:Run a single flow from a file (e.g. ./path/to/flow.json)'
1856
- 'update:Update settings for a deployed flow'
1857
- 'list-runs:List run history for a deployed flow'
1858
- 'get-run:Analyze a specific flow run'
1859
- )
1860
- _describe -t commands 'flows command' sub
1861
- }
1862
-
1863
- _postman_flows_list() {
1864
- _arguments \
1865
- '(-w --workspace)'{-w,--workspace}'[Specify the workspace ID to list flows from]:workspaceId' \
1866
- '(-p --paginate)'{-p,--paginate}'[Paginates the list of flows]' \
1867
- '(-f --filter)'{-f,--filter}'[Filter flows by name. Pattern may be a regex, or a name prefix.]:pattern' \
1868
- '(-s --sort)'{-s,--sort}'[Sort flows by criteria\: "name" or "updated" (default\: updated) (default\: "updated")]:criteria' \
1869
- '--verbose[Verbose output]' \
1870
- '--debug[Debug output]' \
1871
- '--json[JSON output]' \
1872
- '(-h --help)'{-h,--help}'[display help for command]'
1873
- }
1874
-
1875
- _postman_flows_trigger() {
1876
- _arguments \
1877
- '(-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)"' \
1878
- '(-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"' \
1879
- '(-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)"' \
1880
- '--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)"' \
1881
- '(-n --dry-run)'{-n,--dry-run}'[Show the flow requestURL and payload that would be sent without making the actual request (default\: false)]' \
1882
- '--show-secrets[Show actual authentication tokens in dry-run output (otherwise secrets are masked) (default\: false)]' \
1883
- '(-r --result)'{-r,--result}'[Show only the response body (default\: false)]' \
1884
- '(-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' \
1885
- '--verbose[Verbose output]' \
1886
- '--debug[Debug output]' \
1887
- '--json[JSON output]' \
1888
- '(-h --help)'{-h,--help}'[display help for command]' \
1889
- '*:flowId:'
1890
- }
1891
-
1892
- _postman_flows_deploy() {
1893
- _arguments \
1894
- '(-p --path)'{-p,--path}'[Specify the URL path for the trigger]:path:_files -g "*.json"' \
1895
- '(-t --timeout)'{-t,--timeout}'[Specify the HTTP session timeout (5000ms to 60000ms) (default\: "10000ms")]:timeout' \
1896
- '(-a --auth)'{-a,--auth}'[Enable authentication for the trigger (default\: false)]' \
1897
- '--verbose[Verbose output]' \
1898
- '--debug[Debug output]' \
1899
- '--json[JSON output]' \
1900
- '(-h --help)'{-h,--help}'[display help for command]' \
1901
- '*:flowId:'
1902
- }
1903
-
1904
- _postman_flows_run() {
1905
- _arguments \
1906
- '(-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)"' \
1907
- '(-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"' \
1908
- '(-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' \
1909
- '--iteration-data-dataset[\[BETA\] Run the flow once per row of a dataset view. Accepts a local .dataset.yaml path or a cloud dataset id (cloud requires login). Requires --iteration-data-view. Dataset columns feed the flow inputs (see --map-column).]:pathOrId:_files -g "*.(json|csv)"' \
1910
- '--iteration-data-view[\[BETA\] Name or id of the view (within --iteration-data-dataset) whose rows drive the run.]:nameOrId' \
1911
- '(-m --map-column)'{-m,--map-column}'[\[BETA\] Bind a flow input to a dataset column (e.g. -m isActive=active). Repeatable. Inputs whose name matches a column bind automatically. (default\: \[\])]:input=column' \
1912
- '(-e --environment)'{-e,--environment}'[Specify a path to a Postman Environment file (JSON or YAML)]:path:_files -g "*.json"' \
1913
- '--working-dir[Specify the path to the working directory]:path:_files -/' \
1914
- '--no-insecure-file-read[Prevent reading dataset files situated outside of the working directory (applies to --iteration-data-dataset)]' \
1915
- '--verbose[Show detailed information of flow run and each request (method, URL, assertions)]' \
1916
- '--no-truncate[Show full output without truncating long values]' \
1917
- '--output[Save execution result to a file (supported\: json)]:format' \
1918
- '--reporters[Save a test results report to a file (supported\: html)]:format' \
1919
- '(-x --suppress-exit-code)'{-x,--suppress-exit-code}'[Specify whether or not to override the default exit code for the current run]' \
1920
- '--workspace[Workspace ID required for flows that contain connector blocks. Find it in the Postman app URL\: https\://postman.com/workspace/<workspaceId>]:workspaceId' \
1921
- '--report-events[Dispatch events to the API Catalog and Application Inventory ingestion pipelines (on by default)]' \
1922
- '--no-report-events[Do not dispatch events to the API Catalog and Application Inventory ingestion pipelines]' \
1923
- '--verbose[Verbose output]' \
1924
- '--debug[Debug output]' \
1925
- '--json[JSON output]' \
1926
- '(-h --help)'{-h,--help}'[display help for command]' \
1927
- '*:path:_files -g "*.json"'
1928
- }
1929
-
1930
- _postman_flows_update() {
1931
- _arguments \
1932
- '(-t --trigger)'{-t,--trigger}'[Enable or disable the flow trigger]:on|off' \
1933
- '(-a --auth)'{-a,--auth}'[Enable or disable authentication for the flow trigger]:on|off' \
1934
- '--verbose[Verbose output]' \
1935
- '--debug[Debug output]' \
1936
- '--json[JSON output]' \
1937
- '(-h --help)'{-h,--help}'[display help for command]' \
1938
- '*:flowId:'
1939
- }
1940
-
1941
- _postman_flows_list_runs() {
1942
- _arguments \
1943
- '(-w --workspace)'{-w,--workspace}'[Specify the workspace ID]:workspaceId' \
1944
- '(-f --flow)'{-f,--flow}'[Filter sessions by flow ID]:flowId' \
1945
- '(-r --range)'{-r,--range}'[Time range to list runs (e.g. 30m, 2h, 3d) (default\: "1h")]:range' \
1946
- '--verbose[Verbose output]' \
1947
- '--debug[Debug output]' \
1948
- '--json[JSON output]' \
1949
- '(-h --help)'{-h,--help}'[display help for command]'
1950
- }
1951
-
1952
- _postman_flows_get_run() {
1953
- _arguments \
1954
- '(-r --run-id)'{-r,--run-id}'[Specify the run ID to analyze]:runId' \
1955
- '(-l --logs)'{-l,--logs}'[Show detailed event log (default\: false)]' \
1956
- '--filter[Filter event log by block ID prefix (can be specified multiple times) (default\: \[\])]:blockId' \
1957
- '--verbose[Verbose output]' \
1958
- '--debug[Debug output]' \
1959
- '--json[JSON output]' \
1960
- '(-h --help)'{-h,--help}'[display help for command]'
1961
- }
1962
-
1963
1788
  _postman_request() {
1964
1789
  _arguments \
1965
1790
  '(-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' \
@@ -2017,7 +1842,67 @@ _postman_request() {
2017
1842
  '--auth-apikey-key[Supply authentication parameters dynamically.]:value' \
2018
1843
  '--auth-apikey-value[Supply authentication parameters dynamically.]:value' \
2019
1844
  '--auth-apikey-in[Supply authentication parameters dynamically.]:value' \
2020
- '*:url:'
1845
+ '*:URL:'
1846
+ }
1847
+
1848
+ _postman_runner() {
1849
+ local context state state_descr line
1850
+ typeset -A opt_args
1851
+ _arguments -C \
1852
+ '(-h --help)'{-h,--help}'[display help for command]' \
1853
+ '1: :_postman_runner_commands' \
1854
+ '*::arg:->args'
1855
+ case $state in
1856
+ args)
1857
+ case $words[1] in
1858
+ start) _postman_runner_start ;;
1859
+ list) _postman_runner_list ;;
1860
+ regions) _postman_runner_regions ;;
1861
+ esac
1862
+ ;;
1863
+ esac
1864
+ }
1865
+
1866
+ _postman_runner_commands() {
1867
+ local -a sub
1868
+ sub=(
1869
+ 'start:Start a self-hosted runner in your own network.'
1870
+ 'list:List the team'\''s registered self-hosted runners.'
1871
+ 'regions:List the region and private-runner values valid for monitor create/update --runner, with the static IP Postman runs each one from, where your team has access to it.'
1872
+ )
1873
+ _describe -t commands 'runner command' sub
1874
+ }
1875
+
1876
+ _postman_runner_start() {
1877
+ _arguments \
1878
+ '--id[The ID of the runner to execute]:id' \
1879
+ '--key[The secret key for the runner]:key:_files -g "*.(pem|crt|key)"' \
1880
+ '--region[Region this runner reports to -- use "eu" for the EU region]:region' \
1881
+ '--proxy[External proxy URL, for example http\://proxy.com or http\://proxy.com\:8080]:url' \
1882
+ '--egress-proxy[Enable built-in egress proxy]' \
1883
+ '--egress-proxy-authz-url[Custom egress proxy authorization service base URL]:url' \
1884
+ '--ssl-extra-ca-certs[Additional trusted CA certificates (PEM file, can contain multiple certs)]:path:_files -g "*.(pem|crt|key)"' \
1885
+ '--dataset-jdbc-driver-dir[Folder on this machine holding the JDBC driver .jar files you put there. Required to run a dataset that uses a JDBC source. Drivers are loaded only from this folder and matched by file name; driver paths saved in the dataset are ignored]:path:_files -/' \
1886
+ '--metrics[Enable the metrics server for health checks]' \
1887
+ '--metrics-port[Port for the metrics server (default\: "9090")]:port' \
1888
+ '--report-events[Dispatch run events to the API Catalog and Application Inventory ingestion pipelines (on by default)]' \
1889
+ '--no-report-events[Do not dispatch run events to the API Catalog and Application Inventory ingestion pipelines]' \
1890
+ '(-h --help)'{-h,--help}'[display help for command]'
1891
+ }
1892
+
1893
+ _postman_runner_list() {
1894
+ _arguments \
1895
+ '--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
1896
+ '(-w --workspace)'{-w,--workspace}'[Filter to runners in this workspace]:id' \
1897
+ '--json[Output the runner list as JSON instead of a table]' \
1898
+ '(-h --help)'{-h,--help}'[display help for command]'
1899
+ }
1900
+
1901
+ _postman_runner_regions() {
1902
+ _arguments \
1903
+ '--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
1904
+ '--json[Output the region list as JSON instead of a table]' \
1905
+ '(-h --help)'{-h,--help}'[display help for command]'
2021
1906
  }
2022
1907
 
2023
1908
  _postman_sdk() {
@@ -2112,367 +1997,555 @@ _postman_sdk_fetch() {
2112
1997
  '*:buildId:'
2113
1998
  }
2114
1999
 
2115
- _postman_sdk_connect() {
2000
+ _postman_sdk_connect() {
2001
+ _arguments \
2002
+ '(-l --language)'{-l,--language}'[SDK language (required) \[choices\: typescript, python, java, go, csharp, php, ruby, cli, kotlin, rust, swift\]]:language' \
2003
+ '(-r --repo)'{-r,--repo}'[GitHub repository in <owner>/<name> form (alternative to --repo-owner + --repo-name)]:owner/name' \
2004
+ '--repo-owner[GitHub repository owner (user or org)]:owner' \
2005
+ '--repo-name[GitHub repository name]:name' \
2006
+ '(-b --branch)'{-b,--branch}'[Target branch for SDK pull requests (default\: "main")]:branch' \
2007
+ '--push-to-base[Push SDK updates directly to the base branch instead of opening a pull request (default\: false)]' \
2008
+ '--auto-update-pull-requests[Open auto-update pull requests when the SDK changes (true|false). Defaults to true server-side when omitted]:bool' \
2009
+ '--auth-provider[OAuth provider used by the server when pushing (choices\: githubapp, github) (default\: "githubapp")]:provider' \
2010
+ '--verbose[Show extra logging]' \
2011
+ '(-h --help)'{-h,--help}'[display help for command]' \
2012
+ '*:id:'
2013
+ }
2014
+
2015
+ _postman_sdk_connections() {
2016
+ local context state state_descr line
2017
+ typeset -A opt_args
2018
+ _arguments -C \
2019
+ '(-h --help)'{-h,--help}'[display help for command]' \
2020
+ '1: :_postman_sdk_connections_commands' \
2021
+ '*::arg:->args'
2022
+ case $state in
2023
+ args)
2024
+ case $words[1] in
2025
+ list|ls) _postman_sdk_connections_list ;;
2026
+ delete|rm) _postman_sdk_connections_delete ;;
2027
+ esac
2028
+ ;;
2029
+ esac
2030
+ }
2031
+
2032
+ _postman_sdk_connections_commands() {
2033
+ local -a sub
2034
+ sub=(
2035
+ 'list:List GitHub connections for a collection or specification'
2036
+ 'ls:Alias for list'
2037
+ 'delete:Delete a GitHub connection for a collection or specification'
2038
+ 'rm:Alias for delete'
2039
+ )
2040
+ _describe -t commands 'connections command' sub
2041
+ }
2042
+
2043
+ _postman_sdk_connections_list() {
2044
+ _arguments \
2045
+ '--refresh[Refresh PR statuses from GitHub before listing (slower) (default\: false)]' \
2046
+ '--json[Output raw JSON instead of formatted text (default\: false)]' \
2047
+ '--verbose[Show extra logging]' \
2048
+ '(-h --help)'{-h,--help}'[display help for command]' \
2049
+ '*:id:'
2050
+ }
2051
+
2052
+ _postman_sdk_connections_delete() {
2053
+ _arguments \
2054
+ '(-y --yes)'{-y,--yes}'[Skip the confirmation prompt (default\: false)]' \
2055
+ '--verbose[Show extra logging]' \
2056
+ '(-h --help)'{-h,--help}'[display help for command]' \
2057
+ '*:connectionId:'
2058
+ }
2059
+
2060
+ _postman_spec() {
2061
+ local context state state_descr line
2062
+ typeset -A opt_args
2063
+ _arguments -C \
2064
+ '(-h --help)'{-h,--help}'[display help for command]' \
2065
+ '1: :_postman_spec_commands' \
2066
+ '*::arg:->args'
2067
+ case $state in
2068
+ args)
2069
+ case $words[1] in
2070
+ lint) _postman_spec_lint ;;
2071
+ ai-readiness) _postman_spec_ai_readiness ;;
2072
+ list) _postman_spec_list ;;
2073
+ get) _postman_spec_get ;;
2074
+ file) _postman_spec_file ;;
2075
+ create) _postman_spec_create ;;
2076
+ generate) _postman_spec_generate ;;
2077
+ sync) _postman_spec_sync ;;
2078
+ delete) _postman_spec_delete ;;
2079
+ esac
2080
+ ;;
2081
+ esac
2082
+ }
2083
+
2084
+ _postman_spec_commands() {
2085
+ local -a sub
2086
+ sub=(
2087
+ 'lint:Run linting on the given specification by ID or local file path.'
2088
+ 'ai-readiness:Score an OpenAPI specification for AI readiness by ID or local file path.'
2089
+ 'list:List local spec files under a path, or (no path) a workspace'\''s cloud specs.'
2090
+ 'get:Read a spec definition, including every file of a multi-file spec.'
2091
+ 'file:Get, add, update, or remove files in a spec (cloud ID or local directory).'
2092
+ 'create:Create a new spec in a workspace, or (with path) scaffold a local spec file.'
2093
+ 'generate:Generate artifacts from a specification.'
2094
+ 'sync:Sync a generated collection with its source specification.'
2095
+ 'delete:Delete a spec by its cloud ID or local file path. Cannot be undone.'
2096
+ )
2097
+ _describe -t commands 'spec command' sub
2098
+ }
2099
+
2100
+ _postman_spec_lint() {
2101
+ _arguments \
2102
+ '(-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' \
2103
+ '--issueType[Limit linting to a specific issue type. \[choices\: "syntax"\]]:value' \
2104
+ '(-o --output)'{-o,--output}'[Output format for the results. \[choices\: "json", "csv"\]]:value' \
2105
+ '--workspace-id[The workspace ID to use for fetching governance rulesets.]:value' \
2106
+ '--report-events[Dispatch events to the API Catalog and Application Inventory ingestion pipelines (on by default)]' \
2107
+ '--no-report-events[Do not dispatch events to the API Catalog and Application Inventory ingestion pipelines]' \
2108
+ '(-h --help)'{-h,--help}'[display help for command]' \
2109
+ '*:spec:'
2110
+ }
2111
+
2112
+ _postman_spec_ai_readiness() {
2113
+ _arguments \
2114
+ '(-o --output)'{-o,--output}'[Output format for the results. \[choices\: "cli", "json", "html"\]]:value' \
2115
+ '--export[Write the report to this file instead of stdout. A directory receives the report under a name derived from the specification. Requires --output html.]:path:_files -g "*.json"' \
2116
+ '--min-score[Exit with a non-zero code if the overall score is below this threshold (0-100).]:n' \
2117
+ '(-h --help)'{-h,--help}'[display help for command]' \
2118
+ '*:spec:'
2119
+ }
2120
+
2121
+ _postman_spec_list() {
2122
+ _arguments \
2123
+ '(-w --workspace)'{-w,--workspace}'[Workspace ID (defaults to .postman/resources.yaml binding)]:id' \
2124
+ '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
2125
+ '--json[Output as JSON]' \
2126
+ '(-h --help)'{-h,--help}'[display help for command]' \
2127
+ '*:pathOrDir:_files -g "*.json"'
2128
+ }
2129
+
2130
+ _postman_spec_get() {
2131
+ _arguments \
2132
+ '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
2133
+ '--json[Output as JSON (full spec definition)]' \
2134
+ '(-h --help)'{-h,--help}'[display help for command]' \
2135
+ '*:spec...:'
2136
+ }
2137
+
2138
+ _postman_spec_file() {
2139
+ local context state state_descr line
2140
+ typeset -A opt_args
2141
+ _arguments -C \
2142
+ '(-h --help)'{-h,--help}'[display help for command]' \
2143
+ '1: :_postman_spec_file_commands' \
2144
+ '*::arg:->args'
2145
+ case $state in
2146
+ args)
2147
+ case $words[1] in
2148
+ get) _postman_spec_file_get ;;
2149
+ add) _postman_spec_file_add ;;
2150
+ update) _postman_spec_file_update ;;
2151
+ rm) _postman_spec_file_rm ;;
2152
+ esac
2153
+ ;;
2154
+ esac
2155
+ }
2156
+
2157
+ _postman_spec_file_commands() {
2158
+ local -a sub
2159
+ sub=(
2160
+ 'get:Show a file in a spec\: its path, size and content.'
2161
+ 'add:Add a new file to a spec.'
2162
+ 'update:Update an existing file in a spec.'
2163
+ 'rm:Remove a file from a spec.'
2164
+ )
2165
+ _describe -t commands 'file command' sub
2166
+ }
2167
+
2168
+ _postman_spec_file_get() {
2169
+ _arguments \
2170
+ '--json[Output as JSON]' \
2171
+ '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
2172
+ '(-h --help)'{-h,--help}'[display help for command]' \
2173
+ '*:filePath:_files -g "*.json"'
2174
+ }
2175
+
2176
+ _postman_spec_file_add() {
2177
+ _arguments \
2178
+ '(-c --content)'{-c,--content}'[File content (reads from stdin if omitted)]:content' \
2179
+ '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
2180
+ '(-h --help)'{-h,--help}'[display help for command]' \
2181
+ '*:filePath:_files -g "*.json"'
2182
+ }
2183
+
2184
+ _postman_spec_file_update() {
2185
+ _arguments \
2186
+ '(-c --content)'{-c,--content}'[New file content (reads from stdin if omitted)]:content' \
2187
+ '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
2188
+ '(-h --help)'{-h,--help}'[display help for command]' \
2189
+ '*:filePath:_files -g "*.json"'
2190
+ }
2191
+
2192
+ _postman_spec_file_rm() {
2193
+ _arguments \
2194
+ '(-y --yes)'{-y,--yes}'[Skip confirmation prompt]' \
2195
+ '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
2196
+ '(-h --help)'{-h,--help}'[display help for command]' \
2197
+ '*:filePath:_files -g "*.json"'
2198
+ }
2199
+
2200
+ _postman_spec_create() {
2201
+ _arguments \
2202
+ '(-n --name)'{-n,--name}'[Specification name / title]:name' \
2203
+ '(-t --type)'{-t,--type}'[Spec type\: openapi, asyncapi, graphql, protobuf, smithy (default\: openapi) (default\: "openapi")]:type' \
2204
+ '--spec-version[Spec version (e.g. 3.1 for openapi, 3 for protobuf)]:ver' \
2205
+ '(-f --format)'{-f,--format}'[File format\: yaml or json (openapi/asyncapi only, default\: yaml) (default\: "yaml")]:fmt' \
2206
+ '(-w --workspace)'{-w,--workspace}'[Workspace ID (cloud create, defaults to .postman/resources.yaml)]:id' \
2207
+ '--force[Overwrite an existing local file]' \
2208
+ '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
2209
+ '(-h --help)'{-h,--help}'[display help for command]' \
2210
+ '*:path:_files -g "*.json"'
2211
+ }
2212
+
2213
+ _postman_spec_generate() {
2214
+ local context state state_descr line
2215
+ typeset -A opt_args
2216
+ _arguments -C \
2217
+ '(-h --help)'{-h,--help}'[display help for command]' \
2218
+ '1: :_postman_spec_generate_commands' \
2219
+ '*::arg:->args'
2220
+ case $state in
2221
+ args)
2222
+ case $words[1] in
2223
+ collection) _postman_spec_generate_collection ;;
2224
+ esac
2225
+ ;;
2226
+ esac
2227
+ }
2228
+
2229
+ _postman_spec_generate_commands() {
2230
+ local -a sub
2231
+ sub=(
2232
+ 'collection:Generate a Postman collection from a specification.'
2233
+ )
2234
+ _describe -t commands 'generate command' sub
2235
+ }
2236
+
2237
+ _postman_spec_generate_collection() {
2116
2238
  _arguments \
2117
- '(-l --language)'{-l,--language}'[SDK language (required) \[choices\: typescript, python, java, go, csharp, php, ruby, cli, kotlin, rust, swift\]]:language' \
2118
- '(-r --repo)'{-r,--repo}'[GitHub repository in <owner>/<name> form (alternative to --repo-owner + --repo-name)]:owner/name' \
2119
- '--repo-owner[GitHub repository owner (user or org)]:owner' \
2120
- '--repo-name[GitHub repository name]:name' \
2121
- '(-b --branch)'{-b,--branch}'[Target branch for SDK pull requests (default\: "main")]:branch' \
2122
- '--push-to-base[Push SDK updates directly to the base branch instead of opening a pull request (default\: false)]' \
2123
- '--auto-update-pull-requests[Open auto-update pull requests when the SDK changes (true|false). Defaults to true server-side when omitted]:bool' \
2124
- '--auth-provider[OAuth provider used by the server when pushing (choices\: githubapp, github) (default\: "githubapp")]:provider' \
2125
- '--verbose[Show extra logging]' \
2239
+ '(-n --name)'{-n,--name}'[Collection name]:name' \
2240
+ '--folder-strategy[Folder strategy\: Paths or Tags (default\: Paths) (default\: "Paths")]:strategy' \
2241
+ '(-w --workspace)'{-w,--workspace}'[Workspace ID (cloud mode)]:id' \
2242
+ '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
2243
+ '--force[Overwrite the collection if one with this name already exists (local mode)]' \
2126
2244
  '(-h --help)'{-h,--help}'[display help for command]' \
2127
- '*:id:'
2245
+ '*:spec:'
2128
2246
  }
2129
2247
 
2130
- _postman_sdk_connections() {
2248
+ _postman_spec_sync() {
2131
2249
  local context state state_descr line
2132
2250
  typeset -A opt_args
2133
2251
  _arguments -C \
2134
2252
  '(-h --help)'{-h,--help}'[display help for command]' \
2135
- '1: :_postman_sdk_connections_commands' \
2253
+ '1: :_postman_spec_sync_commands' \
2136
2254
  '*::arg:->args'
2137
2255
  case $state in
2138
2256
  args)
2139
2257
  case $words[1] in
2140
- list|ls) _postman_sdk_connections_list ;;
2141
- delete|rm) _postman_sdk_connections_delete ;;
2258
+ collection) _postman_spec_sync_collection ;;
2142
2259
  esac
2143
2260
  ;;
2144
2261
  esac
2145
2262
  }
2146
2263
 
2147
- _postman_sdk_connections_commands() {
2264
+ _postman_spec_sync_commands() {
2148
2265
  local -a sub
2149
2266
  sub=(
2150
- 'list:List GitHub connections for a collection or specification'
2151
- 'ls:Alias for list'
2152
- 'delete:Delete a GitHub connection for a collection or specification'
2153
- 'rm:Alias for delete'
2267
+ 'collection:Sync a collection from a linked specification (local path or cloud UUID).'
2154
2268
  )
2155
- _describe -t commands 'connections command' sub
2269
+ _describe -t commands 'sync command' sub
2156
2270
  }
2157
2271
 
2158
- _postman_sdk_connections_list() {
2272
+ _postman_spec_sync_collection() {
2159
2273
  _arguments \
2160
- '--refresh[Refresh PR statuses from GitHub before listing (slower) (default\: false)]' \
2161
- '--json[Output raw JSON instead of formatted text (default\: false)]' \
2162
- '--verbose[Show extra logging]' \
2274
+ '--collection-id[Collection ID to sync (required for cloud mode)]:id' \
2275
+ '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
2276
+ '--force[Overwrite hand-written scripts that the spec would otherwise drop]' \
2163
2277
  '(-h --help)'{-h,--help}'[display help for command]' \
2164
- '*:id:'
2278
+ '*:spec:'
2165
2279
  }
2166
2280
 
2167
- _postman_sdk_connections_delete() {
2281
+ _postman_spec_delete() {
2168
2282
  _arguments \
2169
- '(-y --yes)'{-y,--yes}'[Skip the confirmation prompt (default\: false)]' \
2170
- '--verbose[Show extra logging]' \
2283
+ '(-y --yes)'{-y,--yes}'[Delete without asking for confirmation first]' \
2284
+ '--api-key[Postman API key, used with a cloud ID (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2171
2285
  '(-h --help)'{-h,--help}'[display help for command]' \
2172
- '*:connectionId:'
2286
+ '*:spec:'
2173
2287
  }
2174
2288
 
2175
- _postman_mock() {
2289
+ _postman_workspace() {
2176
2290
  local context state state_descr line
2177
2291
  typeset -A opt_args
2178
2292
  _arguments -C \
2179
2293
  '(-h --help)'{-h,--help}'[display help for command]' \
2180
- '1: :_postman_mock_commands' \
2294
+ '1: :_postman_workspace_commands' \
2181
2295
  '*::arg:->args'
2182
2296
  case $state in
2183
2297
  args)
2184
2298
  case $words[1] in
2185
- generate) _postman_mock_generate ;;
2186
- run) _postman_mock_run ;;
2187
- push) _postman_mock_push ;;
2188
- deploy) _postman_mock_deploy ;;
2189
- get) _postman_mock_get ;;
2190
- list) _postman_mock_list ;;
2191
- log) _postman_mock_log ;;
2192
- delete) _postman_mock_delete ;;
2299
+ list) _postman_workspace_list ;;
2300
+ prepare) _postman_workspace_prepare ;;
2301
+ push) _postman_workspace_push ;;
2302
+ lint) _postman_workspace_lint ;;
2303
+ get) _postman_workspace_get ;;
2304
+ create) _postman_workspace_create ;;
2305
+ delete) _postman_workspace_delete ;;
2306
+ pull) _postman_workspace_pull ;;
2307
+ connect-git) _postman_workspace_connect_git ;;
2308
+ disconnect-git) _postman_workspace_disconnect_git ;;
2309
+ diff) _postman_workspace_diff ;;
2193
2310
  esac
2194
2311
  ;;
2195
2312
  esac
2196
2313
  }
2197
2314
 
2198
- _postman_mock_commands() {
2315
+ _postman_workspace_commands() {
2199
2316
  local -a sub
2200
2317
  sub=(
2201
- 'generate:Generate a mock from a Postman collection or an OpenAPI file, or from a built-in sample shopping-cart mock (POST /cart/items, GET /cart, POST /checkout). Writes a local mock by default, or a cloud mock with --workspace.'
2202
- 'run:Start a mock using its path if it lives in your repository, or its id if it lives in Postman cloud (fetched and run locally).'
2203
- 'push:Upload a mock from your repository to Postman cloud (creates it the first time, updates it after).'
2204
- 'deploy:Turn a mock in Postman cloud into a live mock server others can call over the internet.'
2205
- 'get:Show a mock'\''s details using its path if it lives in your repository, or its id if it lives in Postman cloud.'
2206
- 'list:List the mocks in your repository or Postman cloud workspace'
2207
- 'log:Show the requests a live mock server has received and the responses it sent, using its id.'
2208
- 'delete:Delete a mock using its path if it lives in your repository, or its id if it lives in Postman cloud. Cannot be undone.'
2318
+ 'list:List all available Postman Workspaces'
2319
+ 'prepare:Prepare local collections and environments for push by validating and regenerating IDs if needed.'
2320
+ 'push:Push local workspace entities (collections, environments, specifications, mocks and more) to Postman workspace.'
2321
+ 'lint:Lint the current local Postman workspace\: its configuration (.postman/resources.yaml) plus every discovered entity. Use --meta to lint only the configuration.'
2322
+ 'get:Read a workspace'\''s metadata, and optionally the ids of what it holds.'
2323
+ 'create:Create a Postman workspace and bind it to this git repository.'
2324
+ 'delete:Permanently delete a workspace and everything in it. Prompts for confirmation unless --yes is passed.'
2325
+ 'pull:Pull workspace entities from a Postman workspace into the local git-native folder.'
2326
+ 'connect-git:Connect a Postman workspace to a local git repository.'
2327
+ 'disconnect-git:Disconnect a Postman workspace from its local git repository.'
2328
+ 'diff:Preview local-vs-cloud drift before pushing. Read-only\: nothing is created, updated or deleted.'
2209
2329
  )
2210
- _describe -t commands 'mock command' sub
2330
+ _describe -t commands 'workspace command' sub
2211
2331
  }
2212
2332
 
2213
- _postman_mock_generate() {
2333
+ _postman_workspace_list() {
2214
2334
  _arguments \
2215
- '(-o --output)'{-o,--output}'[Folder to save the mock in. Relative or absolute, e.g. ./postman/mocks/orders. Defaults to postman/mocks/<name>.]:dir:_files -g "*.json"' \
2216
- '(-n --name)'{-n,--name}'[Name for the mock. Taken from the source when you provide one; required for the sample.]:name' \
2217
- '--port[Port the mock runs on (e.g. 4010) (default\: 4500)]:port' \
2218
- '--force[Overwrite the mock'\''s files if the target folder already has one]' \
2219
- '(-u --update)'{-u,--update}'[Update an existing mock from the source instead of creating a new one. Path to the mock, relative or absolute, e.g. ./postman/mocks/orders. Cannot be used with --output.]:mockPath:_files -g "*.json"' \
2220
- '(-w --workspace)'{-w,--workspace}'[Save the mock to this Postman cloud workspace (by id) instead of your repository. Cannot be used with --output, --force, or --update.]:id' \
2221
- '--api-key[Postman API key to use with --workspace (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2222
- '(-x --suppress-exit-code)'{-x,--suppress-exit-code}'[Always exit with code 0, even on failure]' \
2223
- '(-h --help)'{-h,--help}'[display help for command]' \
2224
- '*:sourcePath:'
2335
+ '(-f --filter)'{-f,--filter}'[Filter workspaces by name.]:name' \
2336
+ '(-t --type)'{-t,--type}'[Filter workspaces by visibility type\: team, public, private, personal.]:type' \
2337
+ '--cursor[Fetch the page of workspaces that follows this cursor.]:cursor' \
2338
+ '--verbose[Verbose output]' \
2339
+ '--debug[Debug output]' \
2340
+ '--json[JSON output]' \
2341
+ '(-h --help)'{-h,--help}'[display help for command]'
2225
2342
  }
2226
2343
 
2227
- _postman_mock_run() {
2344
+ _postman_workspace_prepare() {
2228
2345
  _arguments \
2229
- '(-e --environment)'{-e,--environment}'[Path to a file of environment variables for the mock. Relative or absolute, e.g. ./postman/environments/dev.environment.yaml]:path:_files -g "*.json"' \
2230
- '(-g --globals)'{-g,--globals}'[Path to a file of global variables for the mock. Relative or absolute, e.g. ./globals.json]:path:_files -g "*.json"' \
2231
- '(-p --port)'{-p,--port}'[Port to run on (e.g. 4010), or "auto" for a free one. Defaults to the mock'\''s configured port.]:port' \
2232
- '--api-key[Postman API key, used with a Postman cloud id (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2233
- '(-w --workspace)'{-w,--workspace}'[Workspace that owns the run, for recording its start history. Auto-resolved for a Postman cloud id; required to record history for a path.]:id' \
2234
- '--no-history[Do not record this run in the mock'\''s start history.]' \
2235
- '--output[Live output format\: auto (default, human-readable logs) or ndjson (one JSON event per line on stdout, ending with a "summary" event — for CI or other non-interactive use) (default\: "auto")]:format' \
2236
- '--dataset[Pass --dataset multiple times to load several .dataset.yaml files (or directories containing them). Each is made available to the mock'\''s handlers as pm.datasets(<id>). (default\: \[\])]:pathOrDir:_files -g "*.json"' \
2237
- '(-h --help)'{-h,--help}'[display help for command]' \
2238
- '*:mockIdOrPath:_files -g "*.json"'
2346
+ '--verbose[Show detailed logging]' \
2347
+ '--json[Print the outcome as machine-readable JSON.]' \
2348
+ '(-h --help)'{-h,--help}'[display help for command]'
2239
2349
  }
2240
2350
 
2241
- _postman_mock_push() {
2351
+ _postman_workspace_push() {
2242
2352
  _arguments \
2243
- '(-w --workspace)'{-w,--workspace}'[Postman cloud workspace to upload to, by id (defaults to the workspace already linked to this project)]:id' \
2244
- '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2245
- '(-h --help)'{-h,--help}'[display help for command]' \
2246
- '*:mockPath:_files -g "*.json"'
2353
+ '--no-prepare[Skip ID validation and auto-fix before pushing]' \
2354
+ '(-y --yes)'{-y,--yes}'[Skip all confirmation prompts]' \
2355
+ '--push-strategy[Push strategy. "force-sync"\: mirror the whole workspace — also DELETE cloud entities that have no local counterpart (destructive). Defaults to "default" (create/update only).]:strategy' \
2356
+ '--json[Print the outcome as machine-readable JSON. Implies non-interactive\: use --yes to actually push.]' \
2357
+ '--verbose[Show detailed logging]' \
2358
+ '--report-events[Dispatch events to the API Catalog and Application Inventory ingestion pipelines (on by default)]' \
2359
+ '--no-report-events[Do not dispatch events to the API Catalog and Application Inventory ingestion pipelines]' \
2360
+ '(-h --help)'{-h,--help}'[display help for command]'
2247
2361
  }
2248
2362
 
2249
- _postman_mock_deploy() {
2363
+ _postman_workspace_lint() {
2250
2364
  _arguments \
2251
- '(-w --workspace)'{-w,--workspace}'[Postman cloud workspace that will own the server, by id (defaults to the workspace already linked to this project)]:id' \
2252
- '(-n --name)'{-n,--name}'[Name for the mock server (you are asked for one if you skip this)]:name' \
2253
- '(-s --slug)'{-s,--slug}'[Short label used in the server'\''s web address, e.g. "my-mock" (you are asked for one if you skip this)]:slug' \
2254
- '--public[Let anyone with the link reach the server. Private by default (callers must send a Postman API key).]' \
2255
- '--auto-deploy[Update the live server automatically whenever the mock changes (off by default)]' \
2256
- '(-y --yes)'{-y,--yes}'[Use the defaults and skip all questions (private, no auto-deploy)]' \
2257
- '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2258
- '(-h --help)'{-h,--help}'[display help for command]' \
2259
- '*:mockId:_files -g "*.json"'
2365
+ '(-f --fail-severity)'{-f,--fail-severity}'[Exit with failure if diagnostics at this level or above are present. \[choices\: "error", "warning", "info", "hint"\] (default\: "error")]:value' \
2366
+ '(-o --output)'{-o,--output}'[Output format\: cli (human-readable), table, or json. (default\: "cli")]:value' \
2367
+ '--meta[Only lint the workspace configuration (.postman/resources.yaml); skip per-entity linting.]' \
2368
+ '--workspace-id[The workspace ID to use for fetching governance rulesets. Defaults to the id in .postman/resources.yaml.]:value' \
2369
+ '--fix[Apply safe autofixes to repairable workspace lint issues.]' \
2370
+ '(-h --help)'{-h,--help}'[display help for command]'
2260
2371
  }
2261
2372
 
2262
- _postman_mock_get() {
2373
+ _postman_workspace_get() {
2263
2374
  _arguments \
2264
- '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2265
- '--json[Print the details as machine-readable data instead of a table]' \
2375
+ '--elements[Also report the resources the workspace holds.]' \
2376
+ '--json[Print the workspace as machine-readable JSON.]' \
2377
+ '--timeout[Milliseconds to wait for the API (default 30000).]:ms' \
2266
2378
  '(-h --help)'{-h,--help}'[display help for command]' \
2267
- '*:mockIdOrPath:_files -g "*.json"'
2379
+ '*:id:'
2268
2380
  }
2269
2381
 
2270
- _postman_mock_list() {
2382
+ _postman_workspace_create() {
2271
2383
  _arguments \
2272
- '(-w --workspace)'{-w,--workspace}'[Postman cloud workspace whose mocks to list, by id (defaults to the workspace already linked to this project)]:id' \
2273
- '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2274
- '--json[Print the list as machine-readable data instead of a table]' \
2275
- '(-h --help)'{-h,--help}'[display help for command]' \
2276
- '*:pathOrDir:_files -g "*.json"'
2384
+ '--visibility[Required. One of\: personal, private, team, public, partner.]:status' \
2385
+ '--name[Workspace name (defaults to owner/repo from the git remote)]:name' \
2386
+ '--summary[Optional workspace summary]:text' \
2387
+ '--team-id[The team inside your organisation the workspace belongs to. Required for a team workspace when your organisation has teams inside it. Find it with `postman team list`.]:id' \
2388
+ '--team-role[What a team or public workspace grants\: view or edit. Applies to the team named by --team-id, or to your whole organisation when none is named. Defaults to your team'\''s configured default.]:level' \
2389
+ '--path[Directory to bind (defaults to the current directory)]:dir:_files -g "*.json"' \
2390
+ '--no-connect[Create the workspace without binding it to the repository]' \
2391
+ '--force[Create even when a workspace is already recorded for this repo]' \
2392
+ '--json[Print the created workspace as machine-readable JSON.]' \
2393
+ '(-h --help)'{-h,--help}'[display help for command]'
2277
2394
  }
2278
2395
 
2279
- _postman_mock_log() {
2396
+ _postman_workspace_delete() {
2280
2397
  _arguments \
2281
- '--limit[Most entries to show (defaults to 50 when printing machine-readable output)]:n' \
2282
- '--method[Show only requests of this type (e.g. GET, POST)]:method' \
2283
- '--status[Show only these response codes (e.g. 404, or 5xx for any 500-series)]:code|range' \
2284
- '--path[Show only requests to matching addresses (use * and ? as wildcards, e.g. /users/*)]:pattern' \
2285
- '--since[Show entries from this long ago until now (e.g. 2h = the last 2 hours)]:duration' \
2286
- '--until[Hide entries newer than this (e.g. 30m = skip the most recent 30 minutes)]:duration' \
2287
- '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2288
- '--json[Print entries as machine-readable data instead of the scrollable view]' \
2398
+ '(-y --yes)'{-y,--yes}'[Skip the confirmation prompt]' \
2399
+ '--json[Print the outcome as machine-readable JSON]' \
2400
+ '--verbose[Show detailed logging]' \
2401
+ '--timeout[Abort the run after this many milliseconds. Defaults to 30000.]:ms' \
2289
2402
  '(-h --help)'{-h,--help}'[display help for command]' \
2290
- '*:mockServerId:_files -g "*.json"'
2403
+ '*:workspaceId:'
2291
2404
  }
2292
2405
 
2293
- _postman_mock_delete() {
2406
+ _postman_workspace_pull() {
2294
2407
  _arguments \
2295
- '(-y --yes)'{-y,--yes}'[Delete without asking for confirmation first]' \
2296
- '--api-key[Postman API key, used with a Postman cloud id (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2297
- '(-h --help)'{-h,--help}'[display help for command]' \
2298
- '*:mockIdOrPath:_files -g "*.json"'
2299
- }
2300
-
2301
- _postman_application() {
2302
- local context state state_descr line
2303
- typeset -A opt_args
2304
- _arguments -C \
2408
+ '(-y --yes)'{-y,--yes}'[Skip all confirmation prompts]' \
2409
+ '--source-workspace[Pull from a different source workspace.]:workspaceId' \
2410
+ '--json[Print the outcome as machine-readable JSON. Implies non-interactive\: use --yes to actually pull.]' \
2411
+ '--verbose[Show detailed logging]' \
2305
2412
  '(-h --help)'{-h,--help}'[display help for command]' \
2306
- '1: :_postman_application_commands' \
2307
- '*::arg:->args'
2308
- case $state in
2309
- args)
2310
- case $words[1] in
2311
- init) _postman_application_init ;;
2312
- test) _postman_application_test ;;
2313
- setup-capture) _postman_application_setup_capture ;;
2314
- esac
2315
- ;;
2316
- esac
2317
- }
2318
-
2319
- _postman_application_commands() {
2320
- local -a sub
2321
- sub=(
2322
- 'init:\[DEPRECATED\] Use `postman app test` instead. Initialise a postman.config.cjs file with target collections, environment, and test command.'
2323
- 'test:Run a command first (primary task), then match captured traffic against Postman collections and run assertions.'
2324
- 'setup-capture:Install postman-playwright and patch playwright.config.* to capture network traffic automatically via withPostman().'
2325
- )
2326
- _describe -t commands 'application command' sub
2413
+ '*:workspaceId:'
2327
2414
  }
2328
2415
 
2329
- _postman_application_init() {
2416
+ _postman_workspace_connect_git() {
2330
2417
  _arguments \
2331
- '--target-collection[Collection name or path for the default target (repeatable) (default\: \[\])]:name' \
2332
- '--target-environment[Environment name or path for the default target (last value wins) (default\: \[\])]:name' \
2333
- '--filter-urlpatterns[Comma-separated URL patterns to exclude from captured traffic (default\: \[\])]:patterns' \
2334
- '--filter-methods[Comma-separated HTTP methods to exclude from captured traffic (default\: \[\])]:methods' \
2335
- '--filter-headers[Comma-separated request header filters in header=value form (default\: \[\])]:headers' \
2336
- '--command[Command to run your tests (e.g. "npx playwright test")]:cmd' \
2337
- '(-h --help)'{-h,--help}'[display help for command]'
2418
+ '--verbose[Show detailed logging]' \
2419
+ '--json[Print the outcome as machine-readable JSON.]' \
2420
+ '(-h --help)'{-h,--help}'[display help for command]' \
2421
+ '*:path:_files -g "*.json"'
2338
2422
  }
2339
2423
 
2340
- _postman_application_test() {
2424
+ _postman_workspace_disconnect_git() {
2341
2425
  _arguments \
2342
- '--target[Select a target from postman.config.js targets block (default\: "default")]:name' \
2343
- '--target-collection[Collection override for the selected target (repeatable) (default\: \[\])]:path:_files -g "*.json"' \
2344
- '--target-environment[Environment override for the selected target (last value wins) (default\: \[\])]:path:_files -g "*.json"' \
2345
- '--command[Command to run first (primary task). Overrides config.]:cmd' \
2346
- '--deployed-version[Version identity of the application under test (e.g. a build ID, release tag, or version string). Also read from the APP_DEPLOYED_VERSION environment variable.]:version' \
2347
- '--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"' \
2348
- '--capture-only[Skip collection matching and tests; capture traffic and save a V3 collection organised by host]' \
2349
- '--output[Output directory for captured collection (default\: pm-results/captured/; used with --capture-only)]:path:_files -g "*.json"' \
2350
- '--force[Deprecated\: output directory is always overwritten on re-run (used with --capture-only)]' \
2351
- '--report-events[Dispatch application test run results to the API Catalog and Application Inventory ingestion pipelines (on by default) (default\: true)]:boolean' \
2352
- '--no-report-events[Do not dispatch run results to the API Catalog and Application Inventory ingestion pipelines]' \
2353
- '--verbose[Show detailed per-request matching, sandbox errors, and debug information]' \
2354
- '(-h --help)'{-h,--help}'[display help for command]'
2426
+ '(-y --yes)'{-y,--yes}'[Skip all confirmation prompts]' \
2427
+ '--verbose[Show detailed logging]' \
2428
+ '--json[Print the outcome as machine-readable JSON. Requires --yes to actually disconnect.]' \
2429
+ '(-h --help)'{-h,--help}'[display help for command]' \
2430
+ '*:workspaceId:'
2355
2431
  }
2356
2432
 
2357
- _postman_application_setup_capture() {
2433
+ _postman_workspace_diff() {
2358
2434
  _arguments \
2359
- '--config[Path to playwright.config.* to patch (default\: auto-detect)]:path:_files -g "*.json"' \
2360
- '(-h --help)'{-h,--help}'[display help for command]'
2435
+ '--push-strategy[Strategy to preview. "force-sync" also shows cloud entities that would be DELETED. Defaults to "force-sync".]:strategy' \
2436
+ '--summary[Skip content comparison. Faster, but updates are listed without checking whether they changed.]' \
2437
+ '--json[Print the diff as machine-readable JSON.]' \
2438
+ '--exit-code[Exit with code 1 when a verified difference is found (for CI gates). Entity types with no comparison path are reported but do not fail the gate.]' \
2439
+ '--verbose[Show detailed logging]' \
2440
+ '--timeout[Abort the run after this many milliseconds. Defaults to 120000.]:ms' \
2441
+ '(-h --help)'{-h,--help}'[display help for command]' \
2442
+ '*:workspaceId:'
2361
2443
  }
2362
2444
 
2363
- _postman_simulation() {
2445
+ _postman_context_graph() {
2364
2446
  local context state state_descr line
2365
2447
  typeset -A opt_args
2366
2448
  _arguments -C \
2367
2449
  '(-h --help)'{-h,--help}'[display help for command]' \
2368
- '1: :_postman_simulation_commands' \
2450
+ '1: :_postman_context_graph_commands' \
2369
2451
  '*::arg:->args'
2370
2452
  case $state in
2371
2453
  args)
2372
2454
  case $words[1] in
2373
- create) _postman_simulation_create ;;
2374
- list) _postman_simulation_list ;;
2375
- get) _postman_simulation_get ;;
2376
- run) _postman_simulation_run ;;
2377
- push) _postman_simulation_push ;;
2378
- deploy) _postman_simulation_deploy ;;
2379
- delete) _postman_simulation_delete ;;
2455
+ ask) _postman_context_graph_ask ;;
2456
+ status) _postman_context_graph_status ;;
2457
+ ingest) _postman_context_graph_ingest ;;
2380
2458
  esac
2381
2459
  ;;
2382
2460
  esac
2383
2461
  }
2384
2462
 
2385
- _postman_simulation_commands() {
2463
+ _postman_context_graph_commands() {
2386
2464
  local -a sub
2387
2465
  sub=(
2388
- 'create:Create a simulation that serves several mocks behind one address'
2389
- 'list:List the simulations in your repository or Postman cloud workspace'
2390
- 'get:Show a simulation'\''s details using its .sim.yaml path if it lives in your repository, or its id if it lives in Postman cloud.'
2391
- 'run:Serve a simulation'\''s mocks on one local port, routing each by its routeKey. Pass a .sim.yaml path (local) or a Postman simulation id (fetched and run locally).'
2392
- 'push:Upload a simulation from your repository to Postman cloud (creates it the first time, updates it after). Its member mocks are pushed too.'
2393
- 'deploy:Turn a simulation in Postman cloud into a live mock server others can call over the internet.'
2394
- 'delete:Delete a simulation using its .sim.yaml path if it lives in your repository, or its id if it lives in Postman cloud. Cannot be undone.'
2466
+ 'ask:Ask a natural-language question about your team'\''s Context Graph.'
2467
+ 'status:Check an ask submitted by `ask`, without blocking. Prints the answer when ready.'
2468
+ 'ingest:Onboard repos and workspaces into your team'\''s Context Graph, and check ingestion progress.'
2395
2469
  )
2396
- _describe -t commands 'simulation command' sub
2470
+ _describe -t commands 'context-graph command' sub
2397
2471
  }
2398
2472
 
2399
- _postman_simulation_create() {
2473
+ _postman_context_graph_ask() {
2400
2474
  _arguments \
2401
- '(-n --name)'{-n,--name}'[Name for the simulation]:name' \
2402
- '--mock[A mock to include (repeatable). Use a local mock path to build the simulation in your repository, or a Postman mock id to create it in Postman cloud. Set its address with <mockIdOrPath>=<routeKey>. (default\: \[\])]:mockIdOrPath:_files -g "*.json"' \
2403
- '--routing[How callers reach each mock\: header or path (default path)]:header|path' \
2404
- '(-o --output)'{-o,--output}'[Where to save the simulation file in your repository, a file or folder (defaults to postman/simulations)]:path:_files -g "*.json"' \
2405
- '--force[Overwrite the simulation file if it already exists]' \
2406
- '(-w --workspace)'{-w,--workspace}'[Postman cloud workspace to create the simulation in, by id (defaults to the workspace already linked to this project)]:id' \
2407
- '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2408
- '(-h --help)'{-h,--help}'[display help for command]'
2475
+ '--wait[Block until the answer arrives, then print it]' \
2476
+ '--api-key[Postman API key (falls back to POSTMAN_API_KEY, then a `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2477
+ '--json[Output the ask record as JSON]' \
2478
+ '--no-include-answer[Do not ask the service to include the answer inline]' \
2479
+ '--max-steps[Cap the reasoning steps the service may take (its default applies when omitted)]:count' \
2480
+ '--interval[With --wait, seconds between polls (default\: 2)]:seconds' \
2481
+ '--timeout[With --wait, seconds to wait before giving up (default\: 300)]:seconds' \
2482
+ '(-h --help)'{-h,--help}'[display help for command]' \
2483
+ '*:query:'
2409
2484
  }
2410
2485
 
2411
- _postman_simulation_list() {
2486
+ _postman_context_graph_status() {
2412
2487
  _arguments \
2413
- '(-w --workspace)'{-w,--workspace}'[Postman cloud workspace whose simulations to list, by id (defaults to the workspace already linked to this project)]:id' \
2414
- '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2415
- '--json[Print the list as machine-readable data instead of a table]' \
2488
+ '--api-key[Postman API key (falls back to POSTMAN_API_KEY, then a `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2489
+ '--json[Output the ask record as JSON]' \
2416
2490
  '(-h --help)'{-h,--help}'[display help for command]' \
2417
- '*:pathOrDir:_files -g "*.json"'
2491
+ '*:askId:'
2418
2492
  }
2419
2493
 
2420
- _postman_simulation_get() {
2421
- _arguments \
2422
- '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2423
- '--json[Print the details as machine-readable data instead of a table]' \
2494
+ _postman_context_graph_ingest() {
2495
+ local context state state_descr line
2496
+ typeset -A opt_args
2497
+ _arguments -C \
2424
2498
  '(-h --help)'{-h,--help}'[display help for command]' \
2425
- '*:simIdOrPath:'
2499
+ '1: :_postman_context_graph_ingest_commands' \
2500
+ '*::arg:->args'
2501
+ case $state in
2502
+ args)
2503
+ case $words[1] in
2504
+ git) _postman_context_graph_ingest_git ;;
2505
+ workspaces) _postman_context_graph_ingest_workspaces ;;
2506
+ status) _postman_context_graph_ingest_status ;;
2507
+ esac
2508
+ ;;
2509
+ esac
2426
2510
  }
2427
2511
 
2428
- _postman_simulation_run() {
2429
- _arguments \
2430
- '(-e --environment)'{-e,--environment}'[Path to a file of environment variables for the mocks (relative or absolute)]:path:_files -g "*.json"' \
2431
- '(-g --globals)'{-g,--globals}'[Path to a file of global variables for the mocks (relative or absolute)]:path:_files -g "*.json"' \
2432
- '(-p --port)'{-p,--port}'[Port to serve on (e.g. 4010), or "auto" for a free one (default 3000)]:port' \
2433
- '--dataset[Dataset file or folder to load for pm.datasets (repeatable) (default\: \[\])]:pathOrDir:_files -g "*.json"' \
2434
- '(-w --workspace)'{-w,--workspace}'[Workspace for recording start history. Derived from a simulation id or the linked project; needed only for an unlinked .sim.yaml path.]:id' \
2435
- '--simulation[Simulation id to record start history against for a .sim.yaml path (a local file has only a name). Not needed when running by simulation id, or when the file is linked to a cloud simulation (via workspace push).]:id' \
2436
- '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2437
- '--no-history[Do not record this run in the simulation'\''s start history]' \
2438
- '--output[Live output format\: auto (default, human-readable logs) or ndjson (one JSON event per line on stdout, ending with a "summary" event — for CI or other non-interactive use) (default\: "auto")]:format' \
2439
- '--proxy[Serve the mocks behind a local HTTP(S) forward proxy instead of one routed port, so a repo under test can point HTTP_PROXY/HTTPS_PROXY at it and reach each mock by hostname without code changes. Requires a simulation.yaml (routing config), not a .sim.yaml.]' \
2440
- '--proxy-port[Port for the proxy server. Distinct from --port, which is the one-port run'\''s own port. (default\: 7001)]:n' \
2441
- '--scenario[Scenario each mock serves, sent as both pm-mock-scenario and x-mock-scenario. (default\: "default")]:name' \
2442
- '--session[Session id to select via the x-mock-session header (default\: a generated id).]:id' \
2443
- '--log-format[Proxy request log format\: text or json. (default\: "text")]:format' \
2444
- '--log-body[Also log each response body (truncated). Buffers full responses in memory; meant for temporary debugging, not left on by default.]' \
2445
- '--doctor[Start the proxy, probe each available HTTP client (fetch/undici/axios/node-fetch) to confirm it honors HTTP_PROXY/HTTPS_PROXY, then exit.]' \
2446
- '(-h --help)'{-h,--help}'[display help for command]' \
2447
- '*:simIdOrPath:'
2512
+ _postman_context_graph_ingest_commands() {
2513
+ local -a sub
2514
+ sub=(
2515
+ 'git:Onboard GitHub repos into your team'\''s Context Graph.'
2516
+ 'workspaces:Onboard Postman workspaces into your team'\''s Context Graph.'
2517
+ 'status:Check ingestion progress for the team, or for one source.'
2518
+ )
2519
+ _describe -t commands 'ingest command' sub
2448
2520
  }
2449
2521
 
2450
- _postman_simulation_push() {
2522
+ _postman_context_graph_ingest_git() {
2451
2523
  _arguments \
2452
- '(-w --workspace)'{-w,--workspace}'[Postman cloud workspace to upload to, by id (defaults to the workspace already linked to this project)]:id' \
2453
- '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2524
+ '--all-git-linked-workspaces[Also onboard the repo linked to every git-linked workspace in the team]' \
2525
+ '--tag[With --all-git-linked-workspaces, only workspaces with this tag. Repeatable, up to 5; all must match]:tag' \
2526
+ '--ttl[Override the service'\''s default TTL, in seconds]:seconds' \
2527
+ '--api-key[Postman API key (falls back to POSTMAN_API_KEY, then a `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2528
+ '--json[Output the onboarding response as JSON]' \
2454
2529
  '(-h --help)'{-h,--help}'[display help for command]' \
2455
- '*:simPath:'
2530
+ '*:repoUrls...:'
2456
2531
  }
2457
2532
 
2458
- _postman_simulation_deploy() {
2533
+ _postman_context_graph_ingest_workspaces() {
2459
2534
  _arguments \
2460
- '(-w --workspace)'{-w,--workspace}'[Postman cloud workspace that will own the server, by id (defaults to the workspace already linked to this project)]:id' \
2461
- '(-n --name)'{-n,--name}'[Name for the mock server (you are asked for one if you skip this)]:name' \
2462
- '(-s --slug)'{-s,--slug}'[Short label used in the server'\''s web address, e.g. "my-sim" (you are asked for one if you skip this)]:slug' \
2463
- '--private[Require a Postman API key to reach the server. Public by default.]' \
2464
- '(-y --yes)'{-y,--yes}'[Use the defaults and skip all questions (public)]' \
2465
- '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2466
- '(-h --help)'{-h,--help}'[display help for command]' \
2467
- '*:simId:'
2535
+ '(-w --workspace)'{-w,--workspace}'[Workspace to onboard. Repeatable. Omit to onboard the team'\''s git-linked workspaces]:id' \
2536
+ '--top[Cap how many workspaces this call onboards]:n' \
2537
+ '--ttl[Override the service'\''s default TTL, in seconds]:seconds' \
2538
+ '--api-key[Postman API key (falls back to POSTMAN_API_KEY, then a `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2539
+ '--json[Output the onboarding response as JSON]' \
2540
+ '(-h --help)'{-h,--help}'[display help for command]'
2468
2541
  }
2469
2542
 
2470
- _postman_simulation_delete() {
2543
+ _postman_context_graph_ingest_status() {
2471
2544
  _arguments \
2472
- '(-y --yes)'{-y,--yes}'[Delete without asking for confirmation first]' \
2473
- '--api-key[Postman API key, used with a Postman cloud id (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2474
- '(-h --help)'{-h,--help}'[display help for command]' \
2475
- '*:simIdOrPath:'
2545
+ '--source[Show one source'\''s jobs, by the source id `ingest git` or `ingest workspaces` printed]:sourceId' \
2546
+ '--api-key[Postman API key (falls back to POSTMAN_API_KEY, then a `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2547
+ '--json[Output the service response as JSON]' \
2548
+ '(-h --help)'{-h,--help}'[display help for command]'
2476
2549
  }
2477
2550
 
2478
2551
  _postman_describe() {
@@ -2710,51 +2783,17 @@ _postman_describe_environment_get() {
2710
2783
  '(-h --help)'{-h,--help}'[display help for command]'
2711
2784
  }
2712
2785
 
2713
- _postman_context_graph() {
2714
- local context state state_descr line
2715
- typeset -A opt_args
2716
- _arguments -C \
2717
- '(-h --help)'{-h,--help}'[display help for command]' \
2718
- '1: :_postman_context_graph_commands' \
2719
- '*::arg:->args'
2720
- case $state in
2721
- args)
2722
- case $words[1] in
2723
- ask) _postman_context_graph_ask ;;
2724
- status) _postman_context_graph_status ;;
2725
- esac
2726
- ;;
2727
- esac
2728
- }
2729
-
2730
- _postman_context_graph_commands() {
2731
- local -a sub
2732
- sub=(
2733
- 'ask:Ask a natural-language question about your team'\''s Context Graph.'
2734
- 'status:Check an ask submitted by `ask`, without blocking. Prints the answer when ready.'
2735
- )
2736
- _describe -t commands 'context-graph command' sub
2737
- }
2738
-
2739
- _postman_context_graph_ask() {
2740
- _arguments \
2741
- '--wait[Block until the answer arrives, then print it]' \
2742
- '--api-key[Postman API key (falls back to POSTMAN_API_KEY, then a `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2743
- '--json[Output the ask record as JSON]' \
2744
- '--no-include-answer[Do not ask the service to include the answer inline]' \
2745
- '--max-steps[Cap the reasoning steps the service may take (its default applies when omitted)]:count' \
2746
- '--interval[With --wait, seconds between polls (default\: 2)]:seconds' \
2747
- '--timeout[With --wait, seconds to wait before giving up (default\: 300)]:seconds' \
2748
- '(-h --help)'{-h,--help}'[display help for command]' \
2749
- '*:query:'
2750
- }
2751
-
2752
- _postman_context_graph_status() {
2786
+ _postman_init() {
2753
2787
  _arguments \
2754
- '--api-key[Postman API key (falls back to POSTMAN_API_KEY, then a `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
2755
- '--json[Output the ask record as JSON]' \
2788
+ '--json[Emit machine-readable output for agents]' \
2789
+ '--dry-run[Report what would happen without writing anything]' \
2790
+ '--no-fetch[Use the skills bundled with this CLI instead of fetching the latest]' \
2791
+ '--spec[Which spec is authoritative, when more than one could be]:path:_files -g "*.(yaml|yml|json)"' \
2792
+ '--visibility[Create and bind a workspace non-interactively (personal, team)]:status' \
2793
+ '(-y --yes)'{-y,--yes}'[Accept the default for every question instead of asking or stopping]' \
2794
+ '--report-events[Dispatch init events to the API Catalog and Application Inventory ingestion pipelines (requires login)]' \
2756
2795
  '(-h --help)'{-h,--help}'[display help for command]' \
2757
- '*:askId:'
2796
+ '*:path:_files -g "*.json"'
2758
2797
  }
2759
2798
 
2760
2799
  _postman_search() {
@@ -2849,672 +2888,722 @@ _postman_search_documents() {
2849
2888
  '*:query:'
2850
2889
  }
2851
2890
 
2852
- _postman_webhook() {
2891
+ _postman_skills() {
2853
2892
  local context state state_descr line
2854
2893
  typeset -A opt_args
2855
2894
  _arguments -C \
2856
2895
  '(-h --help)'{-h,--help}'[display help for command]' \
2857
- '1: :_postman_webhook_commands' \
2896
+ '1: :_postman_skills_commands' \
2858
2897
  '*::arg:->args'
2859
2898
  case $state in
2860
2899
  args)
2861
2900
  case $words[1] in
2862
- create) _postman_webhook_create ;;
2863
- start) _postman_webhook_start ;;
2864
- pause) _postman_webhook_pause ;;
2865
- list) _postman_webhook_list ;;
2866
- delete) _postman_webhook_delete ;;
2867
- status) _postman_webhook_status ;;
2868
- requests) _postman_webhook_requests ;;
2869
- scripts) _postman_webhook_scripts ;;
2870
- forward) _postman_webhook_forward ;;
2901
+ status) _postman_skills_status ;;
2902
+ update) _postman_skills_update ;;
2871
2903
  esac
2872
2904
  ;;
2873
2905
  esac
2874
2906
  }
2875
2907
 
2876
- _postman_webhook_commands() {
2908
+ _postman_skills_commands() {
2877
2909
  local -a sub
2878
2910
  sub=(
2879
- 'create:Create a new webhook and print its public URL.'
2880
- 'start:Activate a webhook so it can receive requests.'
2881
- 'pause:Pause a webhook so it no longer accepts requests.'
2882
- 'list:List all webhooks in a workspace.'
2883
- 'delete:Permanently delete a webhook.'
2884
- 'status:Show details for a webhook.'
2885
- 'requests:List, inspect, and replay requests received by a webhook.'
2886
- 'scripts:Create or update scripts executed by a webhook.'
2887
- 'forward:Forward incoming webhook requests to a local port.'
2911
+ 'status:Report whether this repository'\''s skills are up to date.'
2912
+ 'update:Fetch the latest skills into this repository.'
2888
2913
  )
2889
- _describe -t commands 'webhook command' sub
2914
+ _describe -t commands 'skills command' sub
2890
2915
  }
2891
2916
 
2892
- _postman_webhook_create() {
2917
+ _postman_skills_status() {
2893
2918
  _arguments \
2894
- '(-t --title)'{-t,--title}'[Name for the webhook (default\: "CLI Webhook")]:title' \
2895
- '(-w --workspace)'{-w,--workspace}'[Postman workspace ID (falls back to .postman/resources.yaml or .postman/config.json)]:workspaceId' \
2896
- '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
2897
- '(-h --help)'{-h,--help}'[display help for command]'
2919
+ '--json[Emit machine-readable output for agents]' \
2920
+ '--strict[Exit non-zero when the skills are not current]' \
2921
+ '(-h --help)'{-h,--help}'[display help for command]' \
2922
+ '*:path:_files -g "*.json"'
2898
2923
  }
2899
2924
 
2900
- _postman_webhook_start() {
2925
+ _postman_skills_update() {
2901
2926
  _arguments \
2902
- '(-w --workspace)'{-w,--workspace}'[Postman workspace ID]:workspaceId' \
2903
- '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
2927
+ '--json[Emit machine-readable output for agents]' \
2928
+ '--dry-run[Report what would change without writing anything]' \
2929
+ '--force[Overwrite skill files that were edited locally]' \
2904
2930
  '(-h --help)'{-h,--help}'[display help for command]' \
2905
- '*:webhookIdOrUrl:'
2931
+ '*:path:_files -g "*.json"'
2906
2932
  }
2907
2933
 
2908
- _postman_webhook_pause() {
2934
+ _postman_login() {
2909
2935
  _arguments \
2910
- '(-w --workspace)'{-w,--workspace}'[Postman workspace ID]:workspaceId' \
2911
- '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
2912
- '(-h --help)'{-h,--help}'[display help for command]' \
2913
- '*:webhookIdOrUrl:'
2936
+ '--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' \
2937
+ '--with-api-key[Specify the API key directly.]:apikey' \
2938
+ '--region[Specify the region for authentication. Use "eu" for EU region.]:region:(us eu)' \
2939
+ '--verbose[Show detailed error information]' \
2940
+ '(-h --help)'{-h,--help}'[display help for command]'
2914
2941
  }
2915
2942
 
2916
- _postman_webhook_list() {
2943
+ _postman_logout() {
2917
2944
  _arguments \
2918
- '(-w --workspace)'{-w,--workspace}'[Postman workspace ID (falls back to .postman/resources.yaml or .postman/config.json)]:workspaceId' \
2919
- '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
2945
+ '--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' \
2920
2946
  '(-h --help)'{-h,--help}'[display help for command]'
2921
2947
  }
2922
2948
 
2923
- _postman_webhook_delete() {
2949
+ _postman_signup() {
2924
2950
  _arguments \
2925
- '(-w --workspace)'{-w,--workspace}'[Postman workspace ID]:workspaceId' \
2926
- '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
2927
- '(-h --help)'{-h,--help}'[display help for command]' \
2928
- '*:webhookId:'
2951
+ '--guest[Start working as an anonymous guest instead of signing up — no account or browser needed, so it works anywhere. Your work is saved to a temporary workspace you can keep later by running `postman signup`.]' \
2952
+ '--json[Print the sign-up details as machine-readable JSON.]' \
2953
+ '(-h --help)'{-h,--help}'[display help for command]'
2929
2954
  }
2930
2955
 
2931
- _postman_webhook_status() {
2956
+ _postman_whoami() {
2932
2957
  _arguments \
2933
- '(-w --workspace)'{-w,--workspace}'[Postman workspace ID]:workspaceId' \
2934
- '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
2935
- '(-h --help)'{-h,--help}'[display help for command]' \
2936
- '*:webhookId:'
2958
+ '--json[Print current identity as machine-readable JSON.]' \
2959
+ '(-h --help)'{-h,--help}'[display help for command]'
2937
2960
  }
2938
2961
 
2939
- _postman_webhook_requests() {
2962
+ _postman_application() {
2940
2963
  local context state state_descr line
2941
2964
  typeset -A opt_args
2942
2965
  _arguments -C \
2943
2966
  '(-h --help)'{-h,--help}'[display help for command]' \
2944
- '1: :_postman_webhook_requests_commands' \
2967
+ '1: :_postman_application_commands' \
2945
2968
  '*::arg:->args'
2946
2969
  case $state in
2947
2970
  args)
2948
2971
  case $words[1] in
2949
- list) _postman_webhook_requests_list ;;
2950
- describe) _postman_webhook_requests_describe ;;
2951
- replay) _postman_webhook_requests_replay ;;
2972
+ init) _postman_application_init ;;
2973
+ test) _postman_application_test ;;
2974
+ setup-capture) _postman_application_setup_capture ;;
2952
2975
  esac
2953
2976
  ;;
2954
2977
  esac
2955
2978
  }
2956
2979
 
2957
- _postman_webhook_requests_commands() {
2980
+ _postman_application_commands() {
2958
2981
  local -a sub
2959
2982
  sub=(
2960
- 'list:List recent requests received by a webhook.'
2961
- 'describe:Show details for a request received by a webhook.'
2962
- 'replay:Replay a request received by a webhook.'
2983
+ 'init:\[DEPRECATED\] Use `postman app test` instead. Initialise a postman.config.cjs file with target collections, environment, and test command.'
2984
+ 'test:Run a command first (primary task), then match captured traffic against Postman collections and run assertions.'
2985
+ 'setup-capture:Install postman-playwright and patch playwright.config.* to capture network traffic automatically via withPostman().'
2963
2986
  )
2964
- _describe -t commands 'requests command' sub
2987
+ _describe -t commands 'application command' sub
2965
2988
  }
2966
2989
 
2967
- _postman_webhook_requests_list() {
2990
+ _postman_application_init() {
2968
2991
  _arguments \
2969
- '(-w --workspace)'{-w,--workspace}'[Postman workspace ID (falls back to .postman/resources.yaml or .postman/config.json)]:workspaceId' \
2970
- '--cursor[Pagination cursor returned by a previous request list response]:cursor' \
2971
- '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
2972
- '(-h --help)'{-h,--help}'[display help for command]' \
2973
- '*:webhookId:'
2992
+ '--target-collection[Collection name or path for the default target (repeatable) (default\: \[\])]:name' \
2993
+ '--target-environment[Environment name or path for the default target (last value wins) (default\: \[\])]:name' \
2994
+ '--filter-urlpatterns[Comma-separated URL patterns to exclude from captured traffic (default\: \[\])]:patterns' \
2995
+ '--filter-methods[Comma-separated HTTP methods to exclude from captured traffic (default\: \[\])]:methods' \
2996
+ '--filter-headers[Comma-separated request header filters in header=value form (default\: \[\])]:headers' \
2997
+ '--command[Command to run your tests (e.g. "npx playwright test")]:cmd' \
2998
+ '(-h --help)'{-h,--help}'[display help for command]'
2974
2999
  }
2975
3000
 
2976
- _postman_webhook_requests_describe() {
3001
+ _postman_application_test() {
2977
3002
  _arguments \
2978
- '(-w --workspace)'{-w,--workspace}'[Postman workspace ID (falls back to .postman/resources.yaml or .postman/config.json)]:workspaceId' \
2979
- '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
2980
- '--verbose[Show script execution logs]' \
2981
- '(-h --help)'{-h,--help}'[display help for command]' \
2982
- '*:requestId:'
3003
+ '--target[Select a target from postman.config.js targets block (default\: "default")]:name' \
3004
+ '--target-collection[Collection override for the selected target (repeatable) (default\: \[\])]:path:_files -g "*.json"' \
3005
+ '--target-environment[Environment override for the selected target (last value wins) (default\: \[\])]:path:_files -g "*.json"' \
3006
+ '--command[Command to run first (primary task). Overrides config.]:cmd' \
3007
+ '--deployed-version[Version identity of the application under test (e.g. a build ID, release tag, or version string). Also read from the APP_DEPLOYED_VERSION environment variable.]:version' \
3008
+ '--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"' \
3009
+ '--capture-only[Skip collection matching and tests; capture traffic and save a V3 collection organised by host]' \
3010
+ '--output[Output directory for captured collection (default\: pm-results/captured/; used with --capture-only)]:path:_files -g "*.json"' \
3011
+ '--force[Deprecated\: output directory is always overwritten on re-run (used with --capture-only)]' \
3012
+ '--report-events[Dispatch application test run results to the API Catalog and Application Inventory ingestion pipelines (on by default) (default\: true)]:boolean' \
3013
+ '--no-report-events[Do not dispatch run results to the API Catalog and Application Inventory ingestion pipelines]' \
3014
+ '--verbose[Show detailed per-request matching, sandbox errors, and debug information]' \
3015
+ '(-h --help)'{-h,--help}'[display help for command]'
2983
3016
  }
2984
3017
 
2985
- _postman_webhook_requests_replay() {
3018
+ _postman_application_setup_capture() {
2986
3019
  _arguments \
2987
- '(-w --workspace)'{-w,--workspace}'[Postman workspace ID (falls back to .postman/resources.yaml or .postman/config.json)]:workspaceId' \
2988
- '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
2989
- '(-h --help)'{-h,--help}'[display help for command]' \
2990
- '*:requestId:'
3020
+ '--config[Path to playwright.config.* to patch (default\: auto-detect)]:path:_files -g "*.json"' \
3021
+ '(-h --help)'{-h,--help}'[display help for command]'
2991
3022
  }
2992
3023
 
2993
- _postman_webhook_scripts() {
3024
+ _postman_dependency() {
2994
3025
  local context state state_descr line
2995
3026
  typeset -A opt_args
2996
3027
  _arguments -C \
2997
3028
  '(-h --help)'{-h,--help}'[display help for command]' \
2998
- '1: :_postman_webhook_scripts_commands' \
3029
+ '1: :_postman_dependency_commands' \
2999
3030
  '*::arg:->args'
3000
3031
  case $state in
3001
3032
  args)
3002
3033
  case $words[1] in
3003
- set) _postman_webhook_scripts_set ;;
3034
+ add) _postman_dependency_add ;;
3035
+ get) _postman_dependency_get ;;
3036
+ list) _postman_dependency_list ;;
3037
+ install) _postman_dependency_install ;;
3038
+ update) _postman_dependency_update ;;
3039
+ remove) _postman_dependency_remove ;;
3004
3040
  esac
3005
3041
  ;;
3006
3042
  esac
3007
3043
  }
3008
3044
 
3009
- _postman_webhook_scripts_commands() {
3045
+ _postman_dependency_commands() {
3010
3046
  local -a sub
3011
3047
  sub=(
3012
- 'set:Create or update a webhook script from a JavaScript or TypeScript file.'
3048
+ 'add:Add a Postman collection, environment, or mock as a workspace dependency.'
3049
+ 'get:Show a declared workspace dependency from .postman/resources.yaml.'
3050
+ 'list:List the workspace dependencies declared in .postman/resources.yaml.'
3051
+ 'install:Materialise the dependencies declared in .postman/resources.yaml (all, or one).'
3052
+ 'update:Refresh declared dependencies to the latest content from their source (all, or one).'
3053
+ 'remove:Remove a workspace dependency and delete its local files.'
3013
3054
  )
3014
- _describe -t commands 'scripts command' sub
3055
+ _describe -t commands 'dependency command' sub
3015
3056
  }
3016
3057
 
3017
- _postman_webhook_scripts_set() {
3058
+ _postman_dependency_add() {
3018
3059
  _arguments \
3019
- '--event[Script event\: onEvent or onResponse]:event' \
3020
- '(-w --workspace)'{-w,--workspace}'[Postman workspace ID (falls back to .postman/resources.yaml or .postman/config.json)]:workspaceId' \
3021
- '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
3060
+ '(-w --workspace)'{-w,--workspace}'[Workspace id to resolve a name in (defaults to the current workspace).]:id' \
3061
+ '(-y --yes)'{-y,--yes}'[Skip all confirmation prompts.]' \
3062
+ '--json[Output the result as JSON.]' \
3022
3063
  '(-h --help)'{-h,--help}'[display help for command]' \
3023
- '*:scriptPath:'
3064
+ '*:nameOrId:'
3024
3065
  }
3025
3066
 
3026
- _postman_webhook_forward() {
3067
+ _postman_dependency_get() {
3027
3068
  _arguments \
3028
- '(-w --workspace)'{-w,--workspace}'[Postman workspace ID]:workspaceId' \
3029
- '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
3069
+ '--type[Only match dependencies of this type (collection, environment, or mock).]:type' \
3070
+ '--json[Output the result as JSON.]' \
3030
3071
  '(-h --help)'{-h,--help}'[display help for command]' \
3031
- '*:port:'
3072
+ '*:nameOrId:'
3032
3073
  }
3033
3074
 
3034
- _postman_dataset() {
3075
+ _postman_dependency_list() {
3076
+ _arguments \
3077
+ '--type[Only list dependencies of this type (collection, environment, or mock).]:type' \
3078
+ '--json[Output the result as JSON.]' \
3079
+ '(-h --help)'{-h,--help}'[display help for command]'
3080
+ }
3081
+
3082
+ _postman_dependency_install() {
3083
+ _arguments \
3084
+ '--type[Only install dependencies of this type (collection, environment, or mock).]:type' \
3085
+ '--json[Output the result as JSON.]' \
3086
+ '(-h --help)'{-h,--help}'[display help for command]' \
3087
+ '*:nameOrId:'
3088
+ }
3089
+
3090
+ _postman_dependency_update() {
3091
+ _arguments \
3092
+ '--type[Only update dependencies of this type (collection, environment, or mock).]:type' \
3093
+ '--json[Output the result as JSON.]' \
3094
+ '(-h --help)'{-h,--help}'[display help for command]' \
3095
+ '*:nameOrId:'
3096
+ }
3097
+
3098
+ _postman_dependency_remove() {
3099
+ _arguments \
3100
+ '--type[Only match dependencies of this type (collection, environment, or mock).]:type' \
3101
+ '(-y --yes)'{-y,--yes}'[Skip the confirmation prompt (required outside an interactive terminal).]' \
3102
+ '--json[Output the result as JSON.]' \
3103
+ '(-h --help)'{-h,--help}'[display help for command]' \
3104
+ '*:nameOrId:'
3105
+ }
3106
+
3107
+ _postman_feedback() {
3108
+ _arguments \
3109
+ '--type[Feedback type\: cli_gap, improvement_suggestion, bug_report, feature_request, general (default\: general)]:type' \
3110
+ '--context[Command or feature context this feedback is about]:context' \
3111
+ '--json[Print result as machine-readable JSON]' \
3112
+ '(-h --help)'{-h,--help}'[display help for command]' \
3113
+ '*:text:'
3114
+ }
3115
+
3116
+ _postman_performance() {
3035
3117
  local context state state_descr line
3036
3118
  typeset -A opt_args
3037
3119
  _arguments -C \
3038
3120
  '(-h --help)'{-h,--help}'[display help for command]' \
3039
- '1: :_postman_dataset_commands' \
3121
+ '1: :_postman_performance_commands' \
3040
3122
  '*::arg:->args'
3041
3123
  case $state in
3042
3124
  args)
3043
3125
  case $words[1] in
3044
- list) _postman_dataset_list ;;
3045
- get) _postman_dataset_get ;;
3046
- query) _postman_dataset_query ;;
3047
- create) _postman_dataset_create ;;
3048
- delete) _postman_dataset_delete ;;
3049
- source) _postman_dataset_source ;;
3050
- view) _postman_dataset_view ;;
3051
- jdbc) _postman_dataset_jdbc ;;
3126
+ run) _postman_performance_run ;;
3127
+ list) _postman_performance_list ;;
3128
+ get) _postman_performance_get ;;
3052
3129
  esac
3053
3130
  ;;
3054
3131
  esac
3055
3132
  }
3056
3133
 
3057
- _postman_dataset_commands() {
3134
+ _postman_performance_commands() {
3058
3135
  local -a sub
3059
3136
  sub=(
3060
- 'list:List local dataset YAMLs under a path, or (no path) a workspace'\''s cloud datasets.'
3061
- 'get:Print a dataset'\''s metadata and structure summary (local YAML path or cloud id).'
3062
- 'query:Run an ad-hoc SQL query against a dataset (local YAML path or cloud id).'
3063
- 'create:Scaffold a new .dataset.yaml at <path>, or (no path, with -w) create a cloud dataset.'
3064
- 'delete:Permanently remove a dataset\: a local .dataset.yaml or a cloud dataset id.'
3065
- 'source:Inspect and manage a dataset'\''s datasources.'
3066
- 'view:Inspect and manage saved views on a dataset.'
3067
- 'jdbc:Inspect JDBC drivers before attaching one to a dataset.'
3137
+ 'run:Run a performance test on a collection'
3138
+ 'list:List past performance runs for a collection, newest first.'
3139
+ 'get:Get one performance run by ID.'
3068
3140
  )
3069
- _describe -t commands 'dataset command' sub
3070
- }
3071
-
3072
- _postman_dataset_list() {
3073
- _arguments \
3074
- '(-w --workspace)'{-w,--workspace}'[Postman workspace ID (cloud list)]:id' \
3075
- '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3076
- '--json[Output as JSON instead of a table]' \
3077
- '(-h --help)'{-h,--help}'[display help for command]' \
3078
- '*:pathOrDir:_files -g "*.json"'
3079
- }
3080
-
3081
- _postman_dataset_get() {
3082
- _arguments \
3083
- '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3084
- '--no-populate[Skip fetching datasources/views for a cloud dataset]' \
3085
- '--json[Output the full dataset as JSON]' \
3086
- '(-h --help)'{-h,--help}'[display help for command]' \
3087
- '*:datasetPathOrId:'
3141
+ _describe -t commands 'performance command' sub
3088
3142
  }
3089
3143
 
3090
- _postman_dataset_query() {
3144
+ _postman_performance_run() {
3091
3145
  _arguments \
3092
- '(-q --query)'{-q,--query}'[SQL query to execute (e.g. "SELECT * FROM users LIMIT 10")]:sql' \
3093
- '(-s --source)'{-s,--source}'[Execute directly against a database datasource; without --source, use federated SQLite]:nameOrIdOrSlug' \
3094
- '(-p --param)'{-p,--param}'[Bind values to $1, $2, ... in order; pass multiple values after -p or repeat -p]:value...' \
3095
- '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3096
- '--json[Output rows as JSON instead of a table]' \
3097
- '--debug[Include safe classified dataset diagnostics]' \
3146
+ '(-e --environment)'{-e,--environment}'[Specify an Id to a Postman Environment]:id' \
3147
+ '(-g --globals)'{-g,--globals}'[Specify an Id to a Postman Globals]:id' \
3148
+ '--setup-collection[Collection UID to run before the performance test]:id' \
3149
+ '--teardown-collection[Collection UID to run after the performance test]:id' \
3150
+ '--peak-vu[Peak (maximum) virtual users (default\: 20)]:count' \
3151
+ '--vu-count[Older name for --peak-vu]:count' \
3152
+ '--base-vu[Base (floor) virtual users the run starts from, 1 or more. Not for --load-profile fixed, which runs flat]:count' \
3153
+ '(-d --duration)'{-d,--duration}'[Duration of the performance test in minutes (default\: 1)]:minutes' \
3154
+ '(-p --load-profile)'{-p,--load-profile}'[Load profile type\: fixed, ramp-up, spike, peak (default\: "ramp-up")]:profile' \
3155
+ '(-s --load-segments)'{-s,--load-segments}'[Duration of each phase of the profile, comma separated, in order. ramp-up takes 2, spike 3, peak 4; fixed takes none. See the load-segment section below for which position is which phase]:durations' \
3156
+ '--data-file[Path to a JSON or CSV data file to use with the collection]:path:_files -g "*.json"' \
3157
+ '--ssl-client-cert-list[Path to a client certificates configuration file (JSON). Local runner only.]:path:_files -g "*.(pem|crt|key)"' \
3158
+ '--ssl-client-cert[Path to a client certificate (PEM) for mTLS targets. Local runner only.]:path:_files -g "*.(pem|crt|key)"' \
3159
+ '--ssl-client-key[Path to the client certificate private key. Local runner only.]:path:_files -g "*.(pem|crt|key)"' \
3160
+ '--ssl-client-passphrase[Client certificate passphrase (for a protected key). Local runner only.]:passphrase' \
3161
+ '(-k --insecure)'{-k,--insecure}'[Disable SSL certificate verification for the target. Local runner only.]' \
3162
+ '--ssl-extra-ca-certs[Path to additionally trusted CA certificates (PEM) for the target. Local runner only.]:path:_files -g "*.(pem|crt|key)"' \
3163
+ '--dataset-id[Use a Postman Dataset as iteration data (with --dataset-view-id)]:id' \
3164
+ '--dataset-view-id[Dataset view to execute for iteration data (requires --dataset-id)]:id' \
3165
+ '--dataset-distribution[How rows map to VUs\: round-robin (default), fixed, random]:strategy' \
3166
+ '--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' \
3167
+ '--output[Output format for live results\: auto (default, interactive dashboard) or ndjson (one JSON object per line on stdout, ending with a "summary" event — for CI or other non-interactive use) (default\: "auto")]:format' \
3168
+ '--runner[Runner to execute the performance test on\: local, postman-cloud, or postman-cloud-static-ip (egress from your account region'\''s static-IP cluster) (default\: local)]:runner' \
3169
+ '--disable-unicode[Forces Unicode compliant symbols to be replaced by their plain text equivalents]' \
3170
+ '--pass-if[Pass condition in format\: function(metric, value) (repeatable; all conditions must hold). Functions\: less_than, greater_than, less_than_eq, greater_than_eq. Metrics\: avg, p90, p95, p99, error_rate, rps. Example\: less_than(p95, 500)]:condition' \
3171
+ '--use-mock[Redirect a variable/host to a local code mock or cloud Mock Server (repeatable). Format\: "<{{var}}|host> mock|mock-server\:<path|id> \[scenario\]" (default\: \[\])]:mapping' \
3172
+ '--dataset[Pass --dataset multiple times to load several .dataset.yaml files (or directories containing them). Each is made available to the handlers of the local mocks started by --use-mock as pm.datasets(<id>). Local runner only. (default\: \[\])]:pathOrDir:_files -g "*.json"' \
3098
3173
  '(-h --help)'{-h,--help}'[display help for command]' \
3099
- '*:datasetPathOrId:'
3174
+ '*:collectionId:_files -g "*.json"'
3100
3175
  }
3101
3176
 
3102
- _postman_dataset_create() {
3177
+ _postman_performance_list() {
3103
3178
  _arguments \
3104
- '(-n --name)'{-n,--name}'[Human-readable name for the dataset]:name' \
3105
- '(-d --description)'{-d,--description}'[Optional description]:desc' \
3106
- '--dataset-id[Override the generated dataset id (local only; defaults to a random v4 UUID)]:uuid' \
3107
- '--force[Overwrite an existing file at <path>]' \
3108
- '(-w --workspace)'{-w,--workspace}'[Postman workspace ID (create a cloud dataset)]:id' \
3109
- '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3179
+ '(-c --collection-id)'{-c,--collection-id}'[Collection ID whose performance runs to list]:id' \
3180
+ '--cursor[Pagination cursor from a previous page'\''s response]:token' \
3181
+ '--output[Output format\: table (default) or json (default\: "table")]:format' \
3182
+ '--json[Alias for --output json]' \
3183
+ '--timeout[Milliseconds to wait for the service before failing (default\: "30000")]:ms' \
3110
3184
  '(-h --help)'{-h,--help}'[display help for command]' \
3111
- '*:path:_files -g "*.json"'
3185
+ '*:id:'
3112
3186
  }
3113
3187
 
3114
- _postman_dataset_delete() {
3188
+ _postman_performance_get() {
3115
3189
  _arguments \
3116
- '(-y --yes)'{-y,--yes}'[Skip the confirmation prompt]' \
3117
- '--keep-resources[Preserve the local resource directory even when it is empty (local only)]' \
3118
- '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3190
+ '--output[Output format\: table (default) or json (default\: "table")]:format' \
3191
+ '--json[Alias for --output json]' \
3192
+ '--timeout[Milliseconds to wait for the service before failing (default\: "30000")]:ms' \
3119
3193
  '(-h --help)'{-h,--help}'[display help for command]' \
3120
- '*:datasetPathOrId:'
3194
+ '*:runId:'
3121
3195
  }
3122
3196
 
3123
- _postman_dataset_source() {
3197
+ _postman_secret() {
3124
3198
  local context state state_descr line
3125
3199
  typeset -A opt_args
3126
3200
  _arguments -C \
3127
3201
  '(-h --help)'{-h,--help}'[display help for command]' \
3128
- '1: :_postman_dataset_source_commands' \
3202
+ '1: :_postman_secret_commands' \
3129
3203
  '*::arg:->args'
3130
3204
  case $state in
3131
3205
  args)
3132
3206
  case $words[1] in
3133
- list) _postman_dataset_source_list ;;
3134
- add) _postman_dataset_source_add ;;
3135
- remove) _postman_dataset_source_remove ;;
3136
- update) _postman_dataset_source_update ;;
3137
- test) _postman_dataset_source_test ;;
3207
+ create) _postman_secret_create ;;
3208
+ list) _postman_secret_list ;;
3138
3209
  esac
3139
3210
  ;;
3140
3211
  esac
3141
3212
  }
3142
3213
 
3143
- _postman_dataset_source_commands() {
3214
+ _postman_secret_commands() {
3144
3215
  local -a sub
3145
3216
  sub=(
3146
- 'list:List the datasources defined on a dataset (local YAML path or cloud id).'
3147
- 'add:Add a datasource to a dataset.'
3148
- 'remove:Remove a datasource from a dataset (local YAML path or cloud id).'
3149
- 'update:Update fields on an existing datasource. Only the flags you provide are changed.'
3150
- 'test:Open and close a real connection using a source'\''s stored configuration.'
3217
+ 'create:Create a secret in a team'\''s shared vault.'
3218
+ 'list:List the secrets in a workspace'\''s shared vault\: key, secret id, vault id, and allowed domains.'
3151
3219
  )
3152
- _describe -t commands 'source command' sub
3153
- }
3154
-
3155
- _postman_dataset_source_list() {
3156
- _arguments \
3157
- '(-d --dataset)'{-d,--dataset}'[Dataset whose sources to list — a local .dataset.yaml path or a cloud dataset id]:datasetPathOrId' \
3158
- '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3159
- '--json[Output sources as JSON instead of a table]' \
3160
- '(-h --help)'{-h,--help}'[display help for command]'
3161
- }
3162
-
3163
- _postman_dataset_source_add() {
3164
- _arguments \
3165
- '(-d --dataset)'{-d,--dataset}'[Dataset to add the source to; positional target is also accepted for v1.45 compatibility]:datasetPathOrId' \
3166
- '(-n --name)'{-n,--name}'[Logical name for the source (becomes the SQL table name when it loads a file or a database --table). Required for every source except a spreadsheet, whose worksheets are each named source_<worksheet>]:name' \
3167
- '--source-id[Override the generated source id (local dataset only)]:uuid' \
3168
- '--format[Use this format instead of extension/type inference; file contents are not sniffed. A spreadsheet (xlsx/xls/ods) is added as one source per worksheet, each named source_<worksheet>]:csv|json|xlsx|xls|ods|jdbc|mysql|postgres|sqlserver' \
3169
- '--type[Source kind; local is inferred from --file, jdbc from --driver-jar]:local|mysql|postgresql|sqlserver|jdbc' \
3170
- '--file[Path to a local CSV/JSON/spreadsheet file (absolute or cwd-relative)]:path:_files -g "*.json"' \
3171
- '--ref-only[Reference the file in place; do NOT copy into data_dir (local dataset)]' \
3172
- '--force[When copying, overwrite an existing file at the destination (local dataset)]' \
3173
- '--upload[Cloud dataset only\: upload --file as a postmancloudfile source (runs via /exec). Without --upload, --file is registered as a local_filesystem source read by the local engine. Either way a cloud dataset takes csv/json only — add a spreadsheet to a local .dataset.yaml, where each worksheet becomes its own source.]' \
3174
- '--driver-jar[JDBC driver JAR(s). Repeatable, or pass several after one flag]:path...:_files -g "*.json"' \
3175
- '--driver-class[Driver class. Auto-resolved when the JAR contains exactly one]:fqcn' \
3176
- '--driver-name[Label for this driver type (defaults to the JAR filename)]:label' \
3177
- '--url-template[JDBC URL with {{placeholders}}, e.g. jdbc\:postgresql\://{{host}}\:{{port}}/{{database}}]:template' \
3178
- '--var[Value for a {{placeholder}}. Repeatable. Use vault\:<vaultId>/<secretId> for a secret. WARNING\: a literal value is visible in `ps` output and shell history, and is stored in clear text in the dataset YAML (local) or sent in the request body (cloud). Prefer a Shared Vault reference.]:name=value...' \
3179
- '--prop[Driver connection property. Repeatable. Same vault\: syntax as --var]:name=value...' \
3180
- '--vars-file[JSON object of --var values; "-" reads stdin. Supports {"$vaultId"\:..,"$secretId"\:..} objects, and keeps secrets out of argv entirely]:path:_files -g "*.json"' \
3181
- '--from-source[Reuse another source'\''s driver JAR, class and URL template]:name' \
3182
- '--java-path[Java runtime to use. Machine-local only - never written to the dataset. Also read from POSTMAN_JDBC_JAVA_PATH]:path:_files -g "*.json"' \
3183
- '--no-test[Skip the pre-write connection test. Note that resolving the driver class still starts a JVM — on a machine with no Java, pass --driver-class (or --from-source) too]' \
3184
- '--ssh-target-host-variable[Template variable holding the tunnelled host (inferred when omitted)]:name' \
3185
- '--ssh-target-port-variable[Template variable holding the tunnelled port (inferred when omitted)]:name' \
3186
- '--json[Emit the result as JSON instead of prose]' \
3187
- '--host[DB host (mysql/postgresql/sqlserver)]:host' \
3188
- '--port[DB port (defaults to 1433 for sqlserver)]:port' \
3189
- '--user[DB user. WARNING\: a literal value is visible in `ps` output and shell history, and is stored in clear text in the dataset YAML (local) or sent in the request body (cloud). Prefer a Shared Vault reference.]:user' \
3190
- '--password[DB password. WARNING\: a literal value is visible in `ps` output and shell history, and is stored in clear text in the dataset YAML (local) or sent in the request body (cloud). Prefer a Shared Vault reference.]:password' \
3191
- '--database[DB database name]:db' \
3192
- '--table[DB table to load (required for sqlserver). Leave it out to connect to the whole database; query it with `dataset query -s <source>` or `dataset view create -s <source>`]:table' \
3193
- '--ssh-host[SSH bastion host]:host' \
3194
- '--ssh-port[SSH bastion port]:port' \
3195
- '--ssh-user[SSH bastion user]:user' \
3196
- '--ssh-private-key[Path to the SSH private key. WARNING\: the path is visible in `ps` output and shell history; key contents are read locally at execution time and are not stored in the dataset config.]:filepath:_files -g "*.(pem|crt|key)"' \
3197
- '--ssh-host-key[SSH bastion public host key]:publicKey' \
3198
- '--ssh-host-key-vault-id[Shared Vault ID containing the SSH public host key]:id' \
3199
- '--ssh-host-key-secret-id[Shared Vault secret ID containing the SSH public host key]:id' \
3200
- '--ssh-insecure-skip-host-key-verification[WARNING\: disable SSH host-key verification; use only for trusted local testing]' \
3201
- '--schema[DB schema (postgresql/sqlserver; defaults to dbo for sqlserver)]:schema' \
3202
- '--encrypt[SQL Server TLS encryption (default\: true)]:true|false' \
3203
- '--trust-server-certificate[SQL Server\: skip certificate verification (default\: false; insecure)]:true|false' \
3204
- '--tls-certificate[SQL Server CA/server certificate file path]:path:_files -g "*.(pem|crt|key)"' \
3205
- '--host-name-in-certificate[SQL Server certificate hostname override]:hostname' \
3206
- '--tls-min-version[SQL Server minimum TLS version (default\: 1.2)]:1.2|1.3' \
3207
- '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3208
- '(-h --help)'{-h,--help}'[display help for command]' \
3209
- '*:datasetPathOrId:'
3210
- }
3211
-
3212
- _postman_dataset_source_remove() {
3213
- _arguments \
3214
- '(-d --dataset)'{-d,--dataset}'[Dataset the source belongs to — a local .dataset.yaml path or a cloud dataset id]:datasetPathOrId' \
3215
- '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3216
- '(-h --help)'{-h,--help}'[display help for command]' \
3217
- '*:sourceNameOrId:'
3220
+ _describe -t commands 'secret command' sub
3218
3221
  }
3219
3222
 
3220
- _postman_dataset_source_update() {
3223
+ _postman_secret_create() {
3221
3224
  _arguments \
3222
- '(-d --dataset)'{-d,--dataset}'[Dataset the source belongs to — a local .dataset.yaml path or a cloud dataset id]:datasetPathOrId' \
3223
- '(-n --name)'{-n,--name}'[Rename the source]:name' \
3224
- '--format[Change the format (local dataset only; cloud source formats are immutable). A spreadsheet format is not offered here\: this command changes the format field alone and cannot pin a worksheet, so the source would not compile. Add the workbook with `dataset source add` instead, which makes one worksheet-pinned source per sheet]:csv|json|jdbc|mysql|postgres|sqlserver' \
3225
- '--file[Replace the source file (local dataset only; cloud file replacement is unsupported)]:path:_files -g "*.json"' \
3226
- '--ref-only[With --file, reference in place instead of copying (local dataset only)]' \
3227
- '--force[With --file, overwrite the copied destination (local dataset only)]' \
3228
- '--driver-jar[Replace the JDBC driver JAR(s)]:path...:_files -g "*.json"' \
3229
- '--driver-class[Replace the JDBC driver class]:fqcn' \
3230
- '--driver-name[Rename the JDBC driver type label]:label' \
3231
- '--url-template[Replace the JDBC URL template]:template' \
3232
- '--var[Set a JDBC template variable. Merges onto the existing values. Use vault\:<vaultId>/<secretId> for a secret. WARNING\: a literal value is visible in `ps` output and shell history, and is stored in clear text in the dataset YAML (local) or sent in the request body (cloud). Prefer a Shared Vault reference.]:name=value...' \
3233
- '--prop[Set a JDBC connection property. Merges, same vault\: syntax]:name=value...' \
3234
- '--unset-var[Remove a JDBC template variable. Merging alone can never remove a key]:name...' \
3235
- '--unset-prop[Remove a JDBC connection property]:name...' \
3236
- '--vars-file[JSON object of --var values; "-" reads stdin]:path:_files -g "*.json"' \
3237
- '--ssh-target-host-variable[Template variable holding the tunnelled host (JDBC)]:name' \
3238
- '--ssh-target-port-variable[Template variable holding the tunnelled port (JDBC)]:name' \
3239
- '--java-path[Java runtime for JDBC operations. Machine-local only]:path:_files -g "*.json"' \
3240
- '--host[Update DB host (mysql/postgresql/sqlserver)]:host' \
3241
- '--port[Update DB port]:port' \
3242
- '--user[Update DB user. WARNING\: a literal value is visible in `ps` output and shell history, and is stored in clear text in the dataset YAML (local) or sent in the request body (cloud). Prefer a Shared Vault reference.]:user' \
3243
- '--password[Update DB password. WARNING\: a literal value is visible in `ps` output and shell history, and is stored in clear text in the dataset YAML (local) or sent in the request body (cloud). Prefer a Shared Vault reference.]:password' \
3244
- '--database[Update DB database name]:db' \
3245
- '--table[Update the DB table to load. A source without a table connects to the whole database; query it with `dataset query -s <source>` or `dataset view create -s <source>`]:table' \
3246
- '--ssh-host[Update SSH bastion host]:host' \
3247
- '--ssh-port[Update SSH bastion port]:port' \
3248
- '--ssh-user[Update SSH bastion user]:user' \
3249
- '--ssh-private-key[Update the SSH private-key file path. WARNING\: the path is visible in `ps` output and shell history; key contents are read locally and are not stored in the dataset config.]:filepath:_files -g "*.(pem|crt|key)"' \
3250
- '--ssh-host-key[Update the SSH bastion public host key]:publicKey' \
3251
- '--ssh-host-key-vault-id[Update the Shared Vault ID containing the SSH public host key]:id' \
3252
- '--ssh-host-key-secret-id[Update the Shared Vault secret ID containing the SSH public host key]:id' \
3253
- '--ssh-insecure-skip-host-key-verification[WARNING\: disable SSH host-key verification; use only for trusted local testing]' \
3254
- '--schema[Update DB schema (postgresql/sqlserver)]:schema' \
3255
- '--encrypt[Update SQL Server TLS encryption]:true|false' \
3256
- '--trust-server-certificate[Update SQL Server certificate verification (true is insecure)]:true|false' \
3257
- '--tls-certificate[Update SQL Server CA/server certificate file path]:path:_files -g "*.(pem|crt|key)"' \
3258
- '--host-name-in-certificate[Update SQL Server certificate hostname override]:hostname' \
3259
- '--tls-min-version[Update SQL Server minimum TLS version]:1.2|1.3' \
3260
- '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3261
- '--json[Emit the result as JSON instead of prose]' \
3225
+ '--team-id[Team id (defaults to your authenticated profile'\''s team; must be your own team — the vault rejects any other team id, even one you otherwise have access to)]:id' \
3226
+ '(-w --workspace)'{-w,--workspace}'[Postman workspace ID (falls back to .postman/resources.yaml or .postman/config.json)]:workspaceId' \
3227
+ '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
3228
+ '--terminal[Enter one secret value through the terminal instead of the default browser form]' \
3229
+ '--value-stdin[Read the secret value from stdin instead of prompting; implies --terminal]' \
3230
+ '--timeout[Seconds to wait for the browser form (default 300)]:seconds' \
3262
3231
  '(-h --help)'{-h,--help}'[display help for command]' \
3263
- '*:sourceNameOrId:'
3232
+ '*:keys...:_files -g "*.json"'
3264
3233
  }
3265
3234
 
3266
- _postman_dataset_source_test() {
3235
+ _postman_secret_list() {
3267
3236
  _arguments \
3268
- '(-d --dataset)'{-d,--dataset}'[Dataset the source belongs to — a local .dataset.yaml path or a cloud dataset id]:datasetPathOrId' \
3269
- '(-n --name)'{-n,--name}'[Source to test]:name' \
3270
- '--java-path[Java runtime to use for a JDBC source. Machine-local only; also read from POSTMAN_JDBC_JAVA_PATH]:path:_files -g "*.json"' \
3271
- '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3272
- '--json[Emit the result as JSON instead of prose]' \
3237
+ '(-w --workspace)'{-w,--workspace}'[Postman workspace ID (falls back to .postman/resources.yaml or .postman/config.json)]:workspaceId' \
3238
+ '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
3239
+ '--json[Print the list as machine-readable JSON.]' \
3273
3240
  '(-h --help)'{-h,--help}'[display help for command]'
3274
3241
  }
3275
3242
 
3276
- _postman_dataset_view() {
3243
+ _postman_simulation() {
3277
3244
  local context state state_descr line
3278
3245
  typeset -A opt_args
3279
3246
  _arguments -C \
3280
3247
  '(-h --help)'{-h,--help}'[display help for command]' \
3281
- '1: :_postman_dataset_view_commands' \
3248
+ '1: :_postman_simulation_commands' \
3282
3249
  '*::arg:->args'
3283
3250
  case $state in
3284
3251
  args)
3285
3252
  case $words[1] in
3286
- list) _postman_dataset_view_list ;;
3287
- run) _postman_dataset_view_run ;;
3288
- create) _postman_dataset_view_create ;;
3289
- delete) _postman_dataset_view_delete ;;
3290
- update) _postman_dataset_view_update ;;
3253
+ create) _postman_simulation_create ;;
3254
+ list) _postman_simulation_list ;;
3255
+ get) _postman_simulation_get ;;
3256
+ run) _postman_simulation_run ;;
3257
+ push) _postman_simulation_push ;;
3258
+ deploy) _postman_simulation_deploy ;;
3259
+ update) _postman_simulation_update ;;
3260
+ log) _postman_simulation_log ;;
3261
+ delete) _postman_simulation_delete ;;
3291
3262
  esac
3292
3263
  ;;
3293
3264
  esac
3294
3265
  }
3295
3266
 
3296
- _postman_dataset_view_commands() {
3267
+ _postman_simulation_commands() {
3297
3268
  local -a sub
3298
3269
  sub=(
3299
- 'list:List the saved views defined on a dataset (local YAML path or cloud id).'
3300
- 'run:Execute a saved view against a dataset and print the rows.'
3301
- 'create:Add a saved view to a dataset (local YAML path or cloud id).'
3302
- 'delete:Remove a saved view from a dataset (local YAML path or cloud id).'
3303
- 'update:Update name and/or query on an existing view (local YAML path or cloud id).'
3270
+ 'create:Create a simulation that serves several mocks behind one address'
3271
+ 'list:List the simulations in your repository or Postman cloud workspace'
3272
+ 'get:Show a simulation'\''s details using its .sim.yaml path if it lives in your repository, or its id if it lives in Postman cloud.'
3273
+ 'run:Serve a simulation'\''s mocks on one local port, routing each by its routeKey. Pass a .sim.yaml path (local) or a Postman simulation id (fetched and run locally).'
3274
+ 'push:Upload a simulation from your repository to Postman cloud (creates it the first time, updates it after). Its member mocks are pushed too.'
3275
+ 'deploy:Turn a simulation in Postman cloud into a live mock server others can call over the internet.'
3276
+ 'update:Change a simulation in place — rename it, switch routing, add mocks, or change a member'\''s address. Pass a .sim.yaml path (repository) or a Postman simulation id (cloud).'
3277
+ 'log:Show the requests a deployed simulation has received and the responses it sent, using its mock server id.'
3278
+ 'delete:Delete a simulation using its .sim.yaml path if it lives in your repository, or its id if it lives in Postman cloud. Cannot be undone.'
3304
3279
  )
3305
- _describe -t commands 'view command' sub
3280
+ _describe -t commands 'simulation command' sub
3306
3281
  }
3307
3282
 
3308
- _postman_dataset_view_list() {
3283
+ _postman_simulation_create() {
3309
3284
  _arguments \
3310
- '(-d --dataset)'{-d,--dataset}'[Dataset whose views to list — a local .dataset.yaml path or a cloud dataset id]:datasetPathOrId' \
3311
- '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3312
- '--json[Output views as JSON instead of a table]' \
3285
+ '(-n --name)'{-n,--name}'[Name for the simulation]:name' \
3286
+ '--mock[A mock to include (repeatable). Use a local mock path to build the simulation in your repository, or a Postman mock id to create it in Postman cloud. Set its address with <mockIdOrPath>=<routeKey>. (default\: \[\])]:mockIdOrPath:_files -g "*.json"' \
3287
+ '--routing[How callers reach each mock\: header or path (default path)]:header|path' \
3288
+ '(-o --output)'{-o,--output}'[Where to save the simulation file in your repository, a file or folder (defaults to postman/simulations)]:path:_files -g "*.json"' \
3289
+ '--force[Overwrite the simulation file if it already exists]' \
3290
+ '(-w --workspace)'{-w,--workspace}'[Postman cloud workspace to create the simulation in, by id (defaults to the workspace already linked to this project)]:id' \
3291
+ '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3313
3292
  '(-h --help)'{-h,--help}'[display help for command]'
3314
3293
  }
3315
3294
 
3316
- _postman_dataset_view_run() {
3295
+ _postman_simulation_list() {
3296
+ _arguments \
3297
+ '(-w --workspace)'{-w,--workspace}'[Postman cloud workspace whose simulations to list, by id (defaults to the workspace already linked to this project)]:id' \
3298
+ '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3299
+ '--json[Print the list as machine-readable data instead of a table]' \
3300
+ '(-h --help)'{-h,--help}'[display help for command]' \
3301
+ '*:pathOrDir:_files -g "*.json"'
3302
+ }
3303
+
3304
+ _postman_simulation_get() {
3305
+ _arguments \
3306
+ '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3307
+ '--json[Print the details as machine-readable data instead of a table]' \
3308
+ '(-h --help)'{-h,--help}'[display help for command]' \
3309
+ '*:simIdOrPath:'
3310
+ }
3311
+
3312
+ _postman_simulation_run() {
3313
+ _arguments \
3314
+ '(-e --environment)'{-e,--environment}'[Path to a file of environment variables for the mocks (relative or absolute)]:path:_files -g "*.json"' \
3315
+ '(-g --globals)'{-g,--globals}'[Path to a file of global variables for the mocks (relative or absolute)]:path:_files -g "*.json"' \
3316
+ '(-p --port)'{-p,--port}'[Port to serve on (e.g. 4010), or "auto" for a free one (default 3000)]:port' \
3317
+ '--dataset[Dataset file or folder to load for pm.datasets (repeatable) (default\: \[\])]:pathOrDir:_files -g "*.json"' \
3318
+ '(-w --workspace)'{-w,--workspace}'[Workspace for recording start history. Derived from a simulation id or the linked project; needed only for an unlinked .sim.yaml path.]:id' \
3319
+ '--simulation[Simulation id to record start history against for a .sim.yaml path (a local file has only a name). Not needed when running by simulation id, or when the file is linked to a cloud simulation (via workspace push).]:id' \
3320
+ '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3321
+ '--no-history[Do not record this run in the simulation'\''s start history]' \
3322
+ '--output[Live output format\: auto (default, human-readable logs) or ndjson (one JSON event per line on stdout, ending with a "summary" event — for CI or other non-interactive use) (default\: "auto")]:format' \
3323
+ '--proxy[Serve the mocks behind a local HTTP(S) forward proxy instead of one routed port, so a repo under test can point HTTP_PROXY/HTTPS_PROXY at it and reach each mock by hostname without code changes. Requires a simulation.yaml (routing config), not a .sim.yaml.]' \
3324
+ '--proxy-port[Port for the proxy server. Distinct from --port, which is the one-port run'\''s own port. (default\: 7001)]:n' \
3325
+ '--scenario[Scenario each mock serves, sent as both pm-mock-scenario and x-mock-scenario. (default\: "default")]:name' \
3326
+ '--session[Session id to select via the x-mock-session header (default\: a generated id).]:id' \
3327
+ '--log-format[Proxy request log format\: text or json. (default\: "text")]:format' \
3328
+ '--log-body[Also log each response body (truncated). Buffers full responses in memory; meant for temporary debugging, not left on by default.]' \
3329
+ '--doctor[Start the proxy, probe each available HTTP client (fetch/undici/axios/node-fetch) to confirm it honors HTTP_PROXY/HTTPS_PROXY, then exit.]' \
3330
+ '(-h --help)'{-h,--help}'[display help for command]' \
3331
+ '*:simIdOrPath:'
3332
+ }
3333
+
3334
+ _postman_simulation_push() {
3335
+ _arguments \
3336
+ '(-w --workspace)'{-w,--workspace}'[Postman cloud workspace to upload to, by id (defaults to the workspace already linked to this project)]:id' \
3337
+ '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3338
+ '(-h --help)'{-h,--help}'[display help for command]' \
3339
+ '*:simPath:'
3340
+ }
3341
+
3342
+ _postman_simulation_deploy() {
3317
3343
  _arguments \
3318
- '(-d --dataset)'{-d,--dataset}'[Dataset the view belongs to — a local .dataset.yaml path or a cloud dataset id]:datasetPathOrId' \
3319
- '(-p --param)'{-p,--param}'[Bind values to $1, $2, ... in order; pass multiple values after -p or repeat -p]:value...' \
3320
- '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3321
- '--json[Output rows as JSON instead of a table]' \
3322
- '--debug[Include safe classified dataset diagnostics]' \
3344
+ '(-w --workspace)'{-w,--workspace}'[Postman cloud workspace that will own the server, by id (defaults to the workspace already linked to this project)]:id' \
3345
+ '(-n --name)'{-n,--name}'[Name for the mock server (you are asked for one if you skip this)]:name' \
3346
+ '(-s --slug)'{-s,--slug}'[Short label used in the server'\''s web address, e.g. "my-sim" (you are asked for one if you skip this)]:slug' \
3347
+ '--private[Require a Postman API key to reach the server. Public by default.]' \
3348
+ '(-y --yes)'{-y,--yes}'[Use the defaults and skip all questions (public)]' \
3349
+ '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3323
3350
  '(-h --help)'{-h,--help}'[display help for command]' \
3324
- '*:viewNameOrId:'
3351
+ '*:simId:'
3325
3352
  }
3326
3353
 
3327
- _postman_dataset_view_create() {
3354
+ _postman_simulation_update() {
3328
3355
  _arguments \
3329
- '(-d --dataset)'{-d,--dataset}'[Dataset to add the view to — a local .dataset.yaml path or a cloud dataset id]:datasetPathOrId' \
3330
- '(-n --name)'{-n,--name}'[View name]:name' \
3331
- '(-q --query)'{-q,--query}'[SQL query the view executes]:sql' \
3332
- '(-s --source)'{-s,--source}'[Bind the view to one datasource and run the query natively against it, instead of through the federated SQLite layer. Same reference `dataset query -s` takes]:nameOrIdOrSlug' \
3333
- '--view-id[Override the generated view id (local only; cloud assigns its own)]:uuid' \
3334
- '--json[Emit the result as JSON instead of prose]' \
3335
- '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3336
- '(-h --help)'{-h,--help}'[display help for command]'
3356
+ '(-n --name)'{-n,--name}'[Rename the simulation]:name' \
3357
+ '--routing[Switch routing\: header or path]:header|path' \
3358
+ '--add-mock[Attach a mock (repeatable). A local mock path for a repository simulation, a Postman mock id for a cloud one. Set its address with <mockIdOrPath>=<routeKey>. (default\: \[\])]:mockIdOrPath:_files -g "*.json"' \
3359
+ '--route-key[Change a member mock'\''s address (repeatable), e.g. ./postman/mocks/payments=payments (default\: \[\])]:mockIdOrPath=routeKey:_files -g "*.(pem|crt|key)"' \
3360
+ '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3361
+ '--json[Print the update as machine-readable data instead of a table]' \
3362
+ '(-h --help)'{-h,--help}'[display help for command]' \
3363
+ '*:simIdOrPath:'
3337
3364
  }
3338
3365
 
3339
- _postman_dataset_view_delete() {
3366
+ _postman_simulation_log() {
3340
3367
  _arguments \
3341
- '(-d --dataset)'{-d,--dataset}'[Dataset the view belongs to — a local .dataset.yaml path or a cloud dataset id]:datasetPathOrId' \
3342
- '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3368
+ '--mock[Show only requests served by this member (by routeKey). Repeat the flag for several members (default\: \[\])]:routeKey' \
3369
+ '--limit[Most entries to show (defaults to 50 when printing machine-readable output)]:n' \
3370
+ '--method[Show only requests of this type (e.g. GET, POST)]:method' \
3371
+ '--status[Show only these response codes (e.g. 404, or 5xx for any 500-series)]:code|range' \
3372
+ '--path[Show only requests to matching addresses (use * and ? as wildcards, e.g. /users/*)]:pattern' \
3373
+ '--since[Show entries from this long ago until now (e.g. 2h = the last 2 hours)]:duration' \
3374
+ '--until[Hide entries newer than this (e.g. 30m = skip the most recent 30 minutes)]:duration' \
3375
+ '--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3376
+ '--json[Print entries as machine-readable data instead of the scrollable view]' \
3343
3377
  '(-h --help)'{-h,--help}'[display help for command]' \
3344
- '*:viewNameOrId:'
3378
+ '*:mockServerId:_files -g "*.json"'
3345
3379
  }
3346
3380
 
3347
- _postman_dataset_view_update() {
3381
+ _postman_simulation_delete() {
3348
3382
  _arguments \
3349
- '(-d --dataset)'{-d,--dataset}'[Dataset the view belongs to — a local .dataset.yaml path or a cloud dataset id]:datasetPathOrId' \
3350
- '(-n --name)'{-n,--name}'[New view name]:name' \
3351
- '(-q --query)'{-q,--query}'[New SQL query]:sql' \
3352
- '--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3383
+ '(-y --yes)'{-y,--yes}'[Delete without asking for confirmation first]' \
3384
+ '--api-key[Postman API key, used with a Postman cloud id (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
3353
3385
  '(-h --help)'{-h,--help}'[display help for command]' \
3354
- '*:viewNameOrId:'
3386
+ '*:simIdOrPath:'
3355
3387
  }
3356
3388
 
3357
- _postman_dataset_jdbc() {
3389
+ _postman_team() {
3358
3390
  local context state state_descr line
3359
3391
  typeset -A opt_args
3360
3392
  _arguments -C \
3361
3393
  '(-h --help)'{-h,--help}'[display help for command]' \
3362
- '1: :_postman_dataset_jdbc_commands' \
3394
+ '1: :_postman_team_commands' \
3363
3395
  '*::arg:->args'
3364
3396
  case $state in
3365
3397
  args)
3366
3398
  case $words[1] in
3367
- inspect) _postman_dataset_jdbc_inspect ;;
3399
+ list) _postman_team_list ;;
3368
3400
  esac
3369
3401
  ;;
3370
3402
  esac
3371
3403
  }
3372
3404
 
3373
- _postman_dataset_jdbc_commands() {
3405
+ _postman_team_commands() {
3374
3406
  local -a sub
3375
3407
  sub=(
3376
- 'inspect:Detect Java, list driver classes, suggest a URL template and read driver properties.'
3408
+ 'list:List the teams inside your organisation.'
3377
3409
  )
3378
- _describe -t commands 'jdbc command' sub
3410
+ _describe -t commands 'team command' sub
3379
3411
  }
3380
3412
 
3381
- _postman_dataset_jdbc_inspect() {
3413
+ _postman_team_list() {
3382
3414
  _arguments \
3383
- '--driver-class[Introspect this class instead of auto-selecting]:fqcn' \
3384
- '--url-template[Use this URL template instead of the one inferred from the JAR filename]:template' \
3385
- '--java-path[Java runtime to use. Machine-local only — never written to a dataset. Also read from POSTMAN_JDBC_JAVA_PATH.]:path:_files -g "*.json"' \
3386
- '--json[Emit the discovery result as JSON]' \
3387
- '(-h --help)'{-h,--help}'[display help for command]' \
3388
- '*:jar...:'
3415
+ '--can-create-workspace[Only list teams you could create a workspace in.]' \
3416
+ '--json[Print the list as machine-readable JSON.]' \
3417
+ '--timeout[Abort the run after this many milliseconds. Defaults to 30000.]:ms' \
3418
+ '(-h --help)'{-h,--help}'[display help for command]'
3389
3419
  }
3390
3420
 
3391
- _postman_dependency() {
3421
+ _postman_update() {
3422
+ _arguments \
3423
+ '--check[Check whether a Postman CLI update is available.]' \
3424
+ '(-h --help)'{-h,--help}'[display help for command]'
3425
+ }
3426
+
3427
+ _postman_webhook() {
3392
3428
  local context state state_descr line
3393
3429
  typeset -A opt_args
3394
3430
  _arguments -C \
3395
3431
  '(-h --help)'{-h,--help}'[display help for command]' \
3396
- '1: :_postman_dependency_commands' \
3432
+ '1: :_postman_webhook_commands' \
3397
3433
  '*::arg:->args'
3398
3434
  case $state in
3399
3435
  args)
3400
3436
  case $words[1] in
3401
- add) _postman_dependency_add ;;
3402
- get) _postman_dependency_get ;;
3403
- list) _postman_dependency_list ;;
3404
- install) _postman_dependency_install ;;
3405
- update) _postman_dependency_update ;;
3406
- remove) _postman_dependency_remove ;;
3437
+ create) _postman_webhook_create ;;
3438
+ start) _postman_webhook_start ;;
3439
+ pause) _postman_webhook_pause ;;
3440
+ list) _postman_webhook_list ;;
3441
+ delete) _postman_webhook_delete ;;
3442
+ status) _postman_webhook_status ;;
3443
+ requests) _postman_webhook_requests ;;
3444
+ scripts) _postman_webhook_scripts ;;
3445
+ forward) _postman_webhook_forward ;;
3407
3446
  esac
3408
3447
  ;;
3409
3448
  esac
3410
3449
  }
3411
3450
 
3412
- _postman_dependency_commands() {
3451
+ _postman_webhook_commands() {
3413
3452
  local -a sub
3414
3453
  sub=(
3415
- 'add:Add a Postman collection, environment, or mock as a workspace dependency.'
3416
- 'get:Show a declared workspace dependency from .postman/resources.yaml.'
3417
- 'list:List the workspace dependencies declared in .postman/resources.yaml.'
3418
- 'install:Materialise the dependencies declared in .postman/resources.yaml (all, or one).'
3419
- 'update:Refresh declared dependencies to the latest content from their source (all, or one).'
3420
- 'remove:Remove a workspace dependency and delete its local files.'
3454
+ 'create:Create a new webhook and print its public URL.'
3455
+ 'start:Activate a webhook so it can receive requests.'
3456
+ 'pause:Pause a webhook so it no longer accepts requests.'
3457
+ 'list:List all webhooks in a workspace.'
3458
+ 'delete:Permanently delete a webhook.'
3459
+ 'status:Show details for a webhook.'
3460
+ 'requests:List, inspect, and replay requests received by a webhook.'
3461
+ 'scripts:Create or update scripts executed by a webhook.'
3462
+ 'forward:Forward incoming webhook requests to a local port.'
3421
3463
  )
3422
- _describe -t commands 'dependency command' sub
3464
+ _describe -t commands 'webhook command' sub
3423
3465
  }
3424
3466
 
3425
- _postman_dependency_add() {
3467
+ _postman_webhook_create() {
3426
3468
  _arguments \
3427
- '(-w --workspace)'{-w,--workspace}'[Workspace id to resolve a name in (defaults to the current workspace).]:id' \
3428
- '(-y --yes)'{-y,--yes}'[Skip all confirmation prompts.]' \
3429
- '--json[Output the result as JSON.]' \
3469
+ '(-t --title)'{-t,--title}'[Name for the webhook (default\: "CLI Webhook")]:title' \
3470
+ '(-w --workspace)'{-w,--workspace}'[Postman workspace ID (falls back to .postman/resources.yaml or .postman/config.json)]:workspaceId' \
3471
+ '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
3472
+ '(-h --help)'{-h,--help}'[display help for command]'
3473
+ }
3474
+
3475
+ _postman_webhook_start() {
3476
+ _arguments \
3477
+ '(-w --workspace)'{-w,--workspace}'[Postman workspace ID]:workspaceId' \
3478
+ '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
3430
3479
  '(-h --help)'{-h,--help}'[display help for command]' \
3431
- '*:nameOrId:'
3480
+ '*:webhookIdOrUrl:'
3432
3481
  }
3433
3482
 
3434
- _postman_dependency_get() {
3483
+ _postman_webhook_pause() {
3435
3484
  _arguments \
3436
- '--type[Only match dependencies of this type (collection, environment, or mock).]:type' \
3437
- '--json[Output the result as JSON.]' \
3485
+ '(-w --workspace)'{-w,--workspace}'[Postman workspace ID]:workspaceId' \
3486
+ '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
3438
3487
  '(-h --help)'{-h,--help}'[display help for command]' \
3439
- '*:nameOrId:'
3488
+ '*:webhookIdOrUrl:'
3440
3489
  }
3441
3490
 
3442
- _postman_dependency_list() {
3491
+ _postman_webhook_list() {
3443
3492
  _arguments \
3444
- '--type[Only list dependencies of this type (collection, environment, or mock).]:type' \
3445
- '--json[Output the result as JSON.]' \
3493
+ '(-w --workspace)'{-w,--workspace}'[Postman workspace ID (falls back to .postman/resources.yaml or .postman/config.json)]:workspaceId' \
3494
+ '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
3446
3495
  '(-h --help)'{-h,--help}'[display help for command]'
3447
3496
  }
3448
3497
 
3449
- _postman_dependency_install() {
3498
+ _postman_webhook_delete() {
3450
3499
  _arguments \
3451
- '--type[Only install dependencies of this type (collection, environment, or mock).]:type' \
3452
- '--json[Output the result as JSON.]' \
3500
+ '(-w --workspace)'{-w,--workspace}'[Postman workspace ID]:workspaceId' \
3501
+ '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
3453
3502
  '(-h --help)'{-h,--help}'[display help for command]' \
3454
- '*:nameOrId:'
3503
+ '*:webhookId:'
3455
3504
  }
3456
3505
 
3457
- _postman_dependency_update() {
3506
+ _postman_webhook_status() {
3458
3507
  _arguments \
3459
- '--type[Only update dependencies of this type (collection, environment, or mock).]:type' \
3460
- '--json[Output the result as JSON.]' \
3508
+ '(-w --workspace)'{-w,--workspace}'[Postman workspace ID]:workspaceId' \
3509
+ '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
3461
3510
  '(-h --help)'{-h,--help}'[display help for command]' \
3462
- '*:nameOrId:'
3511
+ '*:webhookId:'
3463
3512
  }
3464
3513
 
3465
- _postman_dependency_remove() {
3514
+ _postman_webhook_requests() {
3515
+ local context state state_descr line
3516
+ typeset -A opt_args
3517
+ _arguments -C \
3518
+ '(-h --help)'{-h,--help}'[display help for command]' \
3519
+ '1: :_postman_webhook_requests_commands' \
3520
+ '*::arg:->args'
3521
+ case $state in
3522
+ args)
3523
+ case $words[1] in
3524
+ list) _postman_webhook_requests_list ;;
3525
+ describe) _postman_webhook_requests_describe ;;
3526
+ replay) _postman_webhook_requests_replay ;;
3527
+ esac
3528
+ ;;
3529
+ esac
3530
+ }
3531
+
3532
+ _postman_webhook_requests_commands() {
3533
+ local -a sub
3534
+ sub=(
3535
+ 'list:List recent requests received by a webhook.'
3536
+ 'describe:Show details for a request received by a webhook.'
3537
+ 'replay:Replay a request received by a webhook.'
3538
+ )
3539
+ _describe -t commands 'requests command' sub
3540
+ }
3541
+
3542
+ _postman_webhook_requests_list() {
3466
3543
  _arguments \
3467
- '--type[Only match dependencies of this type (collection, environment, or mock).]:type' \
3468
- '(-y --yes)'{-y,--yes}'[Skip the confirmation prompt (required outside an interactive terminal).]' \
3469
- '--json[Output the result as JSON.]' \
3544
+ '(-w --workspace)'{-w,--workspace}'[Postman workspace ID (falls back to .postman/resources.yaml or .postman/config.json)]:workspaceId' \
3545
+ '--cursor[Pagination cursor returned by a previous request list response]:cursor' \
3546
+ '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
3470
3547
  '(-h --help)'{-h,--help}'[display help for command]' \
3471
- '*:nameOrId:'
3548
+ '*:webhookId:'
3472
3549
  }
3473
3550
 
3474
- _postman_secret() {
3551
+ _postman_webhook_requests_describe() {
3552
+ _arguments \
3553
+ '(-w --workspace)'{-w,--workspace}'[Postman workspace ID (falls back to .postman/resources.yaml or .postman/config.json)]:workspaceId' \
3554
+ '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
3555
+ '--verbose[Show script execution logs]' \
3556
+ '(-h --help)'{-h,--help}'[display help for command]' \
3557
+ '*:requestId:'
3558
+ }
3559
+
3560
+ _postman_webhook_requests_replay() {
3561
+ _arguments \
3562
+ '(-w --workspace)'{-w,--workspace}'[Postman workspace ID (falls back to .postman/resources.yaml or .postman/config.json)]:workspaceId' \
3563
+ '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
3564
+ '(-h --help)'{-h,--help}'[display help for command]' \
3565
+ '*:requestId:'
3566
+ }
3567
+
3568
+ _postman_webhook_scripts() {
3475
3569
  local context state state_descr line
3476
3570
  typeset -A opt_args
3477
3571
  _arguments -C \
3478
3572
  '(-h --help)'{-h,--help}'[display help for command]' \
3479
- '1: :_postman_secret_commands' \
3573
+ '1: :_postman_webhook_scripts_commands' \
3480
3574
  '*::arg:->args'
3481
3575
  case $state in
3482
3576
  args)
3483
3577
  case $words[1] in
3484
- create) _postman_secret_create ;;
3485
- list) _postman_secret_list ;;
3578
+ set) _postman_webhook_scripts_set ;;
3486
3579
  esac
3487
3580
  ;;
3488
3581
  esac
3489
3582
  }
3490
3583
 
3491
- _postman_secret_commands() {
3584
+ _postman_webhook_scripts_commands() {
3492
3585
  local -a sub
3493
3586
  sub=(
3494
- 'create:Create a secret in a team'\''s shared vault.'
3495
- 'list:List the secrets in a workspace'\''s shared vault\: key, secret id, vault id, and allowed domains.'
3587
+ 'set:Create or update a webhook script from a JavaScript or TypeScript file.'
3496
3588
  )
3497
- _describe -t commands 'secret command' sub
3589
+ _describe -t commands 'scripts command' sub
3498
3590
  }
3499
3591
 
3500
- _postman_secret_create() {
3592
+ _postman_webhook_scripts_set() {
3501
3593
  _arguments \
3502
- '--team-id[Team id (defaults to your authenticated profile'\''s team; must be your own team — the vault rejects any other team id, even one you otherwise have access to)]:id' \
3594
+ '--event[Script event\: onEvent or onResponse]:event' \
3503
3595
  '(-w --workspace)'{-w,--workspace}'[Postman workspace ID (falls back to .postman/resources.yaml or .postman/config.json)]:workspaceId' \
3504
3596
  '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
3505
- '--terminal[Enter one secret value through the terminal instead of the default browser form]' \
3506
- '--value-stdin[Read the secret value from stdin instead of prompting; implies --terminal]' \
3507
- '--timeout[Seconds to wait for the browser form (default 300)]:seconds' \
3508
3597
  '(-h --help)'{-h,--help}'[display help for command]' \
3509
- '*:keys...:_files -g "*.json"'
3598
+ '*:scriptPath:'
3510
3599
  }
3511
3600
 
3512
- _postman_secret_list() {
3601
+ _postman_webhook_forward() {
3513
3602
  _arguments \
3514
- '(-w --workspace)'{-w,--workspace}'[Postman workspace ID (falls back to .postman/resources.yaml or .postman/config.json)]:workspaceId' \
3603
+ '(-w --workspace)'{-w,--workspace}'[Postman workspace ID]:workspaceId' \
3515
3604
  '--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
3516
- '--json[Print the list as machine-readable JSON.]' \
3517
- '(-h --help)'{-h,--help}'[display help for command]'
3605
+ '(-h --help)'{-h,--help}'[display help for command]' \
3606
+ '*:port:'
3518
3607
  }
3519
3608
 
3520
3609
  # When loaded via fpath + compinit, the file body becomes the function body of