Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions .claude/commands/lint-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ allowed-tools: Bash(mint *), Bash(vale *)
description: Check documentation for broken links, Vale style errors, and OpenAPI spec validity. Fix linting issues found. Use when the user asks to lint, check for broken links, run Vale, or fix documentation errors.
---

Run `mint broken-links` and check the given git diff. For OpenAPI reference updates run `mint openai-check`.
Run `mint broken-links` and check the given git diff. For OpenAPI validation run `mint validate`.

If the Vale CLI exists, run a Vale check on all changed files.

Expand All @@ -16,18 +16,10 @@ mint <command>

Commands:
mint dev initialize a local preview environment
mint openapi-check <filename> check if an OpenAPI spec is valid
mint broken-links check for invalid internal links
mint rename <from> <to> rename a file and update all internal link refe
rences
mint validate validate documentation build
mint update update the CLI to the latest version
mint upgrade upgrade mint.json file to docs.json (current fo
rmat)
mint migrate-mdx migrate MDX OpenAPI endpoint pages to x-mint ex
tensions and docs.json
mint ai [prompt] Use ai to document a page
mint version display the current version of the CLI and clie
nt [aliases: v]
mint version display the current version of the CLI and client [aliases: v]

Options:
-h, --help Show help [boolean]
Expand Down
1 change: 0 additions & 1 deletion .claude/skills/mintlify/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ Use `<Columns>` to arrange cards (or other content) in a grid. `cols` accepts 1-
- `mint dev` — Local preview at localhost:3000.
- `mint broken-links` — Check internal links.
- `mint a11y` — Check for accessibility issues.
- `mint rename` — Rename/move files and update references.
- `mint validate` — Validate documentation builds.
- `mint upgrade` — Upgrade from `mint.json` to `docs.json`.

Expand Down
2 changes: 1 addition & 1 deletion agent/workflows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

### Create a workflow file with the CLI

If you have the [Mintlify CLI](/installation) installed, run the following command from your documentation repository to create a workflow file interactively in the CLI.
If you have the [Mintlify CLI](/cli) installed, run the following command from your documentation repository to create a workflow file interactively in the CLI.

```bash
mint workflow
Expand Down Expand Up @@ -73,7 +73,7 @@

Review all changes since the last changelog update. Draft a new changelog post with any new features, bug fixes, or breaking changes.

Include information about what changed and how it affects users.

Check warning on line 76 in agent/workflows.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

agent/workflows.mdx#L76

Did you really mean 'informat'?

Do not include any internal-only information or minor changes like bumping package versions or updating documentation.

Expand Down Expand Up @@ -209,9 +209,9 @@

## Manage workflows

If you create a workflow in the dashboard, edit or delete it from the dashboard.

Check warning on line 212 in agent/workflows.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

agent/workflows.mdx#L212

Use the Oxford comma in 'If you create a workflow in the dashboard, edit or'.

If you create a workflow from a file in your repository, edit or delete it with a pull request modifying the file.

Check warning on line 214 in agent/workflows.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

agent/workflows.mdx#L214

Use the Oxford comma in 'If you create a workflow from a file in your repository, edit or'.

### Trigger a workflow manually

Expand All @@ -232,7 +232,7 @@
2. Click **View Workflows**.
3. Click the toggle next to the workflow you want to disable or enable.

When you re-enable a cron-based workflow, its next run time is recalculated from the current time.

Check warning on line 235 in agent/workflows.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

agent/workflows.mdx#L235

In general, use active voice instead of passive voice ('is recalculated').

## Prompts

Expand Down
10 changes: 10 additions & 0 deletions ai/assistant.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,16 @@ Structure your documentation to help the assistant provide accurate, relevant an
- Add [hidden pages](/organize/hidden-pages) with additional context that users don't need, but the assistant can reference.
</Card>

## Use the assistant in local preview

The assistant is available in your local preview when you log in with the CLI. This lets you test assistant behavior, custom instructions in `Assistant.md`, and responses while developing documentation locally.

1. If you haven't already, install the CLI with `npm i -g mint`.
2. Run `mint login` to authenticate.
3. Run `mint dev` to start the local preview.

The assistant in local preview uses the same indexed content as your deployed documentation site.

## Use the assistant

Users have multiple ways to start a conversation with the assistant. Each method opens a chat panel on the right side of your docs. Users can ask any question and the assistant searches your documentation for an answer. If the assistant cannot retrieve relevant information, the assistant responds that it cannot answer the question.
Expand Down
2 changes: 1 addition & 1 deletion api-playground/openapi-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ We recommend the following resources to learn about and construct your OpenAPI s
- [Swagger's OpenAPI Guide](https://swagger.io/docs/specification/v3_0/basic-structure/) to learn the OpenAPI syntax.
- [The OpenAPI specification Markdown sources](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/) to reference details of the latest OpenAPI specification.
- [Swagger Editor](https://editor.swagger.io/) to edit, validate, and debug your OpenAPI document.
- [The Mint CLI](https://www.npmjs.com/package/mint) to validate your OpenAPI document with the command: `mint openapi-check <openapiFilenameOrUrl>`.
- [The Mint CLI](https://www.npmjs.com/package/mint) to validate your OpenAPI document with the command: `mint validate`.

<Note>
Swagger's OpenAPI Guide is for OpenAPI v3.0, but nearly all of the information is applicable to v3.1. For more information on the differences between v3.0 and v3.1, see [Migrating from OpenAPI 3.0 to 3.1.0](https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0) in the OpenAPI blog.
Expand Down
2 changes: 1 addition & 1 deletion api-playground/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ We recommend generating your API playground from an OpenAPI specification. Howev
<Steps>
<Step title="Add your OpenAPI specification file.">
<Tip>
Validate your OpenAPI specification file using the [Swagger Editor](https://editor.swagger.io/) or [Mint CLI](https://www.npmjs.com/package/mint) command `mint openapi-check <filename>`.
Validate your OpenAPI specification file using the [Swagger Editor](https://editor.swagger.io/) or [Mint CLI](https://www.npmjs.com/package/mint) command `mint validate`.
</Tip>

```bash {3}
Expand Down
2 changes: 1 addition & 1 deletion api-playground/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<Accordion title="Requests from the API Playground don't work">
If you have a custom domain configured, this could be an issue with your reverse proxy. By
default, requests made via the API Playground start with a `POST` request to the
`/_mintlify/api/request` path on the docs site. If your reverse proxy is configured to only allow `GET`

