opencode-credit-dashboard 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,91 @@
1
+ # opencode-credit-dashboard
2
+
3
+ Credit usage dashboard plugin for [OpenCode](https://github.com/sst/opencode).
4
+
5
+ Shows per-account quota, token usage (input/output/thinking), daily cost breakdown, and enable/disable toggles for Antigravity accounts. Syncs data across devices via Firebase.
6
+
7
+ ## Features
8
+
9
+ - **Per-account quota display** — see remaining quota for Gemini Pro, Flash, and Claude across all accounts
10
+ - **Token breakdown** — input, output, and thinking tokens per session and model
11
+ - **Daily cost tracking** — cost and token usage aggregated by day
12
+ - **Model usage cards** — sortable by tokens, cost, or messages
13
+ - **Multi-device sync** — Firebase Realtime Database keeps data in sync across machines
14
+ - **Account management** — enable/disable accounts, set nicknames for devices
15
+ - **Session browser** — view all sessions with cost and token details
16
+ - **Auto-refresh** — live updates every 15 seconds
17
+
18
+ ## Installation
19
+
20
+ ### Option A — Via plugin-updater (recommended)
21
+
22
+ If you have [opencode-plugin-updater](https://github.com/intisy/opencode-plugin-updater) installed, add this entry to `~/.config/opencode/config/plugins.json`:
23
+
24
+ ```json
25
+ {
26
+ "name": "opencode-credit-dashboard",
27
+ "url": "https://github.com/intisy/opencode-credit-dashboard.git",
28
+ "install": null,
29
+ "build": null,
30
+ "bundle": null,
31
+ "output": "credit-dashboard.js",
32
+ "pluginFile": "credit-dashboard.js",
33
+ "autoUpdate": true
34
+ }
35
+ ```
36
+
37
+ Restart OpenCode. The updater will clone the repo and deploy the plugin automatically.
38
+
39
+ ### Option B — npm
40
+
41
+ Add the package to your `~/.config/opencode/opencode.json`:
42
+
43
+ ```jsonc
44
+ {
45
+ "plugins": ["opencode-credit-dashboard@latest"]
46
+ }
47
+ ```
48
+
49
+ Restart OpenCode.
50
+
51
+ ### Option C — Manual
52
+
53
+ ```bash
54
+ mkdir -p ~/.config/opencode/repos/intisy/opencode-credit-dashboard
55
+ git clone https://github.com/intisy/opencode-credit-dashboard.git ~/.config/opencode/repos/intisy/opencode-credit-dashboard
56
+ cp ~/.config/opencode/repos/intisy/opencode-credit-dashboard/credit-dashboard.js ~/.config/opencode/plugins/credit-dashboard.js
57
+ ```
58
+
59
+ Register the plugin in `~/.config/opencode/opencode.json`:
60
+
61
+ ```jsonc
62
+ {
63
+ "plugins": {
64
+ "credit-dashboard": "./plugins/credit-dashboard.js"
65
+ }
66
+ }
67
+ ```
68
+
69
+ ## Firebase Sync (optional)
70
+
71
+ To enable multi-device sync, place a Firebase service account JSON file at:
72
+
73
+ ```
74
+ ~/.config/opencode/plugins/firebase-service-account.json
75
+ ```
76
+
77
+ Without this file, the dashboard works in local-only mode.
78
+
79
+ ## Usage
80
+
81
+ The plugin exposes a `credit_dashboard` tool. Ask OpenCode:
82
+
83
+ ```
84
+ Show me my credit dashboard
85
+ ```
86
+
87
+ This opens a web dashboard at `http://localhost:3456` with full analytics.
88
+
89
+ ## License
90
+
91
+ MIT