From 331cdc0ca15b7de1d591a5d5bd45ee06098514f7 Mon Sep 17 00:00:00 2001 From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 18:57:57 +0000 Subject: [PATCH] Document mint analytics and mint config CLI commands Generated-By: mintlify-agent --- installation.mdx | 105 +++++++++++++++++++++++++++++++++++++++++ optimize/analytics.mdx | 4 ++ 2 files changed, 109 insertions(+) diff --git a/installation.mdx b/installation.mdx index 68eca503e..70b80b2f3 100644 --- a/installation.mdx +++ b/installation.mdx @@ -342,6 +342,111 @@ mint upgrade See [Global settings](/organize/settings) for more information about `docs.json`. +### View analytics + +View analytics data for your documentation site directly from the command line. You must be authenticated with `mint login` before using analytics commands. + +```bash +mint analytics +``` + +The `analytics` command has the following subcommands: + +| Subcommand | Description | +| --- | --- | +| `stats` | Display KPI numbers including views, visitors, searches, and feedback. | +| `search` | Display search query analytics with hit counts and click-through rates. | +| `feedback` | Display user feedback on documentation pages. | +| `conversation list` | List assistant conversations. | +| `conversation view ` | View a single assistant conversation by ID. | +| `conversation buckets list` | List conversation category buckets. | +| `conversation buckets view ` | View conversations in a specific bucket. | + +All analytics subcommands accept the following flags: + +| Flag | Description | Default | +| --- | --- | --- | +| `--subdomain` | Documentation subdomain. | Value from `mint config get subdomain`, or auto-detected. | +| `--from` | Start date in `YYYY-MM-DD` format. | 7 days ago, or value from `mint config get dateFrom`. | +| `--to` | End date in `YYYY-MM-DD` format. | Today, or value from `mint config get dateTo`. | +| `--format` | Output format: `table` (pretty), `plain` (pipeable, default), `json` (raw API response), or `graph` (bar charts). | `plain` | +| `--agent` | Agent-friendly output, equivalent to `--format json`. Also activates automatically when the `CLAUDECODE` environment variable is set to `1`. | `false` | + +Some subcommands accept additional flags: + +| Subcommand | Flag | Description | +| --- | --- | --- | +| `stats` | `--agents` | Show only agent traffic. | +| `stats` | `--humans` | Show only human traffic. | +| `stats` | `--page` | Filter to a specific page path. | +| `search` | `--query` | Filter by search query substring. | +| `search` | `--page` | Filter by top clicked page. | +| `feedback` | `--type` | Feedback type: `code` (code snippets) or `page` (page-level aggregation). | +| `feedback` | `--page` | Filter to a specific page path. | +| `conversation list` | `--page` | Filter conversations mentioning this page in sources. | + +For example, to view a summary of your documentation analytics for the last 30 days: + +```bash +mint analytics stats --from 2025-03-01 --to 2025-03-31 +``` + +To see what your users are searching for: + +```bash +mint analytics search --format table +``` + +To export analytics data as JSON for further processing: + +```bash +mint analytics stats --format json +``` + + + Use `--format json` or `--agent` to get machine-readable output that you can pipe into other tools like `jq`. + + +### Manage CLI configuration + +Set default values for CLI commands using `mint config`. Configuration is stored in `~/.mintlify/config.json`. + +```bash +mint config +``` + +| Subcommand | Description | +| --- | --- | +| `set ` | Set a configuration value. | +| `get ` | Get a configuration value. | +| `clear ` | Remove a configuration value. | + +The following configuration keys are available: + +| Key | Description | Used by | +| --- | --- | --- | +| `subdomain` | Default documentation subdomain. | `mint analytics` | +| `dateFrom` | Default start date for analytics queries (`YYYY-MM-DD`). | `mint analytics` | +| `dateTo` | Default end date for analytics queries (`YYYY-MM-DD`). | `mint analytics` | + +For example, to set a default subdomain so you don't need to pass `--subdomain` on every analytics command: + +```bash +mint config set subdomain my-docs +``` + +To check the current value: + +```bash +mint config get subdomain +``` + +To remove a saved value: + +```bash +mint config clear subdomain +``` + ### Check version Display the current CLI and client version: diff --git a/optimize/analytics.mdx b/optimize/analytics.mdx index c325fe2b0..63a301d2a 100644 --- a/optimize/analytics.mdx +++ b/optimize/analytics.mdx @@ -6,6 +6,10 @@ keywords: ["analytics","metrics","page views","traffic","trends","insights"] The [analytics](https://dashboard.mintlify.com/products/analytics/v2/) page in your dashboard shows data about visitors to your docs, how they interact with the assistant, what they search for, and their feedback. Use this information to identify which pages are most valuable to your users and track trends over time. + + You can also access analytics data from the command line using `mint analytics`. See the [CLI reference](/installation#view-analytics) for details. + + ## Filter by AI or human visitors Filter your analytics data by traffic source to analyze AI agent traffic separately from human visitors.