Skip to content
Closed
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
22 changes: 16 additions & 6 deletions cli/analytics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,15 @@
mint analytics stats
```

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

- `--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
Expand All @@ -45,7 +41,7 @@

Use flags to filter by query string or page:

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

Check warning on line 44 in cli/analytics.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

cli/analytics.mdx#L44

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

```bash Example analytics search flags
Expand Down Expand Up @@ -98,7 +94,21 @@
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`.
When running in an AI agent environment, the CLI automatically defaults to `json` output.

## Project resolution

The CLI resolves your project automatically. When you run an analytics command, the CLI checks for a `--subdomain` flag first, then falls back to any value set with `mint config set subdomain`, and finally resolves the project from your authenticated account.

If your account has access to multiple projects and you haven't set a default, pass `--subdomain` explicitly or set one with `mint config`:

```bash
mint config set subdomain my-docs
```

<Tip>
After running `mint login`, the CLI prompts you to select a default project. If your account only has one project, it is set automatically.

Check warning on line 110 in cli/analytics.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

cli/analytics.mdx#L110

In general, use active voice instead of passive voice ('is set').
</Tip>

## Set defaults with config

Expand Down
9 changes: 4 additions & 5 deletions cli/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@

Opens a browser window to complete authentication. If the browser does not open, the CLI displays a URL to open manually and a prompt to paste the authorization code. Credentials save in `~/.config/mintlify/config.json`.

After a successful login, the CLI prompts you to select a default project for analytics commands. If your account only has one project, it is set automatically.

Check warning on line 45 in cli/commands.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

cli/commands.mdx#L45

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

---

## `mint logout`
Expand Down Expand Up @@ -76,11 +78,10 @@

| Flag | Description |
| --- | --- |
| `--subdomain` | Documentation subdomain. Defaults to the value set with `mint config set subdomain`. |
| `--subdomain` | Documentation subdomain. Resolved automatically from config or your authenticated account. |
| `--from` | Start date in `YYYY-MM-DD` format. Defaults to 7 days ago, or the value set with `mint config set dateFrom`. |
| `--to` | End date in `YYYY-MM-DD` format. Defaults to today, or the value set with `mint config set dateTo`. |
| `--format` | Output format: `plain` (default), `table`, `json`, or `graph`. |
| `--agent` | Output JSON. Equivalent to `--format json`. Also activated automatically when the `CLAUDECODE` environment variable equals `1`. |
| `--format` | Output format: `plain` (default), `table`, `json`, or `graph`. Defaults to `json` in AI agent environments. |

### `mint analytics stats`

Expand All @@ -93,8 +94,6 @@
| Flag | Description |
| --- | --- |
| `--page` | Filter to a specific page path. |
| `--humans` | Show only human traffic. |
| `--agents` | Show only AI agent traffic. |

### `mint analytics search`

Expand All @@ -106,7 +105,7 @@

| Flag | Description |
| --- | --- |
| `--query` | Filter by search query substring. |

Check warning on line 108 in cli/commands.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

cli/commands.mdx#L108

Did you really mean 'substring'?
| `--page` | Filter by top clicked page. |

### `mint analytics feedback`
Expand Down Expand Up @@ -142,7 +141,7 @@
| --- | --- |
| `--page` | Filter conversations that reference a specific page in sources. |

#### `mint analytics conversation view <conversation-id>`

Check warning on line 144 in cli/commands.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

cli/commands.mdx#L144

'````' should use sentence-style capitalization.

View a single conversation by ID. Use `mint analytics conversation list` to get IDs.

Expand All @@ -158,7 +157,7 @@
mint analytics conversation buckets list
```

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

Check warning on line 160 in cli/commands.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

cli/commands.mdx#L160

'````' should use sentence-style capitalization.

View conversations in a category bucket. Use `mint analytics conversation buckets list` to get IDs.

Expand All @@ -176,7 +175,7 @@
mint config <subcommand> <key> [value]
```

| Subcommand | Description |

Check warning on line 178 in cli/commands.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

cli/commands.mdx#L178

Use 'subcommands?' instead of 'Subcommand'.
| --- | --- |
| `set <key> <value>` | Set a configuration value. |
| `get <key>` | Display a configuration value. |
Expand Down Expand Up @@ -242,7 +241,7 @@
| `--local-schema` | Allow validation of locally hosted OpenAPI files served over HTTP. Only supports HTTPS in production. |

<Note>
The standalone `mint openapi-check` command is deprecated. Use `mint validate` instead.

Check warning on line 244 in cli/commands.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

cli/commands.mdx#L244

In general, use active voice instead of passive voice ('is deprecated').
</Note>

---
Expand Down Expand Up @@ -328,7 +327,7 @@

## Telemetry

The CLI collects anonymous usage telemetry to help improve Mintlify. Telemetry data includes the command name, CLI version, operating system, and architecture. Mintlify does **not** collect personally identifiable information, project content, or file paths.

Check warning on line 330 in cli/commands.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

cli/commands.mdx#L330

Did you really mean 'informat'?

By default, the CLI collects telemetry data. You can opt out at any time using the `--telemetry` flag:

Expand Down
Loading