> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt. For full content including API reference and SDK examples, see https://learning.postman.com/llms-full.txt.

# Generate SDKs locally and sync with GitHub

Local SDK generation is available on the desktop app only and can also be performed using the Postman CLI.

Generating SDKs locally in a Git-connected workspace enables you to generate SDKs without affecting your public Postman Collections in the Postman Cloud. SDKs are saved directly to your local file system for immediate use, and they automatically appear as code snippet options in your requests. You can also pull SDKs from your cloud collections to your local workspace. This way, you can experiment with SDK generation and test different configurations in a safe, isolated environment.

Before you generate an SDK, review [permissions required to generate SDKs](/docs/sdk-generator/generate/overview/#permissions-required-to-generate-sdks).

To learn how to set up your local workspace and sync it with CI/CD and Postman Cloud, see [About Native Git](/docs/use/native-git/overview/).

## Connect to your GitHub repo

To generate an SDK from a collection in a specific language and sync it with GitHub repo, do the following:

1. Get your collection ID. Click <img alt="Info icon" src="https://assets.postman.com/postman-docs/aether-icons/state-info-stroke-small.svg#icon" width="12px" /> **Info** in the right sidebar and copy the ID.

2. Run the following command in the Postman CLI to connect your collection to your repo for the language of your SDK, in this case TypeScript:

   ```bash
   postman sdk connect github <id> --language typescript
   ```

This action redirects you to the GitHub OAuth sign-in screen and asks for the owner, repo, branch, and folder details. If successfully connected, you get the following message:

`Success: Successfully created integration for <language> with GitHub repo <github repo name>`

1. Run the following command to manually generate and push a given SDK build ID to the configured repo.

   ```bash
   postman sdk generate <id> -l typescript --pr
   ```

   The CLI output will look like this:

   ```bash
   Creating 1 pull request(s)...
   Cloning repository repo/a-test-git-repo...
   Creating branch sdk-update-v1.0.0-1768491618110...
   ✓ Copied 123 file(s) to repository
   Staging changes...
   Committing changes...
   Pushing branch...
   Creating pull request...
   ✓ Pull request created: https://github.com/repo/a-test-git-repo/pull/16
   ```

After you merge your PR, the SDK will be available in GitHub.

## Generate SDKs in local mode

To generate an SDK in local mode, do the following:

1. Ensure you're in **Local**, not **Postman Cloud** view. Check the state in the bottom left of the Postman app. If you're in <img alt="Items cloud icon" src="https://assets.postman.com/postman-docs/aether-icons/v12/icon-descriptive-itemsCloud-stroke.svg#icon" width="20px" /> **Postman Cloud**, click it to switch to **Local**.

   <img alt="Switch to local view" src="https://assets.postman.com/postman-docs/v12/cloud-local-view-v12.02.png" width="280" />

2. Ensure you're in <img alt="Items icon" src="https://assets.postman.com/postman-docs/aether-icons/v12/icon-descriptive-items-stroke.svg#icon" width="20px" /> **Local items**.

   <img alt="Switch to local items" src="https://assets.postman.com/postman-docs/v12/sdk-local-items-v12.png" width="280" />

3. Select the collection or specification for which you want to generate an SDK.

4. Click <img alt="Options icon" src="https://assets.postman.com/postman-docs/aether-icons/v12/icon-action-options-stroke.svg#icon" width="20px" /> **View more actions** and select **More > Generate SDKs**.

5. Select your preferred language (Python, TypeScript, Java, Kotlin, C#, Go, PHP, or all).

6. Click **Generate**.

You can also create one-off SDKs using the `postman sdk generate` command. For more information, see the [command reference and examples](/docs/postman-cli/postman-cli-sdk-gen/#postman-sdk-generate).

Generation time may vary depending on the complexity of your API and the selected programming language.

## Local file system structure

When you generate SDKs locally, they're organized in your file system as follows:

Each SDK folder contains the complete generated SDK code, ready for integration into projects.

## Pull SDKs from Postman Cloud

You can pull existing SDKs from your Postman Cloud collections.

1. In the footer, click <img alt="Stroke icon" src="https://assets.postman.com/postman-docs/aether-icons/v12/icon-downloadFromCloud-stroke.svg#icon" width="20px" /> **Pull from Postman Cloud**.

2. Select the SDKs you want to pull into your local workspace.

   <img alt="Select SDKs" src="https://assets.postman.com/postman-docs/v12/pull-sdks-v12.png" width="280" />

3. Click **Pull from Cloud**.

The SDKs will be downloaded and integrated into your local file system.