SDK CLI commands
The Postman CLI enables you to generate, download, sync, list, and configure SDKs directly from your Postman entities. To use the commands, install the command-line companion for Postman. You can use it from your command line or Postman terminal.
postman sdk init
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.
Usage
Options
Skip prompts and overwrite the existing Postman SDK config file.
Display help for the command.
postman sdk generate
The postman sdk generate command generates a new SDK from a Postman collection or specification. This action downloads the generated SDKs and unzips them into the output directory or GitHub repo, if connected. If you encounter errors, see Generate commands errors and warnings.
Usage
One of the following:
- A Postman Collection ID or Specification ID (UUID format).
- A file path to a collection (.json) or specification (.json, .yaml, .yml) file.
- A 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.
Options
Target language(s) for SDK generation. Specify one or more languages for SDK generation: typescript, python, or java.
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 config file (JSON).
Skip prompts and overwrite the existing Postman SDK config file.
Show detailed generation progress and logs.
Create a pull request to the GitHub SDK output repo with the generated SDK.
Display help for the command.
Examples
Generate a TypeScript SDK from a collection ID
Generate a TypeScript SDK from a specification ID
Generate a one-off SDK build from a collection file
Generate a one-off SDK build from a specification file
Generate a one-off SDK build from a publicly accessible URL
Generate SDKs in TypeScript and Python
Generate SDKs in all supported languages
Generate and auto-overwrite the existing SDKs
Verbose generation
Show detailed generation progress and logs
Generate and push an SDK build to your repo
You must connect your GitHub repo to be able to push your SDK builds to it.
postman sdk list
The postman sdk list command lists builds for a specific collection. If you encounter errors, see List commands errors.
Usage
Postman Collection ID in the 12345-abcde-67890 format.
Options
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.
Examples
List all builds for a collection
List only successful builds
List in-progress builds
List failed builds
Output as JSON
postman sdk fetch
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.
Usage
Options
Select the directory to save the downloaded SDKs.
Target language(s) for SDK generation. Specify one or more languages for SDK generation: typescript, python, or java.
Overwrite existing files without confirmation.
Show detailed generation progress and logs.
Display help for the command.
Examples
Download SDKs from a build
Download SDKs to a specific directory
Overwrite the existing files
Download SDKs in a specific language
Download SDKs in several languages
postman sdk connect github
The postman sdk connect github command creates a Git integration that allows you to sync your generated SDK with your GitHub repo. 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.
Usage
Postman Collection ID in the 12345-abcde-67890 format.
Options
Target language(s) for SDK generation. Specify one or more languages for SDK generation: typescript, python, or java.
If the system is unable to identify the workspace the collection is tied to, pass a workspace ID.
Display help for the command.