# Overview > Learn how to use the Fern CLI to manage API projects, validate definitions, preview changes, and publish docs and SDKs. 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](https://www.npmjs.com/): ```bash npm install -g fern-api fern -v ``` If you prefer to manage Fern as a project dependency or are working in an environment with limited internet connectivity, install the CLI locally: ```bash npm install fern-api ``` In your `fern.config.json`, set the version to `*` to use your locally installed version: ```json fern.config.json {3} { "organization": "your-org", "version": "*" } ``` See the [fern.config.json reference](/learn/sdks/overview/project-structure#fernconfigjson) for more details. ```bash 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](/learn/cli-api-reference/global-options) like `--log-level` for debugging. For complete CLI documentation, see the [command reference](/learn/cli-api-reference/cli-reference/commands). When working with Fern Docs, you'll use these CLI commands. For complete instructions, see the [Docs quickstart](/learn/docs/getting-started/quickstart). | Command | Description | | ---------------------- | ---------------------------------------- | | `fern init --docs` | Create a new docs project | | `fern docs dev` | Preview docs locally at `localhost:3000` | | `fern generate --docs` | Publish documentation to production | When working with Fern SDKs, you'll use these CLI commands. For complete instructions, see the [SDKs quickstart](/learn/sdks/overview/quickstart). | Command | Description | | ------------------------------ | ----------------------------------- | | `fern init` | Create a new SDK project | | `fern check` | Validate your API definition | | `fern generate --preview` | Preview SDKs locally in `.preview/` | | `fern generate` | Publish SDKs to production | | `fern generate --group ` | Generate a specific SDK group |