# Quickstart

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

Configuring Fern starts with the `fern` folder, the root directory that contains
your API definitions, SDK generators, and CLI version.

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

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

    # OpenAPI (URL)
    fern init --openapi https://api.example.com/openapi.yml \
    --organization <YourOrganization>

    # Fern Definition
    fern init --organization <YourOrganization>
    ```

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

    <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="Generate an SDK">
    Generate a [TypeScript SDK](/learn/sdks/generators/typescript/quickstart) locally (or explore [other supported languages](/learn/sdks/overview/introduction)).

    ```bash
    fern generate
    ```

    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>

  <Step title="Next steps">
    Now that you have a local SDK, you can publish it, try other languages, or extend its functionality:

    <CardGroup cols={3}>
      <Card title="Learn about project structure" icon="regular folder-tree" href="/learn/sdks/overview/project-structure">
        Set up your SDK and API definitions in GitHub.
      </Card>

      <Card title="Generate SDKs" icon="regular code" href="/learn/sdks/overview/introduction">
        Explore all supported languages.
      </Card>

      <Card title="Add custom code" icon="regular code-branch" href="/learn/sdks/overview/custom-code">
        Extend your generated SDKs with custom functionality.
      </Card>
    </CardGroup>
  </Step>
</Steps>