# tmux-llm-dashboard — Multi-Provider LLM Quota & Headroom Tmux Pane — Complete AI & LLM Reference Corpus (`llms-full.txt`) - Repository: https://github.com/mohan-n-swamy/tmux-llm-dashboard - Web Discovery URL: https://mohan-n-swamy.github.io/repos/tmux-llm-dashboard/ - License: MIT - Keywords: tmux, llm, claude-code, token-usage, cost-monitoring, terminal-dashboard, cli, ai-agents, shell, developer-tools --- ## File: `AI-README.md` — AI-README.md --- repo: "mohan-n-swamy/tmux-llm-dashboard" title: "tmux-llm-dashboard — Multi-Provider LLM Quota & Headroom Tmux Pane" license: "MIT" keywords: [tmux, llm, claude-code, token-usage, cost-monitoring, terminal-dashboard, cli, ai-agents, shell, developer-tools] capabilities: - "Sub-15ms cached rendering (`status.sh --all` / `--watch `) with Gruvbox truecolor ANSI formatting." - "Global refresh-attempt backoff and stale-lock reclamation (`LOCK_STALE_AFTER=120s`) preventing background curl stampedes." - "Modular provider helpers (`helpers/codex-quota.sh`, `gemini-ultra-quota.sh`, `glm-quota.sh`, `deepseek-balance.sh`, `usage-line.sh`)." - "Zero-credential terminal preview via `bash helpers/demo-preview.sh`." when_to_use: - "A fast, zero-daemon `zsh`/`bash` tmux dashboard that displays live subscription quota headroom, prepaid API balances, 7-day token spend, git branch state, and SSH/TCP host probes across Claude, Gemini, Codex, GLM, and DeepSeek without blocking terminal repaints." - "Engineers running multiple AI coding subscriptions hit 5-hour or weekly quota walls mid-refactor because usage sits buried across four separate billing web pages, while naive statusbar scripts curl APIs synchronously and freeze tmux. `tmux-llm-dashboard` renders instantaneously from tiny state files and refreshes stale providers asynchronously behind lockfiles." inputs_required: - "MMS_STATE_DIR: Directory storing cached row values and refresh locks" - "MMS_HOSTS: Space-separated `label:host:port` entries for TCP reachability probes" - "MMS_TZ: IANA timezone for the dashboard clock row" quickstart: - "brew install mohan-n-swamy/tap/tmux-llm-dashboard" - "bash helpers/demo-preview.sh" - "./install.sh" --- # tmux-llm-dashboard — Multi-Provider LLM Quota & Headroom Tmux Pane — Machine-Readable Agent Guide A fast, zero-daemon `zsh`/`bash` tmux dashboard that displays live subscription quota headroom, prepaid API balances, 7-day token spend, git branch state, and SSH/TCP host probes across Claude, Gemini, Codex, GLM, and DeepSeek without blocking terminal repaints. Engineers running multiple AI coding subscriptions hit 5-hour or weekly quota walls mid-refactor because usage sits buried across four separate billing web pages, while naive statusbar scripts curl APIs synchronously and freeze tmux. `tmux-llm-dashboard` renders instantaneously from tiny state files and refreshes stale providers asynchronously behind lockfiles. Key modules and entry points in this repository: - `status.sh`: Nine-row zsh renderer, pane tracker, staleness badge calculator, and lock manager - `helpers/`: Provider-specific quota/balance refreshers plus `demo-preview.sh` - `install.sh`: Tmux keybinding and helper setup script Every organization-specific value enters through `.env` (copied from `.env.example`) or external adapter files. No source edit is needed to change organization names, endpoints, database URLs, webhook secrets, or thresholds. When a human asks an AI coding agent to deploy or adapt `tmux-llm-dashboard` into their stack: 1. Add a new 15-line script in `helpers/-quota.sh` writing a single line to `$MMS_STATE_DIR/..cache` and register it in `refresh_caches()`. - Product Requirements: `docs/PRD.md` - Working-Backwards PR-FAQ: `docs/PR-FAQ.md` - High-Level Architecture: `docs/HLD.md` - Low-Level Interfaces & Runbook: `docs/LLD.md` - Coding Agent Rules: `AGENTS.md` --- ## File: `.env.example` — Environment Contract (.env.example) ```ini # tmux-llm-dashboard — Multi-Provider LLM Quota & Headroom Tmux Pane — Environment Contract # Copy to .env and set values for your organization. # Directory storing cached row values and refresh locks MMS_STATE_DIR=~/.local/state/tmux-llm-dashboard # Space-separated `label:host:port` entries for TCP reachability probes MMS_HOSTS=worker:127.0.0.1:22 # IANA timezone for the dashboard clock row MMS_TZ=UTC ``` --- ## File: `AGENTS.md` — AGENTS.md # AGENTS.md — tmux-llm-dashboard — Multi-Provider LLM Quota & Headroom Tmux Pane Read this file first before modifying `tmux-llm-dashboard`. ## Purpose A fast, zero-daemon `zsh`/`bash` tmux dashboard that displays live subscription quota headroom, prepaid API balances, 7-day token spend, git branch state, and SSH/TCP host probes across Claude, Gemini, Codex, GLM, and DeepSeek without blocking terminal repaints. ## Commands ```bash brew install mohan-n-swamy/tap/tmux-llm-dashboard bash helpers/demo-preview.sh ./install.sh ``` ## Module Map - `status.sh`: Nine-row zsh renderer, pane tracker, staleness badge calculator, and lock manager - `helpers/`: Provider-specific quota/balance refreshers plus `demo-preview.sh` - `install.sh`: Tmux keybinding and helper setup script ## Invariants 1. Keep all organization names, credentials, domains, and thresholds in `.env` or external config files. Never hardcode company names, host IPs, or secrets in source files. 2. Deterministic business logic belongs in code and lookup tables, not inside LLM prompts. 3. Update `docs/HLD.md`, `docs/LLD.md`, and `.env.example` in the same commit whenever an interface or environment variable changes. 4. Run the repository smoke check and secret scan before opening a pull request. --- ## File: `docs/PRD.md` — Product Requirements Document (docs/PRD.md) # Product Requirements Document — tmux-llm-dashboard — Multi-Provider LLM Quota & Headroom Tmux Pane A fast, zero-daemon `zsh`/`bash` tmux dashboard that displays live subscription quota headroom, prepaid API balances, 7-day token spend, git branch state, and SSH/TCP host probes across Claude, Gemini, Codex, GLM, and DeepSeek without blocking terminal repaints. ## 1. Problem Engineers running multiple AI coding subscriptions hit 5-hour or weekly quota walls mid-refactor because usage sits buried across four separate billing web pages, while naive statusbar scripts curl APIs synchronously and freeze tmux. `tmux-llm-dashboard` renders instantaneously from tiny state files and refreshes stale providers asynchronously behind lockfiles. ## 2. Users and Jobs-to-be-Done | Persona | Job-to-be-Done | |---|---| | Terminal / Tmux AI Developer | See remaining 5-hour and weekly quota headroom at a glance before starting a heavy multi-file build. | | Multi-Host Operator | Monitor remote worker node reachability (`MMS_HOSTS`) alongside LLM balances in a compact 9-row side pane. | ## 3. Core Capabilities - Sub-15ms cached rendering (`status.sh --all` / `--watch `) with Gruvbox truecolor ANSI formatting. - Global refresh-attempt backoff and stale-lock reclamation (`LOCK_STALE_AFTER=120s`) preventing background curl stampedes. - Modular provider helpers (`helpers/codex-quota.sh`, `gemini-ultra-quota.sh`, `glm-quota.sh`, `deepseek-balance.sh`, `usage-line.sh`). - Zero-credential terminal preview via `bash helpers/demo-preview.sh`. ## 4. Configurable Inputs Adopters configure the system for their own organization without editing core application logic: | Variable | Default / Example | Purpose | |---|---|---| | `MMS_STATE_DIR` | `~/.local/state/tmux-llm-dashboard` | Directory storing cached row values and refresh locks | | `MMS_HOSTS` | `worker:127.0.0.1:22` | Space-separated `label:host:port` entries for TCP reachability probes | | `MMS_TZ` | `UTC` | IANA timezone for the dashboard clock row | ## 5. Phasing and Stability Exit Criteria 1. **Phase 1 (Local Synthetic Run):** Clone the repository, copy `.env.example` to `.env`, and run the quickstart commands against synthetic seed data. Exit criterion: smoke checks pass with zero external credentials. 2. **Phase 2 (Read-Only Shadow Wiring):** Connect read-only credentials or webhook listeners in shadow/dry-run mode. Exit criterion: 100 consecutive events or queries reconcile cleanly against source records. 3. **Phase 3 (Production Cutover):** Enable live writes, alerts, or routing behind bounded retry and idempotency guards. ## 6. Non-Goals - Shipping organization-specific business rules hardcoded in application source. - Storing credentials, personal customer records, or tenant URLs inside version control. - Replacing deterministic validation or arithmetic with unconstrained model prompts. --- ## File: `docs/PR-FAQ.md` — Working-Backwards PR-FAQ (docs/PR-FAQ.md) # Working-Backwards PR-FAQ — tmux-llm-dashboard — Multi-Provider LLM Quota & Headroom Tmux Pane **Release Summary:** `tmux-llm-dashboard` gives engineering and operations teams a self-hosted, open-source implementation of tmux-llm-dashboard — Multi-Provider LLM Quota & Headroom Tmux Pane that configures via `.env` and runs on standard infrastructure in minutes. ## Press Release Operations and engineering teams often rebuild the same internal workflows behind closed doors or pay per-seat SaaS markups for rigid tools that cannot match their field reality. `tmux-llm-dashboard` open-sources a battle-tested implementation of tmux-llm-dashboard — Multi-Provider LLM Quota & Headroom Tmux Pane, stripped of all single-company assumptions and packaged with clear adapter boundaries, synthetic demo data, and machine-readable agent documentation. Any team can fork `tmux-llm-dashboard`, supply their own `.env` inputs and taxonomy config, and deploy locally or in production with Docker, Python, or Node. AI coding assistants such as Claude Code, Codex, and Cursor can read `AI-README.md` and `llms.txt` to wire custom ERP, CRM, or warehouse adapters in a single session. ## External Adopter FAQ **Q1: How long does it take to run locally after cloning?** Under five minutes. Copy `.env.example` to `.env` and run the quickstart commands in `README.md`. Synthetic fixtures let you inspect the workflow before connecting live credentials. **Q2: Do I need to rewrite source files to use my own company name, channels, or rules?** No. Organization names, endpoints, thresholds, and credentials sit in `.env` and declarative config files. External system specifics live behind narrow adapter modules documented in `docs/LLD.md`. **Q3: What license governs this repository?** MIT License. You can fork, modify, self-host, and use it commercially without restriction. ## Internal Engineering & Security FAQ **Q4: How do we prevent tenant or employer data from ever entering a public fork?** The repository starts from a clean git history, excludes raw exports and binary dumps, validates every commit through `gitleaks`, and ships only synthetic fixtures. **Q5: What happens when an upstream API or model provider is slow or unavailable?** Inbound webhooks persist raw payloads before processing, outbound writes carry idempotency keys with bounded exponential backoff, and model-backed paths fail open to deterministic rules or explicit human queues. --- ## File: `docs/HLD.md` — High-Level Design (docs/HLD.md) # High-Level Design (HLD) — tmux-llm-dashboard — Multi-Provider LLM Quota & Headroom Tmux Pane A fast, zero-daemon `zsh`/`bash` tmux dashboard that displays live subscription quota headroom, prepaid API balances, 7-day token spend, git branch state, and SSH/TCP host probes across Claude, Gemini, Codex, GLM, and DeepSeek without blocking terminal repaints. ## 1. System Topology ```mermaid flowchart LR Tmux["tmux --watch pane"] --> Status["status.sh (<15ms read)"] Status --> Cache["MMS_STATE_DIR/*.cache"] Status -.->|"async if >300s"| Helpers["helpers/*-quota.sh"] Helpers --> Cache ``` ## 2. Architectural Decisions and Rejected Alternatives | Decision | Why It Holds | Rejected Alternative | |---|---|---| | Decouple paint from network refresh | Guarantees instant tmux redraws even when an upstream billing API is down or slow. | Synchronous `curl` inside `status-right` | | Plain tab/line cache files in `~/.local/state` | Any external hook (such as Claude Code statusline JSON) can write quota updates without IPC daemons. | Background SQLite/Redis server | ## 3. Data Flow and Failure Boundaries 1. **Configuration Boundary:** Startup validates `.env` variables and declarative config schemas before accepting traffic or running scheduled jobs. 2. **Adapter Boundary:** External services (databases, chat channels, HRMS, warehouses, or LLM providers) sit behind explicit adapter modules so failures stay isolated and testable with local mocks. 3. **Observability and Audit:** State transitions and job executions emit structured logs and deterministic status records rather than mutating state silently. ## 4. Scaling Notes - **1x to 10x load:** Single-node Docker Compose or process supervisor handles standard team workloads with indexed database queries and bounded worker concurrency. - **First bottleneck at 10x+:** High-frequency webhook or batch ingestion queues; mitigate by separating the stateless HTTP receiver from background worker processes sharing Redis or PostgreSQL locks. --- ## File: `docs/LLD.md` — Low-Level Design & Runbook (docs/LLD.md) # Low-Level Design (LLD) & Operations Runbook — tmux-llm-dashboard — Multi-Provider LLM Quota & Headroom Tmux Pane This document defines the module responsibilities, environment contract, and operational procedures for `tmux-llm-dashboard`. ## 1. Module and File Inventory | Path | Responsibility | |---|---| | `status.sh` | Nine-row zsh renderer, pane tracker, staleness badge calculator, and lock manager | | `helpers/` | Provider-specific quota/balance refreshers plus `demo-preview.sh` | | `install.sh` | Tmux keybinding and helper setup script | ## 2. Environment Variable Contract | Variable | Default / Example | Required | Description | |---|---|---|---| | `MMS_STATE_DIR` | `~/.local/state/tmux-llm-dashboard` | Yes | Directory storing cached row values and refresh locks | | `MMS_HOSTS` | `worker:127.0.0.1:22` | Yes | Space-separated `label:host:port` entries for TCP reachability probes | | `MMS_TZ` | `UTC` | Yes | IANA timezone for the dashboard clock row | ## 3. Extension Recipe 1. Add a new 15-line script in `helpers/-quota.sh` writing a single line to `$MMS_STATE_DIR/..cache` and register it in `refresh_caches()`. ## 4. Operations Runbook ### 1. Preview rendered dashboard without live keys ```bash bash helpers/demo-preview.sh ``` ### 2. Force asynchronous cache refresh ```bash zsh status.sh --refresh ``` --- ## File: `docs/RESEARCH-2026.md` — 2026 Research & Landscape Notes (docs/RESEARCH-2026.md) # 2026 Multi-Subscription LLM Quota Pacing Research ## 1. Multi-Pool Pacing Across Coding Subscriptions With 2026 coding workflows spanning rolling 5-hour windows + 7-day caps (Claude Max), daily family pools (Gemini Ultra / Antigravity), and token-metered APIs (DeepSeek, GLM), pacing work across subscriptions prevents mid-task context switches. Unlike single-tool statuslines (`ccusage`), `tmux-llm-dashboard` unifies subscription windows, prepaid balances, git state, and remote host probes inside one zero-latency terminal pane. ## 2. Non-Blocking Terminal Design - **Strict Read/Refresh Split:** Paint reads local files in `<15ms`; expired caches trigger a detached background job guarded by directory locks and global retry backoff. - **Zero-Credential Preview (`helpers/demo-preview.sh`):** Lets new adopters inspect layout and ANSI palette before wiring provider credentials.