# Sidekick CLI The Sidekick CLI follows Claude Code, Codex, and OpenCode sessions in a full-screen terminal dashboard, and answers what they cost from one-shot commands such as `sidekick quota`, `sidekick blocks`, and `sidekick daily` — standalone, no VS Code required. It reads and writes the same `~/.config/sidekick/` data files as the VS Code extension (see [Shared Data Layer](#shared-data-layer)). ![The Sidekick CLI dashboard following a live session](../images/demo/v1/cli-dashboard.gif) !!! warning "Package name vs binary name" The npm package is `sidekick-agent-hub`, but the binary it installs is called **`sidekick`**. After installation, run `sidekick dashboard` — not `sidekick-agent-hub`. ## Installation ```bash npm install -g sidekick-agent-hub ``` Requires **Node.js 20+**. Reading compressed Codex sessions (`.jsonl.zst`, which Codex writes for older sessions) needs Node 22.15 or later (built-in zstd); older Node versions skip them. Or build from source: ```bash bash scripts/build-all.sh ``` This compiles `sidekick-shared` (the data access library) and `sidekick-cli` (the binary). The CLI is output to `sidekick-cli/dist/sidekick-cli.mjs`. ### Update notifications When a newer `sidekick-agent-hub` is on npm, one-shot commands such as `sidekick quota` end with a notice on stderr (since 0.30.1): ```text Update available: sidekick 0.30.0 → 0.30.1 — run npm install -g sidekick-agent-hub Release notes: https://github.com/cesarandreslopez/sidekick-agent-hub/releases/tag/v0.30.1 ``` - npm is asked at most every 4 hours; the answer, including a failed attempt, is cached in `update-check.json`. The request runs alongside the command and gives up after 2 seconds, so most runs only read the cache. - The same version is announced at most twice a day (every 12 hours); a newer one is announced right away. - The notice never appears with `--json`, when stdout or stderr is piped or redirected, in CI (`CI` set), or from `statusline` and `mcp`. The `dashboard` shows the newer version in its status bar instead. - The cache-only commands (`today`, `history`) and `--offline` runs show what is already cached but never ask npm. - `SIDEKICK_NO_UPDATE_NOTIFIER=1` (or the cross-tool `NO_UPDATE_NOTIFIER=1`) turns it off. ## Quick Start 1. `cd` into your project directory 2. Run `sidekick dashboard` 3. Pick a session from the list; the picker appears when the project already has sessions, and the dashboard auto-detects your project path and session provider 4. Press `?` to see all keybindings If you have sessions from multiple providers, the most recently active one is selected automatically. Override with `--provider`. ## Command Reference ```bash sidekick dashboard [options] ``` | Flag | Description | | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------- | | `--project ` | Override project path (default: current working directory) | | `--provider ` | Session provider: `claude-code`, `opencode`, `codex`, or `auto` (default) | | `--session ` | Follow a specific session by ID and start pinned to it (default: most recent or session picker) | | `--replay` | Replay existing events from the beginning before streaming live | | `--no-mouse` | Start with mouse capture disabled so terminal text selection works (toggle with `M`) | | `--no-color` | Disable colored output for any command (also honors `NO_COLOR`) | | `--offline` | Price from the cached catalog only; never refresh it over the network (also `SIDEKICK_OFFLINE=1`) | | `--output-file ` | Write everything a command prints to stdout into a file, without colour codes (not for `dashboard`, `mcp` or `map --follow`) | | `--json` | Output as JSON; a global flag honoured by the one-shot commands below | ### Examples ```bash # Launch for the current directory sidekick dashboard # Monitor a specific project sidekick dashboard --project ~/code/my-app # Force Claude Code as the provider sidekick dashboard --provider claude-code # Follow a specific session with full replay sidekick dashboard --session abc123 --replay ``` ## Session Dump ```bash sidekick dump [options] ``` Dump session data as a text timeline, JSON metrics, or markdown report for sharing or archiving. | Flag | Description | | ---------------- | ------------------------------------------------------ | | `--list` | List available session IDs for the current project | | `--csv` | With `--list`, print the session table as CSV | | `--limit ` | Maximum sessions listed with `--list` (default: 50) | | `--format ` | Output format: `text` (default), `json`, or `markdown` | | `--width ` | Terminal width for text output (default: auto-detect) | | `--expand` | Show all events including noise | | `--session ` | Target a specific session (default: most recent) | | `--prompts` | Dump human prompts grouped by session (see below) | Global flags `--project`, `--provider`, and `--json` also apply (see above); `--json` on a non-list dump is the same as `--format json`. Token totals count every billed bucket (input, output, cache writes, and cache reads), each API response or call once, and cost figures name their provenance (provider-reported or estimated from catalog pricing). When the session spawned subagents, text and markdown output add a **Subagents (n)** line (markdown also gets a per-agent **Subagent Tokens** table) and a **Session total (incl. subagents)**. JSON output adds a `tokenSummary` block with `mainThread`, `subagents`, `subagentTotal`, and `combined` (main thread plus subagents). ### Examples ```bash # Dump the latest session as plain text sidekick dump # Export as markdown for sharing sidekick dump --format markdown > session-report.md # Full JSON export for tooling sidekick dump --format json > session.json ``` ### Prompts by session `sidekick dump --prompts` prints every prompt a person typed in a Claude Code or Codex session, grouped by session, so a whole session can be read or classified (intent, conflict, issues) at once. It uses the same human-prompt rule and fail-closed working-directory scope as `collectPromptHistory()` in `sidekick-shared`: prompts are untruncated, and slash commands appear as typed. Harness output, subagents, and SDK programs are left out. | Flag | Description | | ---------------- | ----------------------------------------------------------------------------------------------------------- | | `--session ` | One session by id or unique prefix (default: the most recent session with prompts) | | `--all` | Every session of this project and its git worktrees, most recent first; cannot be combined with `--session` | | `--since