Generate a command-line interface (CLI) tool directly from your Postman Collections or API specifications. The CLI generator creates a Go-based command-line tool that provides terminal access to every operation in your API, complete with authentication, configuration management, and AI agent integration.
The Postman CLI generator transforms your API specifications into a fully functional command-line tool that does the following:
You must have Editor or higher access to the collection or specification to generate a CLI. Viewers can view and download existing CLIs, but they can’t generate new ones. Learn more about Postman roles and permissions.
You can use the Postman CLI or the Postman app to generate your CLI.
Get the collection or specification ID. In Postman, open your collection or specification, then click Show right sidebar on the bottom right to open the right sidebar. Click
Info in the right sidebar and copy the ID to use with the
postman sdk generate command in the next step.
Run the postman sdk generate command with the pasted ID. For example, to generate a CLI, use the following command with your ID and output directory:
Your generated CLI is written to the directory specified by --output-dir (or ./sdks by default).
You can navigate to the generated files from your terminal and build the CLI using go mod tidy, then go build .
Expand Collections or Specifications in the sidebar to select the collection or specification for which you want to generate a CLI.
Click View more actions and select More > Generate SDKs from a collection or specification.
Name your CLI build. You can use the default name or enter a custom one.
Select CLI as your generation type. This will create a Go-based command-line interface with all your API operations.
Generate CLIs using AI. Open the right sidebar and start a new chat. Ask the agent to generate a CLI for you. For example, you can say “Generate a CLI for this collection.”
Click Generate CLI.
Click Download to download the generated CLI as a zip file. The zip file contains the complete CLI source code, which you can build and integrate into your workflow.
The CLI generator creates a complete project structure containing:
To regenerate your CLI or generate new ones with different configurations, click Regenerate SDKs.
You can access your CLIs in the left sidebar. Click SDKs to see all your generated SDKs and CLIs.
After generating your CLI:
setup-auth command for your API.config command.--help to explore available operations.