fern-api/fern

Input OpenAPI. Output SDKs and Docs.

TypeScript

3,817

15,190 commits

updated Oct 17, 2026

See the code

README


🌿 What is Fern?

Fern is a platform that transforms your API definitions into production-ready SDKs and beautiful documentation in minutes.

With Fern, you can offer your users:

  • 🧩 Type-safe SDKs in multiple languages, including TypeScript, Python, Java, Go, Ruby, PHP, and C#
  • πŸ“˜ Developer documentation featuring an interactive UI and auto-generated API + SDK references
  • ✨ AI Search powered by an assistant trained on your docs, APIs, and SDKs that can instantly answer a developer's questions

Fern supports leading API specifications including OpenAPI (REST, Webhooks), AsyncAPI (WebSockets), Protobuf (gRPC), and OpenRPC.

🌿 SDKs

The Fern platform is available via a command line interface (CLI) and requires Node 18+. To install it, run:

npm install -g fern-api

Initialize Fern with your OpenAPI spec:

fern init --openapi ./path/to/openapi.yml
# or
fern init --openapi https://link.buildwithfern.com/plantstore-openapi

Your directory should look like the following:

fern/
β”œβ”€ fern.config.json
β”œβ”€ generators.yml # generators you're using
└─ openapi/
  └─ openapi.json # your openapi document

Finally, to invoke the generator, run:

fern generate

πŸŽ‰ Once the command completes, you'll see your SDK in /generated/sdks/typescript.

🌿 API Documentation

Fern can also build and host a documentation website with an auto-generated API reference. Write additional pages in markdown and have them versioned with git. Search, SEO, dark mode, and popular components are provided out-of-the-box. Plus, you can customize the colors, font, logo, and domain name.

Check out docs built with Fern:

Get started here.

🌿 Generators

Generators are processes that take your API Definition as input and output artifacts (SDKs, Server boilerplate, etc.). To add a generator, run fern add <generator id>.

SDK Generators

Generator IDLatest VersionChangelog
fernapi/fern-typescript-sdkTypescript Generator VersionChangelog
fernapi/fern-python-sdkPython Generator VersionChangelog
fernapi/fern-java-sdkJava Generator VersionChangelog
fernapi/fern-ruby-sdkRuby Generator VersionChangelog
fernapi/fern-go-sdkGo Generator VersionChangelog
fernapi/fern-csharp-sdkC# Generator VersionChangelog
fernapi/fern-php-sdkPHP Generator VersionChangelog
fernapi/fern-swift-sdkSwift Generator VersionChangelog
fernapi/fern-rust-sdkRust Generator VersionChangelog

CLI Generators

Fern's CLI generator produces a standalone command-line interface for your API.

Generator IDLatest VersionChangelog
fernapi/fern-cli-generatorCLI Generator Versionversions.yml

Spec Generators

Fern's spec generators can output an OpenAPI spec.

Note: The OpenAPI spec generator is primarily intended for Fern Definition users. This prevents lock-in so that one can always export to OpenAPI.

Generator IDLatest VersionChangelog
fernapi/fern-openapiOpenAPI Generator Versionversions.yml

🌿 CLI Commands

Here's a quick look at the most popular CLI commands. View the documentation for all CLI commands.

fern init: adds a new starter API to your repository.

fern check: validate your API definition and Fern configuration.

fern generate: generate the default legacy group and all targets in the default sdk-config.yml in the cloud.

fern generate --group <name>: generate a legacy group from generators.yml or generators.legacy.yml.

fern generate --target <language>: generate a language target from sdk-config.yml.

fern generate --group <name> --target <language>: generate legacy and SDK Config selections together.

fern generate --sdk-config <path> --target <language>: generate from an alternate SDK Config file.

fern generate --local: run legacy generator groups in Docker locally. SDK Config targets use remote generation.

fern add <generator>: include a new generator in your generators.yml. For example, fern add fern-python-sdk.

Inspiration

Fern is inspired by internal tooling built to enhance the developer experience. We stand on the shoulders of giants. While teams were responsible for building the following tools, we want to give a shout out to Mark Elliot (creator of Conjure at Palantir), Michael Dowling (creator of Smithy at AWS), and Ian McCrystal (creator of Stripe Docs).

Community

Join our Slack! We are here to answer questions and help you get the most out of Fern.

Contributing

We welcome community contributions. For guidelines, refer to our CONTRIBUTING.md. To contribute to our documentation, refer to our docs repo.

Development Environment

This repository uses DevBox for reproducible development environments. DevBox provides cross-platform support (Mac, Linux, Windows via WSL) with exact version pinning based on Nix.

To get started:

# Install DevBox (https://www.jetify.com/devbox/docs/installing_devbox/)
curl -fsSL https://get.jetify.com/devbox | bash

# Enter the development environment
devbox shell

DevBox automatically installs all required dependencies including Node.js, pnpm, Go, Python, Poetry, JDK, and buf with pinned versions matching CI.

Fern Contributors

api
docs-as-code
docs-generator
openapi
sdk-generator

fern-api/fern

Input OpenAPI. Output SDKs and Docs.

TypeScript

3,817

15,190 commits

updated Oct 17, 2026

See the code

README


🌿 What is Fern?

Fern is a platform that transforms your API definitions into production-ready SDKs and beautiful documentation in minutes.

With Fern, you can offer your users:

  • 🧩 Type-safe SDKs in multiple languages, including TypeScript, Python, Java, Go, Ruby, PHP, and C#
  • πŸ“˜ Developer documentation featuring an interactive UI and auto-generated API + SDK references
  • ✨ AI Search powered by an assistant trained on your docs, APIs, and SDKs that can instantly answer a developer's questions

Fern supports leading API specifications including OpenAPI (REST, Webhooks), AsyncAPI (WebSockets), Protobuf (gRPC), and OpenRPC.

🌿 SDKs

The Fern platform is available via a command line interface (CLI) and requires Node 18+. To install it, run:

npm install -g fern-api

Initialize Fern with your OpenAPI spec:

fern init --openapi ./path/to/openapi.yml
# or
fern init --openapi https://link.buildwithfern.com/plantstore-openapi

Your directory should look like the following:

fern/
β”œβ”€ fern.config.json
β”œβ”€ generators.yml # generators you're using
└─ openapi/
  └─ openapi.json # your openapi document

Finally, to invoke the generator, run:

fern generate

πŸŽ‰ Once the command completes, you'll see your SDK in /generated/sdks/typescript.

🌿 API Documentation

Fern can also build and host a documentation website with an auto-generated API reference. Write additional pages in markdown and have them versioned with git. Search, SEO, dark mode, and popular components are provided out-of-the-box. Plus, you can customize the colors, font, logo, and domain name.

Check out docs built with Fern:

Get started here.

🌿 Generators

Generators are processes that take your API Definition as input and output artifacts (SDKs, Server boilerplate, etc.). To add a generator, run fern add <generator id>.

SDK Generators

Generator IDLatest VersionChangelog
fernapi/fern-typescript-sdkTypescript Generator VersionChangelog
fernapi/fern-python-sdkPython Generator VersionChangelog
fernapi/fern-java-sdkJava Generator VersionChangelog
fernapi/fern-ruby-sdkRuby Generator VersionChangelog
fernapi/fern-go-sdkGo Generator VersionChangelog
fernapi/fern-csharp-sdkC# Generator VersionChangelog
fernapi/fern-php-sdkPHP Generator VersionChangelog
fernapi/fern-swift-sdkSwift Generator VersionChangelog
fernapi/fern-rust-sdkRust Generator VersionChangelog

CLI Generators

Fern's CLI generator produces a standalone command-line interface for your API.

Generator IDLatest VersionChangelog
fernapi/fern-cli-generatorCLI Generator Versionversions.yml

Spec Generators

Fern's spec generators can output an OpenAPI spec.

Note: The OpenAPI spec generator is primarily intended for Fern Definition users. This prevents lock-in so that one can always export to OpenAPI.

Generator IDLatest VersionChangelog
fernapi/fern-openapiOpenAPI Generator Versionversions.yml

🌿 CLI Commands

Here's a quick look at the most popular CLI commands. View the documentation for all CLI commands.

fern init: adds a new starter API to your repository.

fern check: validate your API definition and Fern configuration.

fern generate: generate the default legacy group and all targets in the default sdk-config.yml in the cloud.

fern generate --group <name>: generate a legacy group from generators.yml or generators.legacy.yml.

fern generate --target <language>: generate a language target from sdk-config.yml.

fern generate --group <name> --target <language>: generate legacy and SDK Config selections together.

fern generate --sdk-config <path> --target <language>: generate from an alternate SDK Config file.

fern generate --local: run legacy generator groups in Docker locally. SDK Config targets use remote generation.

fern add <generator>: include a new generator in your generators.yml. For example, fern add fern-python-sdk.

Inspiration

Fern is inspired by internal tooling built to enhance the developer experience. We stand on the shoulders of giants. While teams were responsible for building the following tools, we want to give a shout out to Mark Elliot (creator of Conjure at Palantir), Michael Dowling (creator of Smithy at AWS), and Ian McCrystal (creator of Stripe Docs).

Community

Join our Slack! We are here to answer questions and help you get the most out of Fern.

Contributing

We welcome community contributions. For guidelines, refer to our CONTRIBUTING.md. To contribute to our documentation, refer to our docs repo.

Development Environment

This repository uses DevBox for reproducible development environments. DevBox provides cross-platform support (Mac, Linux, Windows via WSL) with exact version pinning based on Nix.

To get started:

# Install DevBox (https://www.jetify.com/devbox/docs/installing_devbox/)
curl -fsSL https://get.jetify.com/devbox | bash

# Enter the development environment
devbox shell

DevBox automatically installs all required dependencies including Node.js, pnpm, Go, Python, Poetry, JDK, and buf with pinned versions matching CI.

Fern Contributors

api
docs-as-code
docs-generator
openapi
sdk-generator

Project health

Latest release

5.162.0 Β· Oct 16, 2026

Releases this year

1,094

Significant stargazers

(top 24 of 80)

EGOIST

13,608 followers Β· starred Mar 2024

Miguel Grinberg

12,951 followers Β· starred Mar 2024

Zeno Rocha

11,582 followers Β· starred Jan 2023

Felix Boehm

652 followers Β· starred Sep 2023