Files
mintlify__docs/cli/preview.mdx
Ethan Palm db3ca0500d CLI updates (#5150)
* update skills

* update migration guide

* update API migration guide

* update assistant page

* update analytics page

* update CLI commands

* deprecate openapi-check

* add coming soon

* update docs.json

* add index page

* add install page

* add preview page

* add analytics

* add commands reference

* update links

* delete installation.mdx

* add optional prereq steps

* Add telemetry section to commands reference

Incorporates telemetry content from #5039 which was merged to main after
this branch was created. Documents opt-out flags, env variables, and
config persistence.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* move global flags to top

* vale

* remove `mint upgrade`

* remove unnecessary prereq

* restructure analytics commands

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 10:40:51 -07:00

80 lines
2.0 KiB
Plaintext

---
title: "Preview locally"
description: "Run a local preview of your documentation with live reload, search, and AI assistant support."
keywords: ["mint dev", "local preview", "localhost", "mint login", "search", "assistant"]
---
## 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
```
## Log in for search and assistant
You must authenticate the CLI with your Mintlify account to enable search and the [assistant](/ai/assistant).
```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.
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
```
## 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.