The Postman CLI provides commands for generating client SDKs from Postman Collections and API specifications, and for managing server-side GitHub connections that automatically open or update pull requests on every successful build. To use the commands, install the command-line companion for Postman. You can use it from your command line or Postman terminal.
The postman sdk init command creates or updates the .postman/config.json file with your SDK configuration. For more information, see Create and manage the Postman SDK config file.
Skip prompts and overwrite the existing Postman SDK config file.
Display help for the command.
The postman sdk generate command generates a client SDK from a Postman Collection or API specification. The source can be a Postman entity ID (runs a server-side build), a local file path, or a URL (one-off builds). If you encounter errors, see Generate commands errors and warnings.
When an entity ID is used and a GitHub connection exists (see postman sdk connect), the server automatically opens or updates a pull request after every successful build.
The postman sdk generate command can also be used to regenerate an SDK. When you generate an SDK, the file hashes are written to a manifest file as change tracking is on by default. You can edit the generated files per your requirements. Add, delete, or make changes to existing files, and then run the postman sdk generate command again. The CLI compares file hashes against the manifest to detect the changes and merges them to the regenerated SDK.
To use this command, sign in to Postman with the postman login command. Learn more about common authentication and authorization errors.
Provide one of the following arguments:
Postman Collection ID or Specification ID (UUID format).
File path to a collection (.json) or specification (.json, .yaml, .yml) file.
URL to a publicly accessible collection or specification file.
When using an ID, the SDK generation updates the version in Postman Cloud. The command automatically detects whether the ID is a collection or specification. Only UUIDs are supported (for example, 12345-abcde-67890 or 12345678-1234-1234-1234-123456789012). To get the collection or specification ID, in Postman, click Info in the right sidebar and copy the ID.
When using a file path or URL, the command creates a one-off build that doesn’t update the Postman Cloud version.
Target output(s) for SDK and CLI generation. Specify one or more outputs: typescript, python, java, kotlin, csharp, go, php, ruby, rust, or cli.
Generate SDKs in all supported languages.
Select the directory to save the downloaded SDKs.
Select the name for the generated SDK package.
Select the version number for the generated SDK.
Path to the SDK generation configuration file (JSON).
Skip prompts and overwrite the existing Postman SDK configuration file.
Overwrite existing files without confirmation.
Show detailed generation progress and logs.
Set the build log detail level. warn shows warnings and errors inline. info expands all log entries.
Turn off change tracking. By default, file hashes are written into .manifest.json to enable edit detection on the next regeneration.
Skip custom code merge even if edits are detected, and force a clean regeneration of the SDK that overwrites all files.
Control how the generator handles merge conflicts when you and the generator change the same lines in a file with one of these choices: mark adds conflict markers to the file, ours keeps your changes and discards the generator’s changes, and theirs keeps the generator’s changes and discards yours.
Skip downloading and saving the generated SDK files to the output directory. This is useful in CI when the build only needs to trigger server-side pull requests.
Display help for the command.
You must connect your GitHub repo to trigger server-side builds that automatically open or update pull requests.
The postman sdk track command initializes change tracking for an SDK generated before this feature was available. It computes file hashes and writes them into the existing manifest file. After you run this command, the next time you regenerate an SDK, the CLI detects any changes you made in the generated files and merges them to the regenerated SDK. You must run this command before you make any edits or your changes are lost.
To use this command, sign in to Postman with the postman login command. Learn more about common authentication and authorization errors.
Target output(s) for SDK and CLI generation. Specify one or more outputs: typescript, python, java, kotlin, csharp, go, php, ruby, or cli.
Select the directory to save the downloaded SDKs.
Display help for the command.
The postman sdk list command lists builds for a specific collection. If you encounter errors, see List commands errors.
To use this command, sign in to Postman with the postman login command. Learn more about common authentication and authorization errors.
Postman Collection ID in the 12345-abcde-67890 format.
Filter builds by status with one of these choices: IN_PROGRESS, SUCCESS, or FAILURE.
Select the output format with one of these choices: json or table.
Display help for the command.
The postman sdk fetch command lets you download previously generated SDKs from a build by its ID, so that you can retrieve and use them locally. If you encounter errors, see Get/Fetch commands errors.
To use this command, sign in to Postman with the postman login command. Learn more about common authentication and authorization errors.
Select the directory to save the downloaded SDKs.
Target language(s) for SDK generation. Specify one or more languages for SDK generation: typescript, python, java, kotlin, csharp, go, php, ruby, or rust.
Overwrite existing files without confirmation.
Show detailed generation progress and logs.
Display help for the command.
The postman sdk connect github command connects a Postman Collection or API specification to a GitHub repository. Once a connection exists, every successful postman sdk generate build (by ID) automatically opens or updates a pull request in the target repository.
By default, the server pushes through the installed Postman GitHub App (--auth-provider githubapp). If the server returns an auth error, install the GitHub App from your Postman workspace settings.
If you encounter errors, see Connect commands errors.
Learn how to generate an SDK in a specific language and sync it with your GitHub project.
To use this command, sign in to Postman with the postman login command. Learn more about common authentication and authorization errors.
Postman Collection ID in the 12345-abcde-67890 format.
OAuth provider (only github).
Postman Collection ID or specification ID (UUID).
SDK language.
GitHub repository in <owner>/<name> form (alternative to --repo-owner + --repo-name).
GitHub repository owner (user or org).
GitHub repository name.
Target branch for SDK pull requests.
Push SDK updates directly to the base branch instead of opening a pull request.
Inject a GitHub Actions workflow that publishes to npm on merge (TypeScript only).
OAuth provider used by the server when pushing.
Show extra logging.
Display help for the command.
Use the singular postman sdk connect github command to create a GitHub connection. Use the plural postman sdk connections command group to list or delete existing connections.
The postman sdk connections list command lists all GitHub connections for a given collection or specification. Shows language, target repo, branch, and latest PR status for each connection.
To use this command, sign in to Postman with the postman login command. Learn more about common authentication and authorization errors.
Collection ID or Specification ID (UUID).
Refresh PR statuses from GitHub before listing.
Output raw JSON instead of formatted text.
Show extra logging.
Display help for the command.
The postman sdk connections delete command deletes a GitHub connection by its numeric connection ID.
To use this command, sign in to Postman with the postman login command. Learn more about common authentication and authorization errors.
Collection ID or Specification ID (UUID).
Numeric connection ID to delete (shown in connections list output).
Skip the confirmation prompt.
Show extra logging.
Display help for the command.