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
Run the following command to install the Fern CLI globally from npm:
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.