lol-cli
A terminal-based League of Legends stats client backed by a secure, multi-region Riot API integration layer.
4 platform clusters
Regions routed
7 integrated
API endpoints
24 hours
Cache TTL
macOS + Windows
Distribution
lol-cli is a full-featured, interactive terminal UI (TUI) for exploring League of Legends player statistics. Beyond the interface, it's built on a small but properly engineered API integration layer: regional request routing across Riot's platform clusters, centralized authentication, status-code-aware error handling, and a local caching layer that respects rate limits — the same patterns used in production API client design, applied to a personal project.
Highlights
- Interactive, mouse- and keyboard-driven terminal UI built with Node.js
- Live game viewer showing real-time champion, role, and game-time data
- Detailed match history with KDA graphs, gold generation, items, and runes
- Champion mastery lookups and a full scrollable match timeline view
- Packaged as standalone, distributable executables for macOS (ARM64) and Windows (x64)
Architecture & Infrastructure
Multi-region API routing
Riot's API is split across regional platform clusters (Americas, Asia, Europe, SEA). lol-cli maps a player's server region to the correct platform cluster automatically, so match history, account lookups, and live-game data are always routed to the right endpoint.
Centralized auth & request pipeline
All outbound requests flow through a single configured HTTP client with a request interceptor that injects the API credential — one controlled choke point instead of scattering auth logic across every call site.
Secrets kept out of source control
The Riot API key is loaded exclusively from environment variables (never hardcoded). The app fails fast with a clear error if the key is missing, and .env is explicitly git-ignored so credentials can never be committed by accident.
Status-code-aware error handling
Errors are handled per HTTP status rather than generically — invalid/forbidden keys, missing resources, and 'not currently in a game' (404 on the live-game endpoint) are each handled distinctly, so the UI can degrade gracefully instead of crashing on expected cases.
Local caching layer with TTL
Static game-data assets (champions, items, runes, summoner spells, queue types) are cached to disk with a 24-hour expiry, cutting redundant calls to Riot's data services and keeping the app well within API rate limits during heavy use.
Cross-platform distribution
Packaged into standalone native binaries for macOS (ARM64) and Windows (x64) — end users run a single executable with no Node.js runtime or dependency installation required.