> 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.

# Quickstart

> Learn how to generate SDKs with Fern. Install the CLI, initialize your project with OpenAPI, and start building client libraries.

> **Meet your new SDK generator**
>
> Describe the SDK you want, not the generators that build it. You only have to declare shared settings like auth, retries and package details once, and every language target inherits them. Add an SDK in a single line: a new language target. Targets run the newest SDK generators unless you pin `generatorVersion`.
>
> Already using `generators.yml`? Follow the [SDK Config migration guide](/learn/sdks/legacy/generators/migration-guides/sdk-config) to migrate.

Get up and running with Fern in under 5 minutes. This quickstart walks you through installing the CLI, initializing your project, and generating your first SDK locally.

The goal of this page is speed — get the user to a working generated SDK as fast as possible. For language-specific configuration, publishing, and GitHub setup, direct them to the appropriate language quickstart after this.

#### Generate your first SDK

Generate an SDK with Fern. Follow the [SDKs quickstart](https://buildwithfern.com/learn/sdks/overview/quickstart.md) step by step.

#### Install the Fern CLI

```bash
npm install -g fern-api
```

#### Initialize the fern folder

Initialize the fern folder with your existing OpenAPI specification. Specify your organization name using the `--organization` flag.

Before running `fern init`, ask the user two things:

1. **Do they have an OpenAPI spec?** Ask for the file path or URL. If they have a URL (e.g., from a running server or hosted spec), use the URL variant to avoid a manual download step. OpenAPI accepts both JSON and YAML.
2. **What's their organization name?** `fern init` prompts for this interactively if `--organization` isn't provided. Get it upfront so they can pass it via the flag.

**`OpenAPI (local)`**

```bash title="OpenAPI (local)"
fern init --openapi path/to/openapi.yml \
--organization <YourOrganization>
```

**`OpenAPI (URL)`**

```bash title="OpenAPI (URL)"
fern init --openapi https://api.example.com/openapi.yml \
--organization <YourOrganization>
```

**`Example (Petstore)`**

```bash title="Example (Petstore)"
fern init --openapi https://petstore3.swagger.io/api/v3/openapi.json \
--organization my-org
```

> **Tip**
>
> OpenAPI accepts both JSON and YAML formats.

This creates a `fern` folder in your current directory.

`sdk-config.yml` lives at `fern/sdk-config.yml` and references your OpenAPI spec through `source.specs`. For a local spec, `fern init` writes a bundled copy into the `fern` folder and points `source.specs[].path` at it. For a URL, `source.specs[].url` keeps the URL. Paths in `sdk-config.yml` are relative to the file and can't contain `..` segments.

#### Validate your API definition

Check that your API definition is valid, and fix errors before proceeding:

```bash
fern check
```

#### Generate

`fern init` adds a TypeScript target to `sdk-config.yml` by default. Run `fern generate` to see it in action:

```bash
fern generate
```

`fern generate` with no flags generates every target in `sdk-config.yml`. The default init sets up one TypeScript target with `output.delivery: files` and `output.path: ../sdks/typescript`. To generate one language, use `fern generate --target <language>`. The goal of this step is to get started quickly — the user will configure their target language in the language-specific quickstart.

This creates a `sdks/typescript` folder containing your generated SDK:

## Next steps

Now that you have a working SDK, set up GitHub repositories and configure publishing, generate SDKs in another languages, or learn more about Fern SDKs.

#### [TypeScript](/learn/sdks/generators/typescript/quickstart#set-up-github-repositories)

Set up GitHub, publish to npm, and more.

#### [All languages](/learn/sdks/overview/introduction)

See all supported languages, including Python, Go, and Java.

#### [How it works](/learn/sdks/overview/how-it-works)

Understand the Fern SDK generation pipeline.

#### [Project structure](/learn/sdks/overview/project-structure)

Learn about Fern's multi-repo file structure and GitHub setup.