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 mintUsing an AI coding tool? Copy the following prompt to have your agent install the CLI and verify it works.
Create a new project
To create a new documentation project from the Mintlify starter template, run the following command:
mint new [directory]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.
| Flag | Description |
|---|---|
--name | Project name. The CLI prompts for this if not provided. |
--theme | Project theme. The CLI prompts for this if not provided. |
--template | Pre-defined template. The CLI prompts for this if not provided. |
--force | Overwrite 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 updateIf mint update is not available on your version, reinstall the CLI with the latest version:
npm i -g mint@latestFormatting
For syntax highlighting and code formatting in MDX files, use the following extensions:
- Cursor, Devin Desktop, VS Code: MDX VS Code extension and Prettier
- JetBrains: MDX IntelliJ IDEA plugin and Prettier