Check warning on line 68 in api-playground/troubleshooting.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/troubleshooting.mdx#L68

In general, use active voice instead of passive voice ('is configured').
requests, then all of these requests fail. To fix this, configure your reverse proxy to
allow `POST` requests to the `/_mintlify/api/request` path.

Expand All @@ -92,7 +92,7 @@

2. **OpenAPI spec inheritance**: If using nested navigation, ensure child groups inherit the correct OpenAPI spec or specify their own.

3. **Validation issues**: Use `mint openapi-check <path-to-openapi-file>` to verify your OpenAPI document is valid.
3. **Validation issues**: Use `mint validate` to verify your OpenAPI document is valid.
</Accordion>
<Accordion title="Some OpenAPI operations appear in navigation but others don't">

Expand Down
132 changes: 132 additions & 0 deletions cli/analytics.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
---
title: "Analyze your documentation"
description: "View traffic, search queries, feedback, and assistant conversations from the terminal using the Mintlify CLI."
keywords: ["mint analytics", "analytics", "CLI", "stats", "feedback", "conversations"]
---

The `mint analytics` command gives you access to your [documentation analytics](/optimize/analytics) from the terminal. This is useful for scripting analytics reports, piping data into other tools, and quick checks without opening the dashboard.

## Prerequisites

You must log in to use analytics commands. Run `mint login` to authenticate with your Mintlify account.

See [Preview locally](/cli/preview#log-in-for-search-and-assistant) for details on authentication.

## View key metrics

Display a summary of views, visitors, searches, feedback, and assistant usage:

```bash
mint analytics stats
```

Use flags to filter by date range, page, or traffic source:

- `--from`: Start date in `YYYY-MM-DD` format. Defaults to 7 days ago.
- `--to`: End date in `YYYY-MM-DD` format. Defaults to today.
- `--page`: Filter to a specific page path.
- `--humans`: Show only human traffic.
- `--agents`: Show only AI traffic.

```bash Example analytics stats flags
mint analytics stats --from 2025-01-01 --to 2025-01-31
mint analytics stats --page /quickstart
mint analytics stats --humans
mint analytics stats --agents
```

## View search analytics

See what your users are searching for, with hit counts and click-through rates:

```bash
mint analytics search
```

Use flags to filter by query string or page:

- `--query`: Filter by search query substring.

Check warning on line 48 in cli/analytics.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

cli/analytics.mdx#L48

Did you really mean 'substring'?
- `--page`: Filter to a specific page path.

```bash Example analytics search flags
mint analytics search --query "authentication"

mint analytics search --page /api-reference
```

## View feedback

Review feedback submitted by users on your documentation pages:

```bash
mint analytics feedback
```

Use flags to aggregate feedback by page, or filter to code snippet feedback:

- `--type`: Aggregate feedback by page or code snippet. Defaults to page.
- `--page`: Filter to a specific page path.

```bash Example analytics feedback flags
mint analytics feedback --type page
mint analytics feedback --type code
```

## View assistant conversations

List recent conversations and conversation category buckets from the AI assistant:

```bash
mint analytics conversation list
mint analytics conversation buckets list
```

Each list output includes an ID for each entry. Pass that ID to the corresponding `view` command to see full details:

```bash
mint analytics conversation view <conversation-id>
mint analytics conversation buckets view <bucket-id>
```

## Choose an output format

All analytics commands default to `plain` output, which is tab-separated and suitable for piping to other tools. Use `--format` to change the output:

```bash
mint analytics stats --format table # Pretty-printed table with colors
mint analytics stats --format json # Raw JSON
mint analytics stats --format graph # Horizontal bar chart
```

Use the `--agent` flag for JSON output. The CLI auto-detects agent environments when the `CLAUDECODE` environment variable is `1`.

## Set defaults with config

To avoid repeating common flags, set defaults with `mint config`. The configuration saves in `~/.config/mintlify/config.json`.

Available configuration keys:

| Key | Description |
| --- | --- |
| `subdomain` | Default subdomain for analytics commands. |
| `dateFrom` | Default start date for analytics queries (`YYYY-MM-DD`). |
| `dateTo` | Default end date for analytics queries (`YYYY-MM-DD`). |

```bash Example configs
mint config set subdomain my-docs
mint config set dateFrom 2025-01-01
```

Once set, analytics commands use these values automatically:

```bash
# Uses the configured subdomain and dateFrom without flags
mint analytics stats
```

To view or clear a value, run:

```bash
mint config get subdomain
mint config clear subdomain
```
Loading
Loading