Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 61 additions & 1 deletion fern/products/sdks/fern-folder.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ keywords: getting started, quickstart

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.

<div data-type="image-upload" />

<llms-only>
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.
</llms-only>
Expand All @@ -20,7 +22,65 @@ Generate an SDK with Fern. Follow the [SDKs quickstart](https://buildwithfern.co

<Steps>

<Markdown src="/products/sdks/snippets/init-fern-folder.mdx"/>

<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. Specify your organization name using the `--organization` flag.

<llms-only>
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.
</llms-only>

<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="Example (Petstore)"
fern init --openapi https://petstore3.swagger.io/api/v3/openapi.json \
--organization my-org
```
</CodeBlocks>

<Tip>
OpenAPI accepts both JSON and YAML formats.
</Tip>

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

<llms-only>
`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.
</llms-only>

<Files>
<Folder name="fern" defaultOpen>
<File name="fern.config.json" comment="root-level configuration" />
<File name="generators.yml" comment="generators and API spec configuration" />
</Folder>
</Files>
</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">

Expand Down
Loading