> This page is for SDKs, version Current (default).
> For other versions, use one of these documentation indexes:
> - Current (default): https://buildwithfern.com/learn/sdks/current/llms.txt
> - Legacy: https://buildwithfern.com/learn/sdks/legacy/llms.txt

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

# Project structure

> Learn how to structure your SDK project with Fern. Set up multi-repo architecture, configure sdk-config.yml, and organize API definitions.

Before generating SDKs with Fern, set up the proper GitHub repository structure to house your API definitions and SDK code so it's intuitive for you and your users to access, maintain, and update code.

## Repository architecture

Fern recommends a multi-repository structure containing:

* **Source repository** with your API definitions and SDK generation configuration
* **SDK repositories** for each SDK (TypeScript, Python, Go, etc.)

This separation allows you to manage API definitions centrally while keeping each SDK in its own repository for independent versioning and distribution.

> **Examples**
>
> See Cohere's [fern folder](https://github.com/cohere-ai/cohere-developer-experience/tree/23d6c541a01eb6b54dd9bb3588c805bb0e307713/fern) and [TypeScript](https://github.com/cohere-ai/cohere-typescript) and [Python](https://github.com/cohere-ai/cohere-python) SDK repositories.

## Core configuration files

The source repository contains a `fern/` folder  that's initialized with your API definitions and a top-level `sdk-config.yml` file.

### `fern.config.json`

The `fern.config.json` file stores your organization name and the Fern CLI version. Pinning the version provides deterministic builds. To keep every project in your organization on a compatible version, set an [organization-wide CLI version policy](/learn/cli-api-reference/cli-reference/version-policy).

**`fern.config.json`**

```json title="fern.config.json"
{
  "organization": "plant-catalog",
  "version": "5.23.3"
}
```

> **Info**
>
> When working with a locally installed CLI, set `version` to `"*"`. See [Install Fern CLI locally](/learn/cli-api-reference/cli-reference/overview#installation) for details.

### `sdk-config.yml`

The `sdk-config.yml` file declares your API spec location in `source.specs` and lists one target per SDK language in `targets`. Settings at the top level apply to every target, and each target can override them.

**`sdk-config.yml`**

```yaml title="sdk-config.yml"
schemaVersion: sdk-config/v1
sdkName: Plant Store

# API declaration
source:
  specs:
    - id: plant-store
      type: openapi
      path: ./openapi/openapi.yml

# SDK generation
targets:
  - language: typescript
    package:
      packageName: "@plant-store/sdk"
    output:
      delivery: github
      github:
        repository: your-organization/typescript-sdk-repo

  - language: python
    package:
      packageName: plant-store
    output:
      delivery: github
      github:
        repository: your-organization/python-sdk-repo
```

Each language can appear once per file. Generate one target with `fern generate --target typescript`, or every target with `fern generate`.

`delivery: github` targets GitHub repositories only — Fern doesn't push SDKs to GitLab or other providers. The [`sdk-config.yml` reference](/learn/sdks/reference/sdk-config) covers every configuration option.

### API definition file

See [Project structure (API Definitions)](/learn/api-definitions/overview/project-structure) for details on organizing your API definition files and working with multiple APIs.