fern is a free, open source documentation & knowledge base project written in TypeScript and released under Apache-2.0. It has 3,782 GitHub stars, 345 forks and 343 open issues, and was last pushed 3 hours ago. On this registry it ranks #29 of 40 tracked projects in Documentation & Knowledge Base, with 5 head-to-head comparisons available. It gained 2 stars over the last 3 tracked days.

What is fern?

What it is

Fern is an Apache-2.0 TypeScript project in the API documentation and SDK generation ecosystem. It takes API definitions as input and produces client SDKs and developer documentation. The project centers on the fern-api CLI, published on npm, and supports OpenAPI, AsyncAPI, Protobuf, and OpenRPC.

It solves the manual work required to keep API contracts, client libraries, and documentation aligned. A team points Fern at an OpenAPI document and runs a generator, producing typed SDK output and a documentation site from the same source definition, which reduces drift between the API and developer guidance.

Key capabilities

  • Generates type-safe SDKs for TypeScript, Python, Java, Go, Ruby, PHP, and C# from API definitions.
  • Accepts OpenAPI for REST and Webhooks, plus AsyncAPI for WebSockets, Protobuf for gRPC, and OpenRPC.
  • Builds a hosted developer documentation website with an auto-generated API reference and markdown pages.
  • Provides search, SEO, dark mode, and customizable branding for colors, font, logo, and domain name.
  • Adds generators as processes that take API definitions and output artifacts such as SDKs and server boilerplate.
  • Runs through a CLI that requires Node 18 or newer and stores configuration in fern/fern.config.json and generators.yml.
  • Exposes generated output locally, such as a TypeScript SDK in /generated/sdks/typescript.

Who uses it and how

  • API teams initialize a Fern project from a local OpenAPI file or remote OpenAPI URL, then run fern generate to produce SDKs.
  • Documentation teams add markdown pages alongside generated references and version those pages through git.
  • Teams can publish branded docs sites for public or partner developers, as shown by elevenlabs.io/docs, launchdarkly.com/docs, and docs.hume.ai.
  • Engineering teams add language-specific generators from the CLI to create client libraries for languages their users consume.

Getting started

Install the CLI globally with npm install -g fern-api, then initialize a project from a local or remote OpenAPI document using fern init --openapi ./path/to/openapi.yml or a URL. After adding generators, run fern generate to produce SDK output under /generated/sdks/typescript.

When to use it — and when not to

Use Fern when your goal is to turn existing API specifications into SDKs and docs from a single CLI workflow, especially in a Node.js or TypeScript toolchain. The README describes a hosted documentation option and dashboard signup, but it does not state a fully self-hosted deployment model or list required services such as a database, storage backend, or SMTP server, so teams needing an entirely on-premises stack should verify that before adopting it. The registry facts show 343 open issues and no listed contributor count, which means prospective users should check maintenance activity and backlog before depending on it for production SDK generation.

project readme (upstream, from github) — read inline



npm version 2023 Y Combinator Startup License

Documentation Book a demo Start for free

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

</a>

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

SDK Generators

Generator ID Latest Version Changelog
fernapi/fern-typescript-sdk Typescript Generator Version Changelog
fernapi/fern-python-sdk Python Generator Version Changelog
fernapi/fern-java-sdk Java Generator Version Changelog
fernapi/fern-ruby-sdk Ruby Generator Version Changelog
fernapi/fern-go-sdk Go Generator Version Changelog
fernapi/fern-csharp-sdk C# Generator Version Changelog
fernapi/fern-php-sdk PHP Generator Version Changelog
fernapi/fern-swift-sdk Swift Generator Version Changelog
fernapi/fern-rust-sdk Rust Generator Version Changelog

CLI Generators

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

Generator ID Latest Version Changelog
fernapi/fern-cli-generator CLI Generator Version versions.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 ID Latest Version Changelog
fernapi/fern-openapi OpenAPI Generator Version versions.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: run the generators specified in generators.yml in the cloud.

fern generate --local: run the generators specified in generators.yml in docker locally.

fern add : 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 he

readme truncated — read the full docs on github

Frequently asked questions

Is fern free to use?

fern is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does fern do?

Input OpenAPI. Output SDKs and Docs.

What is fern written in?

fern is primarily written in TypeScript. Its source is publicly available at https://github.com/fern-api/fern, and it has 3,782 GitHub stars.