Skip to content
Mintlify
CLI

Install the CLI

Install the Mintlify CLI to preview documentation locally, test changes in real time, and catch build errors before deploying to production.

Prerequisites

  • Node.js v20.17.0+ (LTS versions recommended)

Install the CLI

npm i -g mint

Using an AI coding tool? Copy the following prompt to have your agent install the CLI and verify it works.

Install the Mintlify CLI globally and verify the installation.

Create a new project

To create a new documentation project from the Mintlify starter template, run the following command:

mint new [directory]
Scaffold a new Mintlify project.

If you do not specify a directory, the CLI prompts you to create a new subdirectory or overwrite the current directory.

Overwriting the current directory deletes any existing files.

FlagDescription
--nameProject name. The CLI prompts for this if not provided.
--themeProject theme. The CLI prompts for this if not provided.
--templatePre-defined template. The CLI prompts for this if not provided.
--forceOverwrite the current directory without prompting.

In interactive mode, the CLI asks whether you want to pick a theme or clone a template. To skip the prompt, pass the --template flag directly:

mint new my-docs --template <template-name>

You can combine --template with --theme to override the template’s default theme:

mint new my-docs --template <template-name> --theme <theme>

See available templates in the mintlify/templates repository on GitHub. In interactive mode, the CLI fetches and displays available templates automatically.

In non-interactive environments such as CI/CD pipelines or AI coding agents, you must provide either --name and --theme flags, or the --template flag.

Update

If your local preview is out of sync with your deployed documentation, update the CLI to the latest version:

mint update

If mint update is not available on your version, reinstall the CLI with the latest version:

npm i -g mint@latest

Formatting

For syntax highlighting and code formatting in MDX files, use the following extensions:

Troubleshooting

Ctrl+I