Preview locally
Run a local preview of your Mintlify documentation site with live reload, full-text search, and AI assistant support using mint dev.
Prerequisites
Section titled “Prerequisites”- The Mintlify CLI installed globally, or run commands with
npx mint. - A documentation directory with a valid
docs.jsonfile.
Start the local preview
Section titled “Start the local preview”Navigate to your documentation directory containing your docs.json file and run:
mint devThe local preview starts at http://localhost:3000. As you edit, changes appear in real time.
By default, the preview opens automatically in your browser. To prevent the browser from opening, use the --no-open flag:
mint dev --no-openTo generate a preview without installing the CLI globally, run:
npx mint devLog in for search and assistant
Section titled “Log in for search and assistant”You must authenticate the CLI with your Mintlify account to enable search and the assistant.
mint loginAfter you authenticate with the mint login command, the CLI stores your credentials in ~/.config/mintlify/config.json so you stay logged in across sessions. The CLI also prompts you to select a default project.
Once logged in, run mint dev to start the local preview with search and the assistant enabled. The assistant uses the same indexed content as your deployed documentation site.
To check your authentication status, run:
mint statusTo log out, run:
mint logoutCustom ports
Section titled “Custom ports”By default, the CLI uses port 3000. To use a different port, use the --port flag:
mint dev --port 3333If the port is already in use, the CLI automatically tries the next available port.
Skip OpenAPI processing
Section titled “Skip OpenAPI processing”If you have many OpenAPI files, skip OpenAPI processing during local development to improve performance with the --disable-openapi flag:
mint dev --disable-openapiDisable navigation prefetching
Section titled “Disable navigation prefetching”By default, the local preview prefetches nearby pages to optimize page load speeds. For very large sites, this can slow down the page you are actively viewing if many pages compile in the background at the same time.
If you have thousands of pages and notice slow page loads during local preview, disable prefetching with the --disable-prefetch flag:
mint dev --disable-prefetchWith prefetching disabled, pages compile only when you navigate to them. Individual page loads take longer than a prefetched page, but the page you request is not competing with background compilation.
Preview as a specific group
Section titled “Preview as a specific group”If you use group-based access control, preview as a specific authentication group with the --groups flag:
mint dev --groups adminSee Authentication setup for more information on groups.