# Local Ontology SDKs TypeScript v2 and Python functions support a **local Ontology SDK**, where the OSDK is automatically generated from your resource imports rather than manually versioned and installed as a separate package. This means SDK types are always up-to-date with the latest resource imports. Local SDKs are required for full [Global Branching](../../global-branching/overview/index.md) support. ## Set up a new local SDK If this is your first time creating a local SDK for your repository, follow the steps below: 1. Open the **Resources** side panel in Code Repositories or VS Code. 2. From the bottom right corner of the panel, choose **Select**. A **Modify Import Resources** tab will open in your code editor. 3. Select an available Ontology from the dropdown menu. 4. From the side panel, choose the object types, link types, interface types, and other entities to import. ![The Resources side panel showing the Ontology and package name selection.](../../../assets/91ceda33e7da701c9d7b08b4117b22c80a3c72b6057c1fbe661f5b80ba66dc85.webp) As you add entities from the Ontology, the SDK will automatically update to a new version and code bindings will generate within your repository. You can then import Ontology entities from the SDK package and use them in your function signatures. When you tag a version of your function, the SDK is generated in CI and bundled with your function version, reflecting the state of the Ontology at the time of tagging. ## Generate the SDK from the command line If you are not using VS Code, you can generate and regenerate the local SDK using the `./rune` command line tool. First, prepare the development environment: ```bash ./rune env prepare ``` To generate the SDK for the first time, provide a package name: ```bash ./rune sdk generate --sdk-package-name ontology ``` The package name determines the import path for Ontology entities in your code (for example, `import { MyObjectType } from "@ontology/sdk"`). You can choose any package name, but `ontology` is the default convention. To regenerate the SDK after changing your resource imports: ```bash ./rune sdk generate ``` If `./rune` is missing from your repository, run `.palantir-scripts/install-rune` to install it. ## Migrate an existing repository to a local SDK To migrate a repository from a standalone SDK to a local SDK: 1. Find the `functions.json` file in your repository, then set `useSdkSidebar` to `false`. 2. Navigate to the **Resources** side panel. Select **Migrate** at the top to generate a local SDK and commit the auto-generated changes. For TypeScript v2, this updates your `package.json` and `package-lock.json` files. For Python, this updates your `meta.yaml` and `hawk.lock` files. ![The Resources side panel showing the migrate to local SDK button.](../../../assets/312bb41f90e4d85b921d721e6cfd33239b3dfa30b01dbba2a04f055951deac56.webp)