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 -vto check. Download from nodejs.org if needed. - A
docs.jsonfile 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:Start the preview server
Run the following command from the root of your docs directory (the folder that containsdocs.json):
.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:
Update the CLI
Keep the CLI up to date to get the latest features and bug fixes:Validate links
Check your docs for broken internal links before pushing:Troubleshooting
Error: sharp module failed to load
Error: sharp module failed to load
This error occurs when the native 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.
sharp image processing module cannot be compiled for your platform. Try reinstalling the CLI:Unknown error or the dev server won't start
Unknown error or the dev server won't start
Corrupted cache files can prevent the dev server from starting. Delete the Mintlify cache directory and try again:This removes locally cached build artifacts. The CLI recreates them the next time you run
mint dev.