Lightweight desktop dashboard for your OpenCode usage — tokens, costs, charts.
Tauri v2 · ~10 MB .exe · ~30 MB RAM · EN/IT
⬇️ Download v0.1.7 — Windows setup + portable .exe.
| 📊 | Input/output tokens, cost, cache — daily, weekly, all-time |
| 📈 | Line, bar & donut charts, top models, recent sessions |
| 🎛️ | Per-provider filters, Combined / Split views, brand icons |
| 👤 | Customizable profile (photo, name, bio), light/dark theme |
| 🌍 | English + Italian interface |
| 🔒 | 100% local: read-only DB access, no keys, no auth, no telemetry |
Install & release notes
Download OpenCode Stats_*_x64-setup.exe (recommended) or the .msi from
Releases.
Requires Windows 10/11 x64 with WebView2 (usually preinstalled) and OpenCode
used at least once (the app reads its local database).
The app is not code-signed: Windows shows "unknown publisher" — that's expected. On SmartScreen: "More info → Run anyway".
v0.1.7 — Content Security Policy enabled; TypeScript pinned to exact 6.0.3; backend call timeouts; automated CI (frontend + Tauri builds). v0.1.6 — fixed provider-filter crash (backend/frontend field naming mismatch); selection stats hardened against shape drift. v0.1.5 — "OpenCode is not installed" screen with IT/EN switch; readable sub-dollar cost axis; Terzastella publisher + custom installer icons; release build scrubbed of machine paths.
How data works
It reads ~/.local/share/opencode/opencode.db read-only (OPENCODE_DB_PATH override —
on Windows: %USERPROFILE%\.local\share\opencode\opencode.db):
message.data(JSON:role/providerID/modelID/tokens/cost) → KPIs, daily/weekly, per-provider splitsession(cost/tokens_*aggregates) → recent sessions list
Providers used through OpenCode (opencode/*, ollama/*, lmstudio/*, llama.cpp/*, …)
are filterable with Combined / Split views and stable per-provider colors.
The app is OpenCode-only: it only reads its database — no API keys, no auth, no network (localhost only). Original files are only ever read. No telemetry of any kind.
Development & build
npm install
npm run tauri dev # app + hot reload (live data from your opencode.db)Without Tauri (npm run dev) the UI shows a warning because Rust invokes are unavailable.
npm run dev + ?demo opens a demo dataset (also handy for screenshots).
npm run tauri build
# -> src-tauri/target/release/opencode-stats.exe
# -> src-tauri/target/release/bundle/nsis/OpenCode Stats_0.1.7_x64-setup.exe (+ .msi)For published releases, build with scripts/build-release.ps1 instead: same output,
but scrubs build-machine paths from the binary via --remap-path-prefix.
Note: if you change icons or
tauri.conf.jsonand the exe doesn't pick them up, deletesrc-tauri/target/release/build/opencode-stats-*/before rebuilding: Tauri's build script (Windows resources/icons) doesn't always re-run on its own and would link stale resources.cargo clean -palone is not enough.
Project structure & legal
src-tauri/src/stats.rs— read-only SQLite queries +db_info/session_list/dashboard/selection_statscommandssrc/lib/—api.ts,types.ts,format.ts,profile.ts(localStorageprofile),providers.ts(stable provider colors),brand.tsx(provider logos),i18n.ts(EN/IT),demo.ts(?demodataset)src/App.tsx— dashboard: KPIs, ECharts charts (tokens/cost/per-provider bars+donut), top models, sessions- Silent refresh every 30 s (pausable) + refresh on focus, light/dark theme, Daily (14 d) / Weekly (8 wks) / All ranges
Provider icons come from Simple Icons v16.30.0 (CC0, bundled locally — no external loading). Additional marks vectorized from official sources: OpenCode brand (MIT project, also for Zen), Groq logo and Cerebras logo via Wikimedia Commons (referential use: they only identify the token source in your statistics). All trademarks belong to their respective owners.
🇮🇹 Versione italiana — English sopra · ⬇️ Download v0.1.7
Dashboard desktop leggera (Tauri v2, .exe ~10 MB, ~30 MB RAM) per le statistiche di
utilizzo di OpenCode: input/output tokens, costo, viste giornaliere/settimanali/tutto,
grafici e tabelle, profilo personalizzabile, interfaccia EN/IT.
| 📊 | Token input/output, costi, cache — giornaliero, settimanale, tutto |
| 📈 | Grafici linee, barre e torta, top modelli, sessioni recenti |
| 🎛️ | Filtri per provider, viste Sommati / Singoli, loghi brand |
| 👤 | Profilo personalizzabile (foto, nome, bio), tema chiaro/scuro |
| 🌍 | Interfaccia inglese + italiano |
| 🔒 | 100% locale: sola lettura DB, niente chiavi, niente telemetria |
Installazione e note di release
Scarica OpenCode Stats_*_x64-setup.exe (consigliato) o il .msi dalle
Release.
Richiede Windows 10/11 x64 con WebView2 (di solito già presente) e OpenCode
già usato almeno una volta (l'app legge il suo database locale).
L'app non è firmata digitalmente: Windows mostra "autore sconosciuto" — è normale. Su SmartScreen: "Ulteriori informazioni → Esegui comunque".
v0.1.7 — Content Security Policy attivata; TypeScript pinnato alla 6.0.3; timeout sulle chiamate backend; CI automatica (build frontend + Tauri). v0.1.6 — corretto il crash alla selezione di un provider (nomi dei campi disallineati tra backend e frontend); statistiche di selezione più robuste. v0.1.5 — schermata "OpenCode non installato" con selettore IT/EN; tacche leggibili sull'asse dei costi sotto il dollaro; publisher Terzastella + icone installer; build release ripulita dai percorsi macchina.
Come funzionano i dati
Legge in read-only ~/.local/share/opencode/opencode.db (override con OPENCODE_DB_PATH —
su Windows: %USERPROFILE%\.local\share\opencode\opencode.db):
message.data(JSON:role/providerID/modelID/tokens/cost) → KPI, daily/weekly, split per providersession(aggregaticost/tokens_*) → lista sessioni recenti
I provider usati via OpenCode (opencode/*, ollama/*, lmstudio/*, llama.cpp/*, …)
sono filtrabili con vista Sommati / Singoli e colori stabili per provider.
L'app è dedicata a OpenCode: legge solo il suo database, niente chiavi API, niente auth, niente rete (solo localhost). I file originali sono sempre e solo letti. Nessuna telemetria di alcun tipo.
Sviluppo e build
npm install
npm run tauri dev # app + hot reload (dati live dal tuo opencode.db)Senza Tauri (npm run dev) l'UI mostra un avviso perché gli invoke Rust non sono disponibili.
npm run dev + ?demo apre un dataset dimostrativo (comodo anche per screenshot).
npm run tauri build
# -> src-tauri/target/release/opencode-stats.exe
# -> src-tauri/target/release/bundle/nsis/OpenCode Stats_0.1.7_x64-setup.exe (+ .msi)Per le release pubblicate, compila invece con scripts/build-release.ps1: stesso output,
ma ripulisce i percorsi della macchina di build dal binario via --remap-path-prefix.
Nota: se cambi icone o
tauri.conf.jsone l'exe non li recepisce, cancellasrc-tauri/target/release/build/opencode-stats-*/prima di rebuildare: lo script di build di Tauri (risorse Windows/icons) non sempre si ri-esegue da solo e linkerebbe risorse vecchie.cargo clean -pda solo non basta.
Struttura progetto e note legali
src-tauri/src/stats.rs— query SQLite read-only + comandidb_info/session_list/dashboard/selection_statssrc/lib/—api.ts,types.ts,format.ts,profile.ts(profilo inlocalStorage),providers.ts(colori stabili per provider),brand.tsx(loghi provider),i18n.ts(EN/IT),demo.ts(dataset?demo)src/App.tsx— dashboard: KPI, grafici ECharts (token/costo/per-provider barre+torta), top modelli, sessioni- Refresh silenzioso ogni 30 s (pausabile) + refresh su focus, tema chiaro/scuro, range Giornaliero (14 gg) / Settimanale (8 sett) / Tutto
Le icone dei provider vengono da Simple Icons v16.30.0 (CC0, bundle locale — nessun caricamento esterno). Marchi aggiuntivi vettorializzati dalle fonti ufficiali: OpenCode brand (progetto MIT, anche per Zen), logo Groq e logo Cerebras da Wikimedia Commons (uso referenziale: identificano solo la sorgente dei token nelle tue statistiche). Tutti i marchi citati appartengono ai rispettivi proprietari.



