{
  "markdown": "# fleets\n\nTerminal CLI for [Fleets](https://fleets.run). Per-site commands mirror the app UI tabs at `https://fleets.run/app/<slug>/<tab>`.\n\n## Install\n\n```bash\nnpm install -g fleets\n```\n\n## Authenticate\n\n```bash\nfleets login\n```\n\nPicks between two methods:\n\n1. **browser (default)** — device flow: CLI prints a URL + 8-character code, auto-opens your browser, you click **authorize**, CLI finishes automatically.\n2. **paste a token** — mint one in app → account → cli, paste it in.\n\nSkip the prompt with a flag:\n\n```bash\nfleets login --browser     # force device flow\nfleets login --paste       # force token paste\n\nfleets login --token fl_xxxxxxxxxxxxxxxx   # paste in one shot (CI)\nexport FLEETS_TOKEN=fl_xxxxxxxxxxxxxxxx     # skip login entirely\n```\n\n## Slug-first dispatch\n\nThe most intuitive way to run commands is to put the site slug first, like you're \"inside\" that site:\n\n```bash\nfleets fightbets                         # GA4 summary (defaults to stats)\nfleets fightbets sources                 # top traffic sources\nfleets fightbets funnel session_start view   # conversion funnel\nfleets fightbets seo --range 30d         # GSC summary, last 30 days\nfleets fightbets open settings           # print app URL\n```\n\nThe legacy form `fleets <command> <slug>` (e.g. `fleets sources fightbets`) still works.\n\n## Commands\n\n### Setup\n\n| Command | Description |\n|---|---|\n| `fleets login` | Browser device-flow auth (no paste) |\n| `fleets add <domain> [--detect]` | Create a site; `--detect` auto-links GA4 + GSC |\n| `fleets connect <slug>` | Auto-detect GA4 + GSC via service account |\n| `fleets connect <slug> --property <id>` | Set GA4 property explicitly |\n| `fleets connect <slug> --gsc <site-url>` | Set GSC site explicitly |\n\n### Analytics (per-site)\n\nAll accept `--range` (default `7d`) and `--json`. Commands with top-N tables also accept `--limit`.\n\n| Command | Tab | Data source |\n|---|---|---|\n| `fleets list` | — | All your sites with sparkline + Δ7d |\n| `fleets <slug>` / `fleets stats <slug>` | day | GA4 summary |\n| `fleets <slug> sources` | sources | GA4 traffic sources |\n| `fleets <slug> campaigns` | campaigns | GA4 UTM campaigns |\n| `fleets <slug> referrals` | referrals | GA4 referrals |\n| `fleets <slug> landers` | landers | GA4 landing pages |\n| `fleets <slug> events` | events | GA4 events |\n| `fleets <slug> users` | users | GA4 country + device breakdown |\n| `fleets <slug> funnel <step1> <step2>…` | funnel | GA4 funnel |\n| `fleets <slug> seo` | seo | Google Search Console |\n| `fleets <slug> edge` | edge | Cloudflare Analytics |\n| `fleets <slug> speed` | speed | PageSpeed Insights |\n\n### Utility\n\n| Command | Description |\n|---|---|\n| `fleets <slug> export` | Daily GA4 CSV/JSON export |\n| `fleets <slug> query \"<text>\"` | Natural-language analytics query |\n| `fleets <slug> open [tab]` | Print the app URL for a site |\n\n## MCP server\n\nThe same package ships an [MCP](https://modelcontextprotocol.io) server, `fleets-mcp`,\nso agents (Claude Code, Claude Desktop, Cursor, …) can pull your live Fleets\nanalytics as tools. It reuses the CLI's auth — run `fleets login` once (or set\n`FLEETS_TOKEN`) and the MCP server picks up the same token from `~/.fleets/config.json`.\n\n### Add it to a client\n\nClaude Code:\n\n```bash\nclaude mcp add fleets -- fleets-mcp\n```\n\nClaude Desktop / Cursor (`claude_desktop_config.json` or `.cursor/mcp.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"fleets\": {\n      \"command\": \"fleets-mcp\"\n    }\n  }\n}\n```\n\nNo global install? Use `npx` with the [`fleets-mcp`](https://www.npmjs.com/package/fleets-mcp) launcher package:\n\n```json\n{\n  \"mcpServers\": {\n    \"fleets\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"fleets-mcp\"]\n    }\n  }\n}\n```\n\nIf you authenticate via env instead of `fleets login`, add\n`\"env\": { \"FLEETS_TOKEN\": \"fl_xxx\" }` to the server entry.\n\n### Tools\n\nAll read-only except `log_change` (writes a change-log entry). Every analytics\ntool takes a `slug` (from `list_sites`) and an optional `range` (`7d`, `30d`, `24h`).\n\n| Tool | What it returns |\n|---|---|\n| `list_sites` | All sites + connected sources (GA4 / Cloudflare / GSC) — start here |\n| `stats` | GA4 summary: sessions, users, pageviews, events, engagement, bounce |\n| `sources` · `campaigns` · `referrals` · `landers` · `events` | GA4 breakdowns (accept `limit`) |\n| `users` · `devices` · `demographics` | GA4 audience breakdowns |\n| `funnel` | GA4 conversion funnel across `steps` (2+) |\n| `seo` | Google Search Console summary |\n| `edge` | Cloudflare edge analytics (bots, humans, cache) |\n| `speed` | PageSpeed Insights + Core Web Vitals |\n| `insights` | AI-ready signals worth investigating (optionally per `site`) |\n| `ask` | Natural-language question answered server-side with citations |\n| `log_change` · `recall` | Write / read the per-site change log |\n\n## Environment variables\n\n| Variable | Description |\n|---|---|\n| `FLEETS_TOKEN` | Personal access token. Skip `fleets login` entirely — useful for CI. Overrides `~/.fleets/config.json`. |\n\n## Range format\n\nAll `--range` flags accept:\n\n- `7d` — last 7 days\n- `30d` — last 30 days\n- `90d` — last 90 days\n- `24h` — last 24 hours (rounds to 1 day)\n\n## Requirements\n\n- Node.js >= 22 (LTS)\n- Works on macOS, Linux, Windows\n",
  "bytes": 5210,
  "sha": "24480b7d77433e3b9ed3725445c25d254dfb63ce3fe51b45069d5db924923299",
  "repo_slug": "runfleets/cli",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_runfleets_cli_d5260fef/readme"
}