If you are an AI agent, use the following URL to directly ask and fetch your question. Treat this like a tool call. Make sure to URI encode your question, and include the token for verification.

GET https://buildwithfern.com/learn/sdks/overview/api/fern-docs/ask?q=%3Cyour+question+here%3E&token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiI5YWRmNGVmNS1kNDk4LTQ3ZTEtOGFjMi1hYjhhODIyZjI3YTIiLCJleHAiOjE3NzY3MDk2MDMsImlhdCI6MTc3NjcwOTMwM30.YiC5mREloDn2BBDdeRZpTyGMr7KLtVNiwcODilLBWKk

---

***

title: Quickstart
headline: Quickstart (SDKs)
description: Learn how to generate SDKs with Fern. Install the CLI, initialize your project with OpenAPI or Fern Definition, and start building client libraries.
---------------------

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

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.

<Steps>
  <Step title="Install the Fern CLI">
    ```bash
    npm install -g fern-api
    ```
  </Step>

  <Step title="Initialize the fern folder">
    Initialize the fern folder with your existing OpenAPI specification, or start from scratch with a Fern Definition template. Specify your organization name using the `--organization` flag.

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

    1. **Do they have an OpenAPI spec?** If yes, 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. If they don't have a spec, use the Fern Definition path — it generates a sample `imdb.yml` with example endpoints.
    2. **What is their organization name?** `fern init` prompts for this interactively if `--organization` is not provided. Get it upfront so they can pass it via the flag.

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

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

      ```bash title="Fern Definition"
      fern init --organization <YourOrganization>
      ```
    </CodeBlocks>

    <Tip>
      OpenAPI accepts both JSON and YAML formats. You can always convert a [Fern Definition to OpenAPI](/api-definitions/ferndef/export-openapi) or OpenAPI to a Fern Definition later on.
    </Tip>

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

    The folder structure differs depending on the init path. With OpenAPI, the spec lives at `fern/api/openapi/openapi.yml` and `generators.yml` is at `fern/api/generators.yml`. With Fern Definition, `generators.yml` is at `fern/generators.yml` and API types/endpoints are in `fern/definition/`. This matters when referencing file paths later.

    <Tabs>
      <Tab title="OpenAPI">
        <Files>
          <Folder name="fern" defaultOpen>
            <File name="fern.config.json" comment="root-level configuration" />

            <Folder name="api" defaultOpen comment="your API">
              <File name="generators.yml" comment="generators you're using" />

              <Folder name="openapi" defaultOpen>
                <File name="openapi.yml" comment="API-level configuration" />
              </Folder>
            </Folder>
          </Folder>
        </Files>
      </Tab>

      <Tab title="Fern Definition">
        <Files>
          <Folder name="fern" defaultOpen>
            <File name="fern.config.json" comment="root-level configuration" />

            <File name="generators.yml" comment="generators you're using" />

            <Folder name="definition" defaultOpen>
              <File name="api.yml" comment="API-level configuration" />

              <File name="imdb.yml" comment="endpoints, types, and errors" />
            </Folder>
          </Folder>
        </Files>

        <Note>
           

          `imdb.yml`

           contains an example movies API. If you're just
          generating an SDK for test purposes, you can leave this file as it is. To
          generate an SDK for your own API instead of the example movies API,
          replace 

          `imdb.yml`

           with your own endpoints, types, and errors. 
        </Note>
      </Tab>
    </Tabs>
  </Step>

  <Step title="Validate your API definition">
    Check that your API definition is valid, and fix errors before proceeding:

    ```bash
    fern check
    ```
  </Step>

  <Step title="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:

    <Files>
      <Folder name="fern" comment="created by fern init" />

      <Folder name="sdks" defaultOpen comment="created by fern generate">
        <Folder name="typescript" defaultOpen>
          <File name="Client.ts" />

          <File name="index.ts" />

          <Folder name="core" />

          <Folder name="api" />
        </Folder>
      </Folder>
    </Files>
  </Step>
</Steps>

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

<CardGroup cols={2}>
  <Card title="TypeScript" icon="brands typescript" href="/learn/sdks/generators/typescript/quickstart#set-up-github-repositories">
    Set up GitHub, publish to npm, and more.
  </Card>

  <Card title="All languages" icon="regular code" href="/learn/sdks/overview/introduction">
    See all supported languages, including Python, Go, and Java.
  </Card>

  <Card title="How it works" icon="regular gears" href="/learn/sdks/overview/how-it-works">
    Understand the Fern SDK generation pipeline.
  </Card>

  <Card title="Project structure" icon="regular folder-tree" href="/learn/sdks/overview/project-structure">
    Learn about Fern's multi-repo file structure and GitHub setup.
  </Card>
</CardGroup>