Mintlify CLI
raw JSON →The `mint` package provides the official Command Line Interface (CLI) for Mintlify, a platform for building and publishing documentation. It enables developers to scaffold new documentation sites, preview changes locally, validate documentation builds in strict mode (useful for CI/CD), check for broken internal and external links, validate OpenAPI specifications, and perform accessibility audits. The current stable version is 4.2.527. As a CLI tool, its release cadence is typically tied to the evolution of the Mintlify platform itself, receiving regular updates to support new features and address issues. Key differentiators include its tight integration with the Mintlify ecosystem, specialized commands for documentation validation (e.g., `broken-links`, `openapi-check`, `a11y`), and a streamlined local development workflow with `mint dev`. It is designed for direct command-line execution rather than programmatic import.
Common errors
error mint dev is not working ↓
docs.json exists in the current directory. 2. Run mint update to get the latest CLI. 3. Ensure your Node.js version is 20.17 or higher (but not 25+). 4. Delete the contents of the .mintlify folder in your home directory (~/.mintlify). error Command not found: mint ↓
npm i -g mint. If it's already installed, ensure your system's PATH environment variable includes the npm global binaries directory. error Node.js vX.Y.Z is not supported by the Mintlify CLI. Please use Node.js version 20.17 or higher, but not 25+. ↓
nvm or fnm. Example: nvm install 20 && nvm use 20. Warnings
breaking Strict Node.js version requirements are enforced. The CLI requires Node.js version 20.17 or higher. Node.js versions 18.x and earlier, as well as Node.js 25 and newer, are explicitly not supported. Using an unsupported Node.js version may lead to unexpected errors or complete failure of CLI commands. ↓
gotcha The `mint dev` command and other validation commands (like `mint validate`) require being run within a directory that contains a `docs.json` file, which signifies the root of a Mintlify project. Running these commands outside a valid project directory will cause them to fail or not function as expected. ↓
gotcha The `mint broken-links` command by default only checks internal links within the project. To include checks for external URLs, anchor links (like `#section`), or links within `<Snippet>` components, you must explicitly enable these checks using the `--check-external`, `--check-anchors`, and `--check-snippets` flags, respectively. ↓
Install
npm install mint yarn add mint pnpm add mint Imports
- mint wrong
import { mint } from 'mint'correctInstall globally via npm: `npm i -g mint`. Then use from command line: `mint <command>` - Mintlify Project Interaction wrong
const project = new MintlifyProject()correctInteract with Mintlify projects via CLI commands like `mint dev` or `mint validate`. - CLI Commands wrong
import { dev } from 'mint'; dev({ port: 3000 });correctExecute specific commands directly in the terminal: `mint dev`, `mint validate`, `mint broken-links`, etc.
Quickstart
{
// 1. Install the Mintlify CLI globally
// npm i -g mint
// 2. Navigate to your desired project directory (or create a new one)
// cd my-new-docs
// 3. Initialize a new Mintlify documentation site
// mint new
// 4. Start the local development server to preview your documentation
// This command will open your documentation in a browser at http://localhost:3000 by default.
// Use --port <number> to specify a different port or --no-open to prevent automatic browser opening.
// mint dev --port 3333
// 5. To validate your documentation for CI/CD, run:
// mint validate
// 6. To check for broken internal links:
// mint broken-links --check-external --check-anchors
}