From 8722a617287a2d4d2fdc21346614bf672ab26e01 Mon Sep 17 00:00:00 2001 From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com> Date: Sat, 4 Apr 2026 00:32:47 +0000 Subject: [PATCH] Document CLI login, search, and assistant support in local preview Generated-By: mintlify-agent --- ai/assistant.mdx | 6 ++++++ installation.mdx | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/ai/assistant.mdx b/ai/assistant.mdx index b16a02fa3..eb1eb2306 100644 --- a/ai/assistant.mdx +++ b/ai/assistant.mdx @@ -298,6 +298,12 @@ Open the assistant with a URL query parameter to create deep links that guide us - **Open with a pre-filled query**: Append `?assistant=YOUR_QUERY` to open the assistant and automatically submit a question. - Example: [https://mintlify.com/docs?assistant=explain webhooks](https://mintlify.com/docs?assistant=explain%20webhooks) +## Test the assistant locally + +You can use the assistant during local development with `mint dev`. To enable it, authenticate the CLI by running `mint login` before starting the local preview. See [Install the CLI](/installation#log-in-for-search-and-assistant) for setup instructions. + +The local assistant connects to your published documentation index, so it returns the same answers as the assistant on your live site. This is useful for testing assistant behavior, custom instructions in `Assistant.md`, and UI placement without deploying. + ## Troubleshooting diff --git a/installation.mdx b/installation.mdx index 68eca503e..b8bf0143b 100644 --- a/installation.mdx +++ b/installation.mdx @@ -95,6 +95,30 @@ Alternatively, if you do not want to install the CLI globally, you can run a one npx mint dev ``` +### Log in for search and assistant + +By default, the local preview does not include search or the AI assistant. To enable these features during local development, authenticate the CLI with your Mintlify account: + +```bash +mint login +``` + +This opens a browser window where you sign in with your Mintlify account. After you authenticate, the CLI stores your credentials locally so you stay logged in across sessions. + +Once logged in, run `mint dev` to start the local preview with search and the [AI assistant](/ai/assistant) enabled. You can test search queries and interact with the assistant the same way your users do on your published site. + +To check your authentication status: + +```bash +mint status +``` + +To log out: + +```bash +mint logout +``` + ### 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: