Overview
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
Check prerequisites
The Fern CLI requires Node.js version 18 or higher and npm version 8.6.0 or higher (ships with Node.js 18).
If your version is below the minimum, download the latest Node.js LTS which includes a compatible npm version.
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:
Update configuration
In your fern.config.json, set the version to * to use your locally installed version:
See the fern.config.json reference for more details.
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.
SDK workflow
When working with Fern SDKs, you’ll use these CLI commands. For complete instructions, see the SDKs quickstart.