For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Book a demoLog inStart for free
  • CLI reference
    • Get started with Fern CLI
    • Global options
    • Commands
    • Changelog
Checking status...
SOC2Soc 2 Type II
© 2026 Fern • Birch Solutions, Inc., a Postman company

Documentation

SDKsDocsAsk FernCLI Reference

API Definitions

OpenAPIAsyncAPIOpenRPCgRPC

Resources

BlogSupportPricing

Company

Brand KitPrivacy PolicyTerms of Service
LogoLogo
Book a demoLog inStart for free
On this page
  • Installation
  • CLI workflows by product
CLI reference

Overview

Manage and configure your Fern projects, all from the command line.
||View as Markdown|
Was this page helpful?
Edit this page
Next

Global options

The Fern CLI lets you initialize projects, validate API definitions, preview changes locally, and publish documentation and SDKs. This page covers installation and common commands to get you started.

Installation

1

Check prerequisites

The Fern CLI requires Node.js version 22 or higher and npm version 10.0.0 or higher (ships with Node.js 22).

$node -v # Must be v22.0.0 or higher

If your version is below the minimum, download the latest Node.js LTS which includes a compatible npm version.

2

Install the Fern CLI

Run the following command to install the Fern CLI globally from npm:

$npm install -g fern-api
$fern -v # Verify the installation
Install locally as a project dependency

If you prefer to manage Fern as a project dependency or are working in an environment with limited internet connectivity, install the CLI locally:

1

Install as project dependency

$npm install fern-api
2

Update configuration

In your fern.config.json, set the version to * to use your locally installed version:

fern.config.json
1{
2 "organization": "your-org",
3 "version": "*"
4}

See the fern.config.json reference for more details.

3

Run via package manager

$npm fern check
$npm fern generate

CLI workflows by product

The Fern CLI manages both documentation and SDK workflows. Below is a brief overview of the common commands for each. All commands support global options like --log-level for debugging.

For complete CLI documentation, see the command reference.

Docs workflow

When working with Fern Docs, you’ll use these CLI commands. For complete instructions, see the Docs quickstart.

CommandDescription
fern init --docsCreate a new docs project
fern docs devPreview docs locally at localhost:3000
fern generate --docsPublish documentation to production
SDK workflow

When working with Fern SDKs, you’ll use these CLI commands. For complete instructions, see the SDKs quickstart.

CommandDescription
fern initCreate a new SDK project
fern checkValidate your API definition
fern generate --previewPreview SDKs locally in .preview/
fern generatePublish SDKs to production
fern generate --group <name>Generate a specific SDK group