Skip to main content
Glama
README.md
# tai-wrapped

> **Local-first Spotify Wrapped CLI, MCP server, and offline 6-slide Story generator for AI coding agents.**

Zero external runtime dependencies (`"dependencies": {}`), 100% offline JSONL/SQLite parsing, zero raw prompt leaks.

## Supported Agent CLIs (8 Adapters)

| Agent | Local Telemetry Source |
| :--- | :--- |
| **Antigravity (`agy`)** | `~/.gemini/antigravity-cli/brain/*/transcript.jsonl` |
| **Claude Code** | `~/.claude/projects/**/*.jsonl` (deduplicated by `message.id`) |
| **OpenAI Codex CLI** | `~/.codex/sessions/**/*.jsonl` (`last_token_usage` deltas) |
| **OpenCode** | `~/.local/share/opencode/opencode.db` (read-only `node:sqlite`) |
| **Gemini CLI** | `~/.gemini/tmp/*/chats/*.{json,jsonl}` |
| **Cline & Roo Code** | `~/.cline/data/sessions/*/*.messages.json` + VS Code globalStorage |
| **Cursor Agent** | `~/.cursor/projects/*/agent-transcripts/*.jsonl` |
| **Aider** | `~/.aider.chat.history.md` & `<cwd>/.aider.chat.history.md` |

## Recommended Local Install (Sandbox-Safe, No `git` Required)

Install once into `~/.local/share/tai-wrapped` and `~/.local/bin/tai-wrapped`:

```bash
curl -fsSL https://raw.githubusercontent.com/ThinkAI-Studio/tai-wrapped/main/install.sh | sh
node "$HOME/.local/share/tai-wrapped/bin/tai-wrapped.mjs" --year 2026 --html ./tai-wrapped-2026.html --json
```

> Why local install instead of `npx github:...`? Sandboxed agent CLIs such as Codex CLI often block outbound `git` subprocesses inside `npx github:`, causing silent `exit 128` failures. Installing from the HTTPS tarball runs **100% offline (~45ms startup)** afterwards.

HTTPS tarball fallback via `npx` (no `git` binary needed):

```bash
npx -y https://codeload.github.com/ThinkAI-Studio/tai-wrapped/tar.gz/refs/heads/main --year 2026 --html ./tai-wrapped-2026.html
```

Or paste the ready-to-run **Agent Prompt** from [thinkai.id.vn/wrapped](https://thinkai.id.vn/wrapped) straight into Claude Code, Codex, Antigravity, OpenCode, or Cursor.

## MCP Server Configuration (`stdio`)

Supports both NDJSON (`\n`) and `Content-Length` stdio framing, plus `mcp` and `--mcp`:

```json
{
  "mcpServers": {
    "tai-wrapped": {
      "command": "node",
      "args": ["/home/YOUR_USER/.local/share/tai-wrapped/bin/tai-wrapped.mjs", "mcp"]
    }
  }
}
```

Tools exposed:
- `get_wrapped_summary` — Redacted aggregate metrics (tokens, cache hit rate, streaks, chronotype, archetype)
- `get_tool_dna` — Top autonomous tool calls & hourly distribution
- `export_wrapped_story` — Self-contained 6-slide HTML Story + client-side 1200x630 PNG poster exporter

## License

MIT © ThinkAI Studio