From 691f27301c648526cd6cb4864bbe5a91bf7b885f Mon Sep 17 00:00:00 2001 From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com> Date: Tue, 7 Apr 2026 18:35:00 +0000 Subject: [PATCH] Update CLI analytics and login docs for project auto-resolution and simplified flags Generated-By: mintlify-agent --- cli/analytics.mdx | 22 ++++++++++++++++------ cli/commands.mdx | 9 ++++----- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/cli/analytics.mdx b/cli/analytics.mdx index 35fd27659..9b518d1ac 100644 --- a/cli/analytics.mdx +++ b/cli/analytics.mdx @@ -20,19 +20,15 @@ Display a summary of views, visitors, searches, feedback, and assistant usage: 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 @@ -98,7 +94,21 @@ 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`. +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 +``` + + + After running `mint login`, the CLI prompts you to select a default project. If your account only has one project, it is set automatically. + ## Set defaults with config diff --git a/cli/commands.mdx b/cli/commands.mdx index a79dd2b93..cd909b254 100644 --- a/cli/commands.mdx +++ b/cli/commands.mdx @@ -42,6 +42,8 @@ mint login 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. + --- ## `mint logout` @@ -76,11 +78,10 @@ All subcommands accept these shared flags: | 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` @@ -93,8 +94,6 @@ mint analytics stats [flags] | Flag | Description | | --- | --- | | `--page` | Filter to a specific page path. | -| `--humans` | Show only human traffic. | -| `--agents` | Show only AI agent traffic. | ### `mint analytics search`