Files
Ethan Palm 5b2a80cdc3 Mintlify MDX extension (#7108)
* docs: document the Mintlify MDX VS Code extension

Add a page for the Mintlify MDX extension (mintlify.mintlify-snippets),
which had no coverage outside a 2024 changelog entry describing its
snippets-only predecessor.

Covers autocomplete, diagnostics, hover docs, go-to-definition,
docs.json schema validation, the in-editor preview panel, surround
snippets, all four settings, and all five commands, verified against
the shipped v2.0.0 manifest and bundle.

Replace the unifiedjs.vscode-mdx recommendation in cli/install.mdx.
Our extension warns users to disable that one, so the previous
guidance routed them into a known conflict.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* docs: accept all prefetch word forms in Vale vocabulary

The vocabulary had a bare `prefetching` entry, so `prefetches` and
`prefetched` in cli/preview.mdx were flagged as misspellings. Vale
wraps entries in \b, so the bare form matches only that one variant.

Use `(?i)prefetch(es|ed|ing)?` rather than the uncased suffix pattern
used by neighboring entries. An uncased entry also generates a
case-enforcing Vale.Terms rule, which would flag a sentence-initial
"Prefetching" as an error. "prefetch" has no canonical capitalization
worth enforcing, so the non-enforcing form avoids a latent false
positive.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* rename page

* 💅

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-25 15:12:12 -07:00

101 lines
3.1 KiB
Plaintext

---
title: "Preview locally"
description: "Run a local preview of your Mintlify documentation site with live reload, full-text search, and AI assistant support using mint dev."
keywords: ["mint dev", "local preview", "localhost", "mint login", "search", "assistant"]
---
## Prerequisites
- The [Mintlify CLI](/cli/install) installed globally, or run commands with `npx mint`.
- A documentation directory with a valid `docs.json` file.
## Start the local preview
Navigate to your documentation directory containing your `docs.json` file and run:
```bash
mint dev
```
The 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:
```bash
mint dev --no-open
```
To generate a preview without installing the CLI globally, run:
```bash
npx mint dev
```
<Tip>
If you write in VS Code or Cursor, the [Mintlify MDX extension](/cli/mdx-extension) runs this preview in a panel beside your editor and scrolls it to match the page you are editing.
</Tip>
## Log in for search and assistant
You must authenticate the CLI with your Mintlify account to enable search and the [assistant](/assistant/index).
```bash
mint login
```
After 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, which commands like `mint automations` use.
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:
```bash
mint status
```
To log out, run:
```bash
mint logout
```
## Custom ports
By default, the CLI uses port 3000. To use a different port, use the `--port` flag:
```bash
mint dev --port 3333
```
If the port is already in use, the CLI automatically tries the next available port.
## Skip OpenAPI processing
If you have many OpenAPI files, skip OpenAPI processing during local development to improve performance with the `--disable-openapi` flag:
```bash
mint dev --disable-openapi
```
## 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:
```bash
mint dev --disable-prefetch
```
With 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
If you use group-based access control, preview as a specific authentication group with the `--groups` flag:
```bash
mint dev --groups admin
```
See [Authentication setup](/deploy/authentication-setup#control-access-with-groups) for more information on groups.