How fernandalumin/superlight works
SuperLight is a local Codex usage collector and cost dashboard, with optional HTTP forwarding. The workflow is: configure Codex to send OTLP events and use the local proxy; the server receives events, usage normalization filters and deduplicates completed responses, and SQLite persists a private ledger. Pricing and calendar aggregation produce summaries for the CLI and local dashboard, while the macOS menu-bar app presents today’s estimate and dashboard. The README documents export, bilingual UI, and optional upstream proxy; unsampled relationships are omitted unless documented or visible in excerpts.
Main entry points: server.py Local server · store.py SQLite ledger · pricing.py Price estimates · cli.py CLI commands
Components 15
Desktop experience
- Menu bar app
native/SuperLight.swift - Dashboard UI
superlight/web/app.js - Dashboard page
superlight/web/index.html
Collection and forwarding
- Local server
superlight/server.py - HTTP forwarding
superlight/proxy.py
Usage ledger
- OTLP normalizer
superlight/usage.py - SQLite ledger
superlight/store.py
Cost and reporting
- Price estimates
superlight/pricing.py - Price catalog
superlight/prices.json - Period aggregation
superlight/dashboard.py - CLI commands
superlight/cli.py
Other components
- Codex user
- Codex CLI
- Optional upstream proxy
- Local browser
Connections 21
- Codex user → Menu bar app: uses
README.md - Codex user → Codex CLI: configures
README.md - Codex CLI → Local server: posts OTLP
README.md - Codex CLI → HTTP forwarding: forwards traffic
README.md - Menu bar app → Local server: queries status
README.md - Local server → OTLP normalizer: normalizes events
superlight/server.py - Local server → HTTP forwarding: dispatches traffic
superlight/server.py - HTTP forwarding → Optional upstream proxy: forwards optionally
README.md - Local server → SQLite ledger: persists usage
superlight/server.py - OTLP normalizer → SQLite ledger: provides events
- CLI commands → Local server: starts service
superlight/cli.py - Price estimates → Price catalog: loads rates
superlight/pricing.py - Price estimates → SQLite ledger: reads records
superlight/pricing.py - Period aggregation → Price estimates: summarizes costs
superlight/dashboard.py - Period aggregation → SQLite ledger: reads records
superlight/dashboard.py - Local server → Period aggregation: serves dashboard data
superlight/server.py - Local browser → Local server: requests dashboard
README.md - Local server → Dashboard UI: serves interface
- Dashboard UI → Dashboard page: renders page
- CLI commands → Price estimates: summarizes estimates
superlight/cli.py - CLI commands → SQLite ledger: exports records
superlight/cli.py