Quickstart

View as Markdown

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

1

Install the Fern CLI

$npm install -g fern-api
2

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.

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

OpenAPI accepts both JSON and YAML formats. You can always convert a Fern Definition to OpenAPI or OpenAPI to a Fern Definition later on.

This creates a fern folder in your current directory.

fern
fern.config.json# root-level configuration
api# your API
generators.yml# generators you're using
openapi
openapi.yml# API-level configuration