{"slug": "generating-client-sdks-and-ai-ready-clis-with-postman", "title": "Generating Client SDKs and AI-Ready CLIs with Postman", "summary": "Postman announced new capabilities to generate client SDKs and AI-ready CLIs directly from API collections or OpenAPI specs, enabling developers to create type-safe SDKs in nine languages and CLI SDKs that agentic tools like Claude Code can drive. The feature allows users to generate a TypeScript SDK from a Book API collection, install and run it locally, and build a Go-based CLI SDK for AI agents, streamlining API integration for both human developers and AI tools.", "body_md": "# Generating Client SDKs and AI-Ready CLIs with Postman\n\nPostman can generate a fully documented, type-safe SDK directly from a collection or an OpenAPI spec, in nine languages, and it can also generate a **CLI SDK** that agentic tools like Claude Code can drive on your behalf.\n\nWe’ll work through it end-to-end against a public sample collection so you can follow along even if you don’t have your own API yet. If you’d rather watch it first, here’s the companion video:\n\n## What you’ll do\n\n-\nFork the\n\n**Book API collection** in your own Postman workspace. -\nGenerate a\n\n**TypeScript SDK** from the Book API Collection. -\nA\n\n**CLI workflow** to regenerate the SDK from a terminal. -\nGenerate a\n\n**Go-based CLI SDK** that wraps the same API for Agents. -\n**Claude Code** calling your API through that CLI SDK\n\n## Before you start\n\nYou’ll need:\n\n-\nThe\n\n.**Postman desktop app** -\nA Postman account.\n\n-\n**Node.js + Yarn**(for running the TypeScript SDK). -\n**GoLang** Installed(for building the CLI SDK). -\nThe\n\n**Postman CLI** installed and authenticated. -\nA local Git repo and a GitHub account.\n\n## Step 1 — Create a blank workspace in Postman\n\nFirst, fork [this repository](https://github.com/Postman-Devrel/Book-API) on GitHub and run the following commands to get started.\n\n`yarn install && yarn run dev`\n\nOnce setup, open the Postman Desktop application. In the top-left **Workspaces** menu, click **Create Workspace **and give it a Name(e.g. `Book API Playground`\n\n). Select **Internal** as your Workspace Type. For your Workspace setup, select the **From a Git repository** option and choose the folder of the Book API repo you just cloned.\n\nYou’ll land in your new workspace, connected to your git repository, with the cloned folder opened in the left navigation menu. Postman creates two new directories in this folder:\n\n-\n`.postman/`\n\n(hidden) — internal mapping and metadata. -\n`postman/`\n\n— where generated SDKs and other artifacts will be written.\n\n## Step 2 — Generate the Book API Collection\n\nClick the ask AI button in the right pane of the workbench. This will trigger Agent mode to peruse the codebase in your connected git repository, understand the exposed API endpoints and generate a Postman Collection based off of them.\n\nIn the top navigation menu at the left sidebar, on click on **Local Items. **This is the leftmost cube icon. You will see the generated collections which you can peruse and test against the locally running book API server.\n\n## Step 3 — Generate a TypeScript SDK from the UI\n\nNow the fun part.\n\nIn the left sidebar, click the plus icon beside the search box. Scroll down and select **SDK. **Select a collection, give your SDK a name and select a Typescript as your language, the click the **Generate SDK** button.\n\nOnce the SDK is done generating, you will see a basic setup documentation for the SDK. The SDK should now be available in your local git repository under the ./postman/sdkfolder. You can navigate to the Local Files tab to view or open in your code editor. Alternatively, you can click on the Download SDK button at the top right of the documentation. The folder contains the SDK source, auto-generated docs, and an example/ directory with a runnable sample.\n\nNote:If your Workspace is not connected to a git repo, Postman gives you a zip of the same folder to download and extract wherever you like.\n\n## Step 4 — Install and run the SDK locally\n\nOpen the generated folder in your code editor and install the dependencies. Ensure you have the typerscript subfolder open as this is where the SDK ts code is located. It should look something like `postman/sdks/Collection SDKs/book-api/typescript`\n\nInstall dependencies and build:\n\n`yarn install && yarn build`\n\nOpen `example/src/index.ts`\n\n. It imports the generated SDK, instantiates a client, and calls one of your endpoints. Run the sample code.\n\n`cd example/src &&`\n\n`tsx index.ts`\n\nYou should see a real API response, through a generated client, with zero handwritten HTTP code.\n\n## Step 5 — Automate SDK updates with Postman + GitHub\n\nYou don’t want to regenerate by hand every time the collection changes. Postman can open a pull request against your GitHub repo automatically whenever the underlying collection is updated. This feature is available on the Enterprise plan, and the full reference lives in the [Automated SDK generation docs](https://learning.postman.com/latest-v-12/docs/sdk-generator/examples/auto-pr).\n\nBefore you start, install the [Postman GitHub app](https://github.com/apps/postman) on the GitHub account or organization that owns the target repository.\n\nFrom your collection’s generated SDK documentation page in Postman, click **Publish SDK** in the top right. In the dialog that opens:\n\n-\nClick\n\n**Connect to GitHub**. -\nPick your provider (GitHub or GitHub Enterprise Server) and authenticate if prompted.\n\n-\nSelect the GitHub organization, then choose an existing repository or create a new one (set the owner, name, and visibility).\n\n-\nPick the target branch —\n\n`main`\n\nis the default. -\nClick\n\n**Connect**.\n\nPostman opens an initial pull request containing the complete SDK along with a security scan summary. Review and merge it.\n\nFrom that point on, any change to the Postman collection automatically triggers a new SDK build and a follow-up PR. Postman bumps the SDK version for you and posts a summary comment on the PR describing what changed.\n\n### Optional: distribute via npm\n\nIf you want each merged PR to also publish the SDK to npm, toggle **Distribute SDKs via npm** in the publish settings, then add an NPM_TOKEN GitHub Actions secret with **Read and write** scope for the package. Postman wires the publish step into the generated workflow.\n\nTo stop automated PRs at any time, open the SDK page and click **Disconnect** in the top right.\n\n## Step 6 — Regenerate from the Postman CLI\n\nThe UI is great for the first generation and the auto-PR flow handles the steady state, but for one-off scripts, local experimentation, or non-Enterprise CI you’ll want to use the [Postman CLI](https://blog.postman.com/working-with-the-postman-cli/).\n\n`postman sdk generate --help`\n\nThe flags you’ll reach for most often:\n\n- -l, –language: Target language(s). One or more of typescript, python, java, kotlin, csharp, go, php, ruby, rust, or cli.\n- –all: Generate SDKs in every supported language at once.\n- -o, –output-dir: Where to write the generated SDK.\n- -p, –package-name: Name of the generated package.\n- -v, –version: Version number to stamp on the build.\n- –yes: Skip prompts (useful in scripts).\n- –no-emit: Build server-side without downloading artifacts.\n\nRegenerate the TypeScript SDK from a collection ID into a specific folder:\n\n`postman sdk generate <your-collection-id> \\`\n\n` --language typescript \\`\n\n` --output-dir ./sdk/book-api \\`\n\n` --yes`\n\nGrab the collection ID from the collection URL in Postman, it’s the segment after `/collection/`\n\n.\n\nYou can drop this same command into a shell script, a Makefile, or a non-Enterprise CI job (e.g. a plain GitHub Actions workflow) when you want to roll your own automation instead of using Postman’s built-in publish flow.\n\n## What about CLI SDKs?\n\nThere’s one more language target worth calling out: `cli.`\n\nSelecting it generates a Go-based command line tool that wraps every operation in your collection.\n\nWhy bother? Agentic systems like Claude Code, Codex, and Gemini CLI already interact with APIs the same way they interact with everything else on a developer’s machine, by running terminal commands. They reach for `curl`\n\nand bash scripts because the terminal is the universal interface they already have. A CLI SDK turns *your* API into that same native command-line surface, giving agents the abstraction layer humans get from an SDK without forcing them to invent a new way to talk to your service.\n\nTo try it, open the SDK generator dialog from Step 3 again, toggle on **CLI** (and toggle off other languages if you only want the CLI artifact), give it a name like `book-api-sdk-cli`\n\n, and click **Generate SDK**.\n\nThe generated folder ships with two important pieces:\n\n-\nThe Go source for the CLI binary.\n\n-\nA\n\n`.cl/`\n\nfolder of**skills**—`skill.md`\n\nfiles that tell agents what each command does and how to invoke it. The top-level`skill.md`\n\nacts as an index so agents don’t need to read every subfolder.\n\nBuild and explore it:\n\n`go build`\n\n` ./book-api-sdk-cli health health-check `\n\n`./book-api-sdk-cli --help`\n\nEvery resource in your collection becomes a subcommand group with its own `--help`\n\n(`create-book`\n\n, `delete-book`\n\n, `get-book`\n\n, `list-books`\n\n, `update-book`\n\n).\n\nNow open Claude Code from the same directory and ask, in plain English:\n\nHow many books are in my inventory?\n\nClaude Code reads the index `skill.md`\n\n, picks the matching skill, runs `./book-api-sdk-cli books list`\n\n, and answers from the response. Ask it to *“create a new book titled Atomic Habits by James Clear”* and it calls books create-book with the right flags. The SDK is the abstraction layer, and the CLI is how the agent reaches it.\n\n## Wrapping up\n\nYou now have three ways to ship a Postman-generated SDK, each suited to a different moment in the lifecycle:\n\n-\n**The UI** for the first generation and quick experiments. -\n**The auto-PR flow** for the steady state, so the SDK never drifts from the collection. -\n**The Postman CLI** for scripts, local regeneration, and your own CI.\n\nAnd with the cli target, the same collection becomes an interface that agentic tools can drive directly with no bespoke tool definitions, just commands.\n\nThe collection is the source of truth. Everything downstream(typed clients, docs, the agent-ready CLI) regenerates from it. Fork the [Book API collection](https://www.postman.com/devrel/workspace/book-api-playground), point it at your own API when you’re ready, and let the generators do the rest.", "url": "https://wpnews.pro/news/generating-client-sdks-and-ai-ready-clis-with-postman", "canonical_source": "https://blog.postman.com/generating-client-sdks-and-ai-ready-clis-with-postman/", "published_at": "2026-06-04 15:00:53+00:00", "updated_at": "2026-06-24 01:13:45.224346+00:00", "lang": "en", "topics": ["developer-tools", "generative-ai", "ai-agents"], "entities": ["Postman", "Claude Code", "TypeScript", "Go", "Node.js", "GitHub", "Book API"], "alternates": {"html": "https://wpnews.pro/news/generating-client-sdks-and-ai-ready-clis-with-postman", "markdown": "https://wpnews.pro/news/generating-client-sdks-and-ai-ready-clis-with-postman.md", "text": "https://wpnews.pro/news/generating-client-sdks-and-ai-ready-clis-with-postman.txt", "jsonld": "https://wpnews.pro/news/generating-client-sdks-and-ai-ready-clis-with-postman.jsonld"}}