Skip to main content
The Mintlify CLI (mint) gives you a live local preview of your docs site so you can see exactly how changes look before pushing to GitHub. It also includes commands for validating links and keeping the CLI itself up to date.

Prerequisites

Before you start, make sure you have:
  • Node.js v19 or later — run node -v to check. Download from nodejs.org if needed.
  • A docs.json file in the root of your docs directory. This file is created for you if you started from the Mintlify starter template.

Install the CLI

Install the Mintlify CLI globally with npm:
npm i -g mint

Start the preview server

Run the following command from the root of your docs directory (the folder that contains docs.json):
mint dev
The preview server starts at http://localhost:3000 and watches for file changes. Edit any .mdx file and the browser updates automatically.

Use a custom port

If port 3000 is already in use, specify a different port with the --port flag:
mint dev --port 3333

Update the CLI

Keep the CLI up to date to get the latest features and bug fixes:
mint update
Run this command periodically, or whenever you see a notice in the terminal that a newer version is available. Check your docs for broken internal links before pushing:
mint broken-links
The command scans all pages and reports any links that point to pages that do not exist. Fix broken links before deploying to avoid dead ends for your readers.

Troubleshooting

This error occurs when the native sharp image processing module cannot be compiled for your platform. Try reinstalling the CLI:
npm remove -g mint
npm i -g mint
If the error persists, check that your Node.js version is v19 or later and that you have the necessary native build tools installed for your operating system.
Corrupted cache files can prevent the dev server from starting. Delete the Mintlify cache directory and try again:
rm -rf ~/.mintlify
mint dev
This removes locally cached build artifacts. The CLI recreates them the next time you run mint dev.