# Introducing the CLI Generator

*Turn any Open API spec or Postman Collection into a fully-featured command-line tool* Today, we’re excited to announce that Postman users can now easily generate a fully-functioning command-line interface (CLI) application based on their Postman collections or Open API specifications. We’ve designed our CLI with two main end-users in mind: Agents (LLMs) and humans. ## CLI for Agents

 As our world continues to become more AI-centric, CLIs bridge the gap between agents and APIs. These tools allow agents to interact with existing APIs in a myriad of ways in order to query data or run operations, combining these into any imaginable workflow. CLIs are a natural way for AI agents to interact with web services. They abstract away the details that LLMs shouldn’t have to worry about – like crafting the right HTTP request, or managing authentication tokens – and let them focus on getting the data they need. CLIs are truly the SDKs for AI Agents. We’ve included several features to help agents leverage our generated CLIs, including: - An easy to explore CLI, automatically listing which commands and flags are available at each step
- Automatically generating a `--help` flag for each command
- Generated `Skill.md` files, which agents can read to quickly learn about the whole CLI
- Loading credentials from environment files, so the agent can proceed with fewer prompts
 
## CLI for Humans

 By writing a few commands, humans can also leverage CLIs to explore or test their APIs – allowing them to quickly write CI/CD workflows, share commands with others, or even figure out what command they could build next. Similar to agents, they often need help to understand which commands and flags are available. However, there are some features that are most helpful to humans, including: - Interactive passwords prompts for sensitive credentials
- Automatically formatting JSON responses so they’re more readable
- Allowing complex request bodies to be read from a file, using the `–-body-file` flag
 
 In the rest of this post, we’ll showcase some of the main features available in the generated CLIs. To make it easy to illustrate, we’ve generated a CLI based on a made-up music playback API called posttunes ## Getting Started

 Generate CLIs with 3 easy steps. Currently, you can find the CLI generation feature within the same UI as SDK generation: 1. From the Postman App, right-click on a Collection or API Specification → Go to the “More” section → click on “Generate SDK”: ![](https://blog.postman.com/wp-content/uploads/2026/04/Screenshot-2026-04-09-at-3.47.03-PM-scaled.png)
2. Alternatively, click on the plus + button on the left navigation bar and choose “SDK”:![](https://blog.postman.com/wp-content/uploads/2026/04/plus_button-1-scaled.png)
3. From the Generate SDKs screen, choose the CLI option and then click “Generate SDK”:![](https://blog.postman.com/wp-content/uploads/2026/04/generate_sdk-scaled.png)
 
 Alternatively, if you wish to generate it from the Postman CLI, use the following command: `postman sdk generate <collectionId / specId> -l cli` (Where collectionId / specId are the Postman collection / specification identifiers) ## Product Overview

 The generated CLI will include a command for every single endpoint in your API, organized around your URL hierarchy (or alternatively, Open API tags) for Open API specs; for Collections, it will be organized around your folder structure. Each command automatically includes some helpful hints on how to run it. For example, we will see the following response when running the generated posttunes CLI: ```
> posttunes       

posttunes CLI

Usage:

  posttunes [command]

Available Commands:

  albums      Get information about albums

  artists     Get information about artists  

  config      Manage posttunes CLI configuration

  help        Help about any command

  library     

  player      

  setup-auth  Configure authentication credentials

  users       

Flags:

  -h, --help   help for posttunes

Use "posttunes [command] --help" for more information about a command.
```

 Calling the albums command will show you the available operations: ```
> posttunes albums

Usage:

  posttunes albums [command]

Available Commands:

  get                      Get Album

  get-tracks               Get Album Tracks

  get-users-saved-albums   Get User's Saved Albums

Flags:

  -h, --help   help for albums

Use "posttunes albums [command] --help" for more information about a command.

```

 Running a specific operation with the `--help` flag will show users what required and optional parameters are necessary: ```
> posttunes albums get-tracks --help

Get Album Tracks

Usage:

  posttunes albums get-tracks [flags]

Flags:

  -h, --help            help for get-an-albums-tracks

      --id string       The posttunes ID of the album.

      --limit int       The maximum number of items to return. Default: 10. Minimum: 1. Maximum: 50.

      --offset int      The index of the first item to return. Default: 0 (the first item). Use with limit to get the next set of items.
```

### Authentication

 Currently, our CLI generator supports the following authentication mechanisms: 1. Basic Authentication (username and password)
2. API Key
3. OAuth 2.0 (Client Credentials and Authentication Code)
 
 In order to setup your authentication, simply run the `setup-auth` command and it will present you with whatever authentication options are available: ```
> posttunes setup-auth

Configure authentication credentials

Usage:

  posttunes setup-auth [command]

Available Commands:

  oauth       Configure OAuth authentication credentials

Running the oauth authorization-code command will result in the following flow:

> posttunes setup-auth oauth authorization-code

Visit this URL to authorize:

https://accounts.posttunes.com/authorize?client_id=...&redirect_uri=http%3A%2F%2F127.0.0.1%3A8777%2Fcallback&response_type=code&state=...

Waiting for authorization...

Authorization successful!
```

 The above flow will redirect you to login and authorize the user with posttunes in a browser, resulting in an access token you can use to call other endpoints. Note that not all authentication flows require a browser prompt (authorization code is one of the few that does). ### A Skills Directory for AI Agents

 One of the design goals for the CLI generator was to make the resulting tool work as well for AI agents as it does for humans. To that end, every generated CLI includes a `.claude/skills/` directory — a set of structured Markdown documents that describe every command in a machine-readable format. ```
.claude/

└── skills/

   ├── albums/

   │   ├── SKILL.md            ← describes the `albums` command group

   │   ├── get-an-album/

   │   │   └── SKILL.md        ← describes `posttunes albums get-an-album`

   │   └── get-an-albums-tracks/

   │       └── SKILL.md        ← describes `posttunes albums get-an-albums-tracks`

   └── artists/

       ├── SKILL.md

       └── ...
```

 Although an AI agent is able to learn about the CLI by running it, having the Skills documentation has its advantages. Organizing the Skills in small documents (around each operation) allows the LLM to progressively load this information in small batches, and only when needed. This can save on tokens and time, preventing the agent from having to learn about all CLI commands at once. ## Get started today

 Check out the [CLI Generator Documentation](https://learning.postman.com/docs/cli-generator/overview) for more information on getting started. Our team is excited to see what CLIs you will build!