> This page is for SDKs, version Legacy.
> 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.

> **You're viewing the legacy SDK docs**
>
> These pages cover SDK generation configured with `generators.yml`. New projects use `sdk-config.yml`, so see [the Current version of this page](/learn/sdks/overview/quickstart) for up-to-date guidance. To move an existing project, follow the [SDK Config migration guide](/learn/sdks/legacy/generators/migration-guides/sdk-config), which walks through `fern sdk migrate`, and review the [`sdk-config.yml` reference](/learn/sdks/reference/sdk-config).

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

`generators.yml` lives at `fern/generators.yml` and references your OpenAPI spec through its `api.specs` section — the spec isn't copied into the `fern` folder. This matters when referencing file paths later.

#### Validate your API definition

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

```bash
fern check
```

#### Generate

`fern init` includes a TypeScript SDK generator by default. Run `fern generate` to see it in action:

```bash
fern generate
```

`fern generate` with no flags runs the `default-group` in `generators.yml`. The default init sets up a TypeScript SDK generator outputting to `local-file-system` at `../sdks/typescript`. 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/legacy/generators/typescript/quickstart#set-up-github-repositories)

Set up GitHub, publish to npm, and more.

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

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

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

Understand the Fern SDK generation pipeline.

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

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