System requirements
Before installing the CLI, ensure your system meets these requirements:Node.js
Version 20.17.0 or higher (LTS versions recommended)
Git
Git installed for repository management
Need to install Node.js? Download it from nodejs.org. We recommend using an LTS (Long Term Support) version for stability.
Clone your repository
Before using the CLI, clone your documentation repository locally:Locate your repository
Go to the Git settings page of your dashboard.Note your repository location. It is one of these formats:
mintlify-community/docs-{org-name}-{id}(Mintlify-hosted repository)your-org/your-repo(your own GitHub repository)
Install the CLI
Install the Mintlify CLI globally using your preferred package manager:If you encounter permission errors on macOS or Linux, try running the command with
sudo: sudo npm i -g mintPreview your docs locally
Navigate to your documentation directory containing yourdocs.json file and run:
http://localhost:3000.
Alternatively, if you do not want to install the CLI globally, you can run a one-time script:
Custom ports
By default, the CLI uses port 3000. You can customize the port using the--port flag:
Skip OpenAPI processing
If you have many OpenAPI files, skip OpenAPI file processing during local development to improve performance:Preview as a specific group
If you use group-based access control to restrict access to your documentation, you can preview as a specific authentication group:Update the CLI
Keep your CLI up to date to ensure your local preview matches your production site:mint update command is not available on your local version, reinstall the CLI with the latest version:
Additional CLI commands
The CLI includes several utilities to help maintain and validate your documentation:Find broken links
Identify broken links in your documentation:.mintignore patterns. Links that point to ignored files are reported as broken.
By default, only internal links are checked. Use flags to expand the scope:
| Flag | Description |
|---|---|
--check-anchors | Also validate anchor links (for example, /page#section) against heading slugs |
--check-external | Also check external links for broken URLs |
--check-snippets | Also check links inside <Snippet> components |
Find accessibility issues
Test the color contrast ratios and search for missing alt text on images and videos:Validate documentation build
Validate your documentation build in strict mode, which exits with an error if there are any warnings or errors:--groups [groupname]: Mock user groups for validation (useful when testing group-based access control)--disable-openapi: Disable OpenAPI file generation during validation
Check OpenAPI spec
Check your OpenAPI file for errors:Rename files
Rename and update all references to files:Create a new project
Create a new documentation project from the starter template:Flags for non-interactive environments
When runningmint new in non-interactive environments like CI/CD pipelines or with AI coding agents, you must provide all required flags:
| Flag | Description | Required |
|---|---|---|
--name | Set the name of the new project | Yes |
--theme | Set the theme of the new project | Yes |
--force | Overwrite the current directory without prompting | No |
Development tools
While developing locally, we recommend using extensions in your IDE to recognize and format MDX files.VS Code / Cursor / Windsurf
MDX VS Code extension
Syntax highlighting for MDX files
Prettier
Code formatting for consistent style
JetBrains IDEs
MDX IntelliJ IDEA plugin
Syntax highlighting for MDX files
Prettier
Code formatting for consistent style
Troubleshooting
Error: Could not load the "sharp" module using the darwin-arm64 runtime
Error: Could not load the "sharp" module using the darwin-arm64 runtime
This may be due to an outdated version of Node.js. Try the following:
- Remove the currently installed version of the mint CLI:
npm uninstall -g mint - Upgrade to Node.js v20.17.0 or higher
- Reinstall the mint CLI:
npm install -g mint
Issue: Encountering an unknown error
Issue: Encountering an unknown error
Go to the root of your device and delete the
~/.mintlify folder. Afterwards, run mint dev again.Error: permission denied
Error: permission denied
This is due to not having the required permissions to globally install node packages.Solution: Try running
sudo npm i -g mint. When prompted, enter the password that you use to unlock your computer.The local preview doesn't look the same as my docs do on the web
The local preview doesn't look the same as my docs do on the web
This is likely due to an outdated version of the CLI.Solution: Run
mint update to get the latest changes.mintlify versus mint package
mintlify versus mint package
If you have any problems with the CLI package, you should first run
npm ls -g. This command shows what packages are globally installed on your machine.If you don’t use npm or don’t see it in the -g list, try which mint to locate the installation.If you have a package named mint and a package named mintlify installed, you should uninstall mintlify.- Uninstall the old package:
- Clear your npm cache:
- Reinstall the new package:
Client version shows 'none' after installation
Client version shows 'none' after installation
If you run
mint version and the client version displays as none, the CLI may be unable to download the client application due to a corporate firewall or VPN blocking the download.Solution: Ask your IT administrator to add releases.mintlify.com to your network allowlist to enable local development with the CLI.Next steps
Start building
Now that you have the CLI installed, follow the quickstart guide to create your first documentation site.