Installing the CLI
Prerequisite: Please install Node.js before proceeding.
1
Install the CLI.
Run the following command to install the CLI:
2
Preview locally.
Navigate to your docs directory (where your A local preview of your documentation will be available at
docs.json file is located) and execute the following command:http://localhost:3000.Updates
If your local preview is out of sync with what you see on the web in the production version, update your local CLI:mint update command is not available on your local version, re-install the CLI with the latest version:
Custom ports
By default, the CLI uses port 3000. You can customize the port using the--port flag. To run the CLI on port 3333, for instance, use this command:
Additional commands
Whilemint dev is the most commonly used command, there are other commands you can use to manage your documentation.
Finding broken links
The CLI can assist with validating reference links made in your documentation. To identify any broken links, use the following command:Checking OpenAPI spec
You can use the CLI to check your OpenAPI file for errors using the following command:./openapi.yaml) or a URL (e.g. https://petstore3.swagger.io/api/v3/openapi.json).
Renaming files
You can rename and update all references to files using the following command:Formatting
While developing locally, we recommend using extensions in your IDE to recognize and formatMDX files.
If you use Cursor, Windsurf, or VSCode, we recommend the MDX VSCode extension for syntax highlighting, and Prettier for code formatting.
If you use JetBrains, we recommend the MDX IntelliJ IDEA plugin for syntax highlighting, and setting up Prettier for code formatting.
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. Try the following:
- Remove the currently-installed version of the mint CLI:
npm remove -g mint - Upgrade to Node.js.
- Reinstall the mint CLI:
npm install -g mint
Issue: Encountering an unknown error
Issue: Encountering an unknown error
Solution: Go to the root of your device and delete the
~/.mintlify folder. Afterwards, run mint dev again.