@slkiser/opencode-quota 3.6.1 → 3.7.1

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.
Files changed (49) hide show
  1. package/README.md +369 -292
  2. package/dist/lib/config.d.ts +1 -1
  3. package/dist/lib/config.d.ts.map +1 -1
  4. package/dist/lib/config.js +83 -1
  5. package/dist/lib/config.js.map +1 -1
  6. package/dist/lib/copilot.d.ts.map +1 -1
  7. package/dist/lib/copilot.js +8 -0
  8. package/dist/lib/copilot.js.map +1 -1
  9. package/dist/lib/crof-config.d.ts +2 -2
  10. package/dist/lib/crof-config.d.ts.map +1 -1
  11. package/dist/lib/crof-config.js +7 -4
  12. package/dist/lib/crof-config.js.map +1 -1
  13. package/dist/lib/format.d.ts.map +1 -1
  14. package/dist/lib/format.js +2 -45
  15. package/dist/lib/format.js.map +1 -1
  16. package/dist/lib/init-installer.d.ts +4 -1
  17. package/dist/lib/init-installer.d.ts.map +1 -1
  18. package/dist/lib/init-installer.js +179 -42
  19. package/dist/lib/init-installer.js.map +1 -1
  20. package/dist/lib/provider-metadata.js +1 -1
  21. package/dist/lib/provider-metadata.js.map +1 -1
  22. package/dist/lib/quota-entry-display.d.ts +5 -0
  23. package/dist/lib/quota-entry-display.d.ts.map +1 -0
  24. package/dist/lib/quota-entry-display.js +45 -0
  25. package/dist/lib/quota-entry-display.js.map +1 -0
  26. package/dist/lib/tui-compact-format.d.ts +8 -0
  27. package/dist/lib/tui-compact-format.d.ts.map +1 -0
  28. package/dist/lib/tui-compact-format.js +175 -0
  29. package/dist/lib/tui-compact-format.js.map +1 -0
  30. package/dist/lib/tui-native-provider-quota.d.ts +7 -0
  31. package/dist/lib/tui-native-provider-quota.d.ts.map +1 -0
  32. package/dist/lib/tui-native-provider-quota.js +25 -0
  33. package/dist/lib/tui-native-provider-quota.js.map +1 -0
  34. package/dist/lib/tui-panel-state.d.ts +15 -1
  35. package/dist/lib/tui-panel-state.d.ts.map +1 -1
  36. package/dist/lib/tui-panel-state.js +13 -0
  37. package/dist/lib/tui-panel-state.js.map +1 -1
  38. package/dist/lib/tui-runtime.d.ts +28 -1
  39. package/dist/lib/tui-runtime.d.ts.map +1 -1
  40. package/dist/lib/tui-runtime.js +140 -29
  41. package/dist/lib/tui-runtime.js.map +1 -1
  42. package/dist/lib/types.d.ts +14 -0
  43. package/dist/lib/types.d.ts.map +1 -1
  44. package/dist/lib/types.js +10 -0
  45. package/dist/lib/types.js.map +1 -1
  46. package/dist/tui.d.ts +0 -1
  47. package/dist/tui.d.ts.map +1 -1
  48. package/dist/tui.tsx +383 -45
  49. package/package.json +1 -1
package/README.md CHANGED
@@ -15,11 +15,11 @@
15
15
  <a href="./LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square" /></a>
16
16
  </p>
17
17
 
18
- [![OpenCode Quota sidebar](https://shawnkiser.com/opencode-quota/sidebar.webp)](https://github.com/slkiser/opencode-quota)
18
+ [![OpenCode Quota sidebar](https://shawnkiser.com/opencode-quota/opencode-quota-sidebar.webp)](https://github.com/slkiser/opencode-quota)
19
19
 
20
20
  ---
21
21
 
22
- ### Quick start
22
+ ## Install
23
23
 
24
24
  ```bash
25
25
  npx @slkiser/opencode-quota init
@@ -28,32 +28,88 @@ npx @slkiser/opencode-quota init
28
28
  > [!IMPORTANT]
29
29
  > OpenCode `>= 1.4.3` and Node.js `>= 18` are required.
30
30
 
31
- The installer is append-only: it adds the plugin, asks a few display/provider questions, and leaves existing values alone.
31
+ The installer adds missing plugin/config entries and keeps your unrelated settings. Re-running it updates only installer-owned Quota UI choices.
32
32
 
33
- After install:
33
+ ### What the installer asks
34
+
35
+ | Question | Pick this when you want... |
36
+ | --- | --- |
37
+ | Install scope | This repo/worktree only, or your global OpenCode config. |
38
+ | Quota UI | Sidebar panel, toasts, compact status line, terminal/slash-command only, or a mix. |
39
+ | Provider mode | Auto-detect providers, or choose a provider list yourself. |
40
+ | Quota reset periods | Show one reset period per provider, or all known reset periods. |
41
+ | Quota percentage meaning | Show quota remaining, or quota already used. |
42
+ | Session token details | Hide token counts for shorter output, or show them when available. |
43
+
44
+ ### After install
34
45
 
35
46
  1. Restart OpenCode.
36
47
  2. Run `/quota`.
37
48
  3. If something looks wrong, run `/quota_status`.
38
- 4. If you enabled the sidebar, open the session sidebar and look for the `Quota` panel.
49
+ 4. If you enabled the Sidebar panel, open the session sidebar and look for `Quota`.
50
+ 5. If you enabled Compact status line, look for the home-bottom quota line and the chat/session prompt quota line.
39
51
 
40
- Terminal-only check:
52
+ ### Terminal-only check
41
53
 
42
- Use `npx` when you want to run the published package without installing the binary first:
54
+ Run without installing the binary first:
43
55
 
44
56
  ```bash
45
57
  npx @slkiser/opencode-quota show
46
58
  ```
47
59
 
48
- Use `opencode-quota` directly when the package binary is already installed or on your `PATH`. Add `--provider` to show only one provider:
60
+ Or, if `opencode-quota` is already on your `PATH`:
49
61
 
50
62
  ```bash
51
63
  opencode-quota show --provider copilot
52
64
  ```
53
65
 
54
- ### Manual setup
66
+ ## What you get
67
+
68
+ - A `Quota` Sidebar panel in the TUI
69
+ - Popup quota toasts in OpenCode
70
+ - A Compact status line in the TUI
71
+ - `/quota` and `/quota_status` slash commands
72
+ - Token reports such as `/tokens_today` and `/tokens_weekly`
73
+ - Provider diagnostics for auth, quota sources, and pricing
74
+
75
+ <table>
76
+ <tr>
77
+ <td width="50%">
78
+ <img src="https://shawnkiser.com/opencode-quota/opencode-quota-sidebar.webp" alt="OpenCode Quota TUI sidebar panel" />
79
+ </td>
80
+ <td width="50%">
81
+ <img src="https://shawnkiser.com/opencode-quota/opencode-quota-toast.webp" alt="OpenCode Quota popup toast" />
82
+ </td>
83
+ </tr>
84
+ <tr>
85
+ <td width="50%" align="center">Sidebar panel</td>
86
+ <td width="50%" align="center">Toast</td>
87
+ </tr>
88
+ <tr>
89
+ <td width="50%">
90
+ <img src="https://shawnkiser.com/opencode-quota/opencode-quota-statusbar.webp" alt="OpenCode Quota TUI status line" />
91
+ </td>
92
+ <td width="50%">
93
+ <img src="https://shawnkiser.com/opencode-quota/opencode-quota-tokens-command.webp" alt="OpenCode Quota token report" />
94
+ </td>
95
+ </tr>
96
+ <tr>
97
+ <td width="50%" align="center">Compact status line</td>
98
+ <td width="50%" align="center"><code>/tokens_weekly</code> report</td>
99
+ </tr>
100
+ </table>
101
+
102
+ ## Manual setup
103
+
104
+ Use the installer when possible. For manual setup, use the same OpenCode config location you would pick in the installer:
105
+
106
+ - **Project install:** files live in your repo/worktree.
107
+ - **Global install:** files live in your OpenCode config directory, usually `~/.config/opencode`.
108
+ - If you set `OPENCODE_CONFIG_DIR`, use that directory instead.
109
+
110
+ ### 1. Add the server plugin (required)
55
111
 
56
- Add the server plugin to `opencode.json` or `opencode.jsonc`:
112
+ This enables providers, slash commands, terminal checks, and popup toasts. Add this to `opencode.json` or `opencode.jsonc`:
57
113
 
58
114
  ```jsonc
59
115
  {
@@ -62,7 +118,9 @@ Add the server plugin to `opencode.json` or `opencode.jsonc`:
62
118
  }
63
119
  ```
64
120
 
65
- If you also want the sidebar, add the same package to the `tui.json` or `tui.jsonc` file that OpenCode loads:
121
+ ### 2. Add the TUI plugin (for Sidebar panel or Compact status line)
122
+
123
+ If you want the Sidebar panel or Compact status line, also add this to `tui.json` or `tui.jsonc`:
66
124
 
67
125
  ```jsonc
68
126
  {
@@ -71,113 +129,101 @@ If you also want the sidebar, add the same package to the `tui.json` or `tui.jso
71
129
  }
72
130
  ```
73
131
 
74
- Quota settings go in `opencode-quota/quota-toast.json` next to the OpenCode config file you chose during install. Existing `experimental.quotaToast` settings still work when no sidecar file exists. Quota settings do not live in `tui.json`.
132
+ ### 3. Add quota settings
75
133
 
76
- <details>
77
- <summary><strong>Full configuration reference</strong></summary>
78
-
79
- #### Core/shared settings
80
-
81
- | Option | Default | Meaning |
82
- | ----------------------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
83
- | `enabled` | `true` | Master switch for quota collection and handled slash commands. When `false`, `/quota`, `/quota_status`, `/pricing_refresh`, and `/tokens_*` are handled as no-ops. |
84
- | `enabledProviders` | `"auto"` | Auto-detect providers, or set an explicit provider list. Unknown provider ids are reported under `config_errors` in `/quota_status`; an explicit list with no valid providers resolves to none instead of falling back to auto-detect. |
85
- | `minIntervalMs` | `300000` | Minimum fetch interval between provider updates. |
86
- | `requestTimeoutMs` | `5000` | Remote provider request timeout in milliseconds. Providers with custom defaults, such as Gemini CLI and OpenCode Go, keep their provider default unless this is explicitly configured. |
87
- | `formatStyle` | `singleWindow` | Shared quota-row style for popup toasts and the TUI sidebar: `singleWindow` or `allWindows`. Legacy `classic`/`grouped` aliases still work, and legacy `toastStyle` is still accepted on read for backward compatibility. |
88
- | `percentDisplayMode` | `remaining` | Shared percent meaning for popup toasts and the TUI sidebar: `remaining` renders labels like `81% left`; `used` renders labels like `19% used` or `125% used` when over quota. |
89
- | `onlyCurrentModel` | `false` | Filter quota rows to the current model/provider when that session selection can be resolved. |
90
- | `showSessionTokens` | `true` | Show the `Session input/output tokens` section in quota displays when session token data is available. |
91
- | `pricingSnapshot.source` | `"auto"` | Token pricing snapshot selection for `/tokens_*`: `auto`, `bundled`, or `runtime`. |
92
- | `pricingSnapshot.autoRefresh` | `7` | Refresh stale local pricing data after this many days. |
93
-
94
- `percentDisplayMode` affects popup toasts and the TUI sidebar only. `/quota` keeps its existing remaining-oriented percentage output.
95
-
96
- #### Toast settings
97
-
98
- | Option | Default | Meaning |
99
- | ----------------- | ------- | ------------------------------------------------------------------------------- |
100
- | `enableToast` | `true` | Show popup toasts. Disabling this does not disable `/quota` or the TUI sidebar. |
101
- | `toastDurationMs` | `9000` | Toast duration in milliseconds. |
102
- | `showOnIdle` | `true` | Show a toast on the idle trigger. |
103
- | `showOnQuestion` | `true` | Show a toast after a question/assistant response. |
104
- | `showOnCompact` | `true` | Show a toast after session compaction. |
105
- | `showOnBothFail` | `true` | Show a fallback toast when providers attempted quota reads and all failed. |
106
- | `layout.maxWidth` | `50` | Toast formatting width target. Ignored by the TUI sidebar. |
107
- | `layout.narrowAt` | `42` | Toast compact-layout breakpoint. Ignored by the TUI sidebar. |
108
- | `layout.tinyAt` | `32` | Toast tiny-layout breakpoint. Ignored by the TUI sidebar. |
109
- | `debug` | `false` | Append toast debug context when troubleshooting. |
110
-
111
- #### TUI sidebar setup
112
-
113
- If you want the `Quota` sidebar panel, you need the plugin in both OpenCode config surfaces:
114
-
115
- | File | What goes there | Needed for sidebar? |
116
- | ---------------------------------- | ------------------------------------- | ------------------------------- |
117
- | `tui.json` / `tui.jsonc` | `plugin: ["@slkiser/opencode-quota"]` | Yes |
118
- | `opencode.json` / `opencode.jsonc` | Server plugin entry | Yes |
119
- | `opencode-quota/quota-toast.json` | Quota settings | No, but controls quota behavior |
120
-
121
- #### Provider-specific settings
122
-
123
- | Option | Default | Meaning |
124
- | ---------------------------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------- |
125
- | `anthropicBinaryPath` | `"claude"` | Command/path used for local Claude CLI probing; override this for custom installs or shim locations. |
126
- | `googleModels` | `["CLAUDE"]` | Google model keys to query: `CLAUDE`, `G3PRO`, `G3FLASH`, `G3IMAGE`. |
127
- | `opencodeGoWindows` | `["rolling", "weekly", "monthly"]` | OpenCode Go usage windows to display. |
128
- | `alibabaCodingPlanTier` | `"lite"` | Fallback Alibaba Coding Plan tier when auth does not include `tier`. |
129
- | `cursorPlan` | `"none"` | Cursor included API budget preset: `none`, `pro`, `pro-plus`, `ultra`. |
130
- | `cursorIncludedApiUsd` | unset | Override Cursor monthly included API budget in USD. |
131
- | `cursorBillingCycleStartDay` | unset | Local billing-cycle anchor day `1..28`; when unset, Cursor usage resets on the local calendar month. |
134
+ Create or edit `opencode-quota/quota-toast.json` **next to the `opencode.json` / `tui.json` file above**. For a project install, that means:
132
135
 
133
- </details>
136
+ ```text
137
+ <your-repo>/opencode-quota/quota-toast.json
138
+ ```
139
+
140
+ Start with this, then adjust the UI choices in the next section:
141
+
142
+ ```jsonc
143
+ {
144
+ "enabledProviders": "auto",
145
+ "enableToast": true,
146
+ "tuiSidebarPanel": {
147
+ "enabled": true,
148
+ },
149
+ "tuiCompactStatus": {
150
+ "enabled": false,
151
+ },
152
+ }
153
+ ```
134
154
 
135
- ### What opencode-quota adds
155
+ > [!TIP]
156
+ > Run `/quota_status` to see the exact config paths OpenCode Quota loaded.
136
157
 
137
- - TUI sidebar panel with quota rows
138
- - Popup quota toasts after assistant responses
139
- - Manual `/quota`, `/quota_status`, and `/tokens_*` commands
140
- - Terminal `opencode-quota show` command for a quota-only quick glance
141
- - Local token reports using bundled and runtime `models.dev` pricing
142
- - Custom quota tracking for companion plugins
158
+ ## Choose your UI surfaces
143
159
 
144
- <table>
145
- <tr>
146
- <td width="50%">
147
- <img src="https://shawnkiser.com/opencode-quota/toast.webp" alt="OpenCode Quota popup toast" />
148
- </td>
149
- <td width="50%">
150
- <img src="https://shawnkiser.com/opencode-quota/token.webp" alt="OpenCode Quota token report" />
151
- </td>
152
- </tr>
153
- <tr>
154
- <td width="50%" align="center">Popup quota toast</td>
155
- <td width="50%" align="center"><code>/tokens_weekly</code> report</td>
156
- </tr>
157
- </table>
160
+ All UI surfaces use the same quota data. Put these settings in `opencode-quota/quota-toast.json`, not `tui.json`.
161
+
162
+ | UI surface | Config | Notes |
163
+ | --- | --- | --- |
164
+ | Sidebar panel | `tuiSidebarPanel.enabled: true` | Full `Quota` panel in OpenCode's session sidebar. Requires the TUI plugin entry above. |
165
+ | Toast | `enableToast: true` | Popup toast after idle/question/compact events. Requires the server plugin entry above. |
166
+ | Compact status line | `tuiCompactStatus.enabled: true` | Short text-only quota line at the home bottom and chat/session prompt locations, for example `Copilot 94% | OpenAI Pro 5h 100%, 7d 100%`. Requires the TUI plugin entry above. |
167
+ | Terminal/slash only | `enableToast: false`, `tuiSidebarPanel.enabled: false`, `tuiCompactStatus.enabled: false` | Keeps `/quota`, `/quota_status`, and terminal checks. |
168
+
169
+ Selecting Compact status line in the installer enables both compact surfaces by default. To keep compact status home-only, set `tuiCompactStatus.sessionPrompt: false`.
170
+
171
+ For more examples, see [Common configuration](#common-configuration). For every option, see [Full configuration reference](#full-configuration-reference).
172
+
173
+ ## Commands
158
174
 
159
- ### Providers
160
-
161
- | Provider | Auto setup? | Setup / plugin order | Quota source |
162
- | ------------------- | ---------------------------------------------------- | -------------------------------------------------------------- | ------------------------ |
163
- | Anthropic (Claude) | [Needs quick setup](#anthropic-claude-quick-setup) | Install and authenticate Claude CLI | Local CLI or OAuth usage |
164
- | GitHub Copilot | Usually automatic | Existing OpenCode auth, or optional PAT config | Remote API |
165
- | OpenAI | Automatic | Existing OpenCode OAuth | Remote API |
166
- | Cursor | [Needs quick setup](#cursor-quick-setup) | `["@playwo/opencode-cursor-oauth", "@slkiser/opencode-quota"]` | Local estimation |
167
- | Qwen Code | [Needs quick setup](#qwen-code-quick-setup) | `["opencode-qwencode-auth", "@slkiser/opencode-quota"]` | Local estimation |
168
- | Alibaba Coding Plan | Automatic | Existing OpenCode auth, global config, or env | Local estimation |
169
- | MiniMax Coding Plan | Automatic | Existing OpenCode auth, global config, or env | Remote API |
170
- | Kimi Code | Automatic | Existing OpenCode auth, global config, or env | Remote API |
171
- | Chutes AI | Usually automatic | Existing OpenCode auth, global config, or env | Remote API |
172
- | Crof.ai | Manual env/config | `CROF_API_KEY` or trusted user/global config | Remote API |
173
- | Synthetic | Automatic | Existing OpenCode auth, global config, or env | Remote API |
174
- | Google Antigravity | [Needs quick setup](#google-antigravity-quick-setup) | `["opencode-antigravity-auth", "@slkiser/opencode-quota"]` | Remote API |
175
- | Gemini CLI | [Needs quick setup](#gemini-cli-quick-setup) | `["opencode-gemini-auth", "@slkiser/opencode-quota"]` | Remote API |
176
- | Z.ai Coding Plan | Automatic | Existing OpenCode auth, global config, or env | Remote API |
177
- | NanoGPT | Usually automatic | Existing OpenCode auth, global config, or env | Remote API |
178
- | OpenCode Go | [Needs quick setup](#opencode-go-quick-setup) | Set workspace ID and `auth` cookie | Dashboard scraping |
179
-
180
- Providers are auto-detected by default. To choose providers explicitly, set `enabledProviders` in `opencode-quota/quota-toast.json`:
175
+ | Command | What it shows |
176
+ | --- | --- |
177
+ | `opencode-quota show` | Terminal quota-only quick glance |
178
+ | `/quota` | Detailed quota report |
179
+ | `/quota_status` | Config, provider, auth, pricing, and live probes |
180
+ | `/pricing_refresh` | Refresh local runtime pricing from `models.dev` |
181
+ | `/tokens_today` | Tokens used today |
182
+ | `/tokens_daily` | Tokens used in the last 24 hours |
183
+ | `/tokens_weekly` | Tokens used in the last 7 days |
184
+ | `/tokens_monthly` | Tokens used in the last 30 days, including pricing |
185
+ | `/tokens_all` | Tokens used across all local history |
186
+ | `/tokens_session` | Tokens used in the current session |
187
+ | `/tokens_session_all` | Current session plus descendant sessions |
188
+ | `/tokens_between` | Tokens used between `YYYY-MM-DD YYYY-MM-DD` |
189
+
190
+ ## Providers
191
+
192
+ Most providers work automatically. If a provider has a “Needs setup” link, open that setup note only if you use that provider.
193
+
194
+ | Provider | Setup | Quota source |
195
+ | --- | --- | --- |
196
+ | Anthropic (Claude) | [Needs setup](#anthropic-claude) | Local CLI or OAuth usage |
197
+ | GitHub Copilot | Usually automatic | Remote API |
198
+ | OpenAI | Automatic | Remote API |
199
+ | Cursor | [Needs setup](#cursor) | Local estimation |
200
+ | Qwen Code | [Needs setup](#qwen-code) | Local estimation |
201
+ | Alibaba Coding Plan | Automatic | Local estimation |
202
+ | MiniMax Coding Plan | Automatic | Remote API |
203
+ | Kimi Code | Automatic | Remote API |
204
+ | Chutes AI | Usually automatic | Remote API |
205
+ | Crof.ai | Manual env/config | Remote API |
206
+ | Synthetic | Automatic | Remote API |
207
+ | Google Antigravity | [Needs setup](#google-antigravity) | Remote API |
208
+ | Gemini CLI | [Needs setup](#gemini-cli) | Remote API |
209
+ | Z.ai Coding Plan | Automatic | Remote API |
210
+ | NanoGPT | Usually automatic | Remote API |
211
+ | OpenCode Go | [Needs setup](#opencode-go) | Dashboard scraping |
212
+
213
+ ## Common configuration
214
+
215
+ Customize these settings in `opencode-quota/quota-toast.json`, next to the OpenCode config for your install scope.
216
+
217
+ Common locations:
218
+
219
+ - Project install: `<your-repo>/opencode-quota/quota-toast.json`
220
+ - Global install: usually `~/.config/opencode/opencode-quota/quota-toast.json`
221
+ - Custom config dir: `$OPENCODE_CONFIG_DIR/opencode-quota/quota-toast.json`
222
+
223
+ If you are unsure, run `/quota_status`; it prints the config path it loaded.
224
+
225
+ <details>
226
+ <summary><strong>Choose providers explicitly</strong></summary>
181
227
 
182
228
  ```jsonc
183
229
  {
@@ -185,14 +231,10 @@ Providers are auto-detected by default. To choose providers explicitly, set `ena
185
231
  }
186
232
  ```
187
233
 
188
- ### Common Options
189
-
190
- Customize these settings in `opencode-quota/quota-toast.json`.
234
+ </details>
191
235
 
192
236
  <details>
193
- <summary><strong>Show every quota window</strong></summary>
194
-
195
- Instead of the default most-constrained window:
237
+ <summary><strong>Show all quota reset periods</strong></summary>
196
238
 
197
239
  ```jsonc
198
240
  {
@@ -203,48 +245,63 @@ Instead of the default most-constrained window:
203
245
  </details>
204
246
 
205
247
  <details>
206
- <summary><strong>Choose OpenCode Go windows</strong></summary>
207
-
208
- Choose which OpenCode Go windows to display:
248
+ <summary><strong>Show used percentages</strong></summary>
209
249
 
210
250
  ```jsonc
211
251
  {
212
- "opencodeGoWindows": ["rolling", "weekly", "monthly"],
252
+ "percentDisplayMode": "used",
213
253
  }
214
254
  ```
215
255
 
216
256
  </details>
217
257
 
218
258
  <details>
219
- <summary><strong>Show used percentages</strong></summary>
259
+ <summary><strong>Turn off popup toasts</strong></summary>
220
260
 
221
- Show percentages as used instead of remaining in toasts and the sidebar:
261
+ Keeps `/quota`, `/quota_status`, terminal checks, and any enabled UI surfaces.
222
262
 
223
263
  ```jsonc
224
264
  {
225
- "percentDisplayMode": "used",
265
+ "enableToast": false,
226
266
  }
227
267
  ```
228
268
 
229
269
  </details>
230
270
 
231
271
  <details>
232
- <summary><strong>Turn off popup toasts</strong></summary>
272
+ <summary><strong>Turn off the Sidebar panel</strong></summary>
233
273
 
234
- Keep `/quota` and the sidebar enabled:
274
+ Useful when you want Compact status line only, toasts only, or slash commands only.
235
275
 
236
276
  ```jsonc
237
277
  {
238
- "enableToast": false,
278
+ "tuiSidebarPanel": {
279
+ "enabled": false,
280
+ },
239
281
  }
240
282
  ```
241
283
 
242
284
  </details>
243
285
 
244
286
  <details>
245
- <summary><strong>Increase request timeout</strong></summary>
287
+ <summary><strong>Keep Compact status line on home only</strong></summary>
288
+
289
+ Useful when you want the compact line on the home screen but not in the chat/session prompt area.
290
+
291
+ ```jsonc
292
+ {
293
+ "tuiCompactStatus": {
294
+ "enabled": true,
295
+ "homeBottom": true,
296
+ "sessionPrompt": false,
297
+ },
298
+ }
299
+ ```
246
300
 
247
- Increase the remote provider request timeout from the default 5000ms. Providers with custom defaults, such as Gemini CLI and OpenCode Go, keep their provider default unless you set this.
301
+ </details>
302
+
303
+ <details>
304
+ <summary><strong>Increase provider request timeout</strong></summary>
248
305
 
249
306
  ```jsonc
250
307
  {
@@ -267,26 +324,75 @@ This is only for users who intentionally want `experimental.quotaToast` mirrored
267
324
 
268
325
  </details>
269
326
 
270
- ### Commands
327
+ ## Full configuration reference
328
+
329
+ Settings go in the same `opencode-quota/quota-toast.json` sidecar described above.
330
+
331
+ Existing `experimental.quotaToast` settings still work when no sidecar file exists. Quota settings do not live in `tui.json`.
332
+
333
+ <details>
334
+ <summary><strong>All settings</strong></summary>
335
+
336
+ ### Core/shared settings
337
+
338
+ | Option | Default | Meaning |
339
+ | --- | --- | --- |
340
+ | `enabled` | `true` | Master switch for quota collection and handled slash commands. When `false`, `/quota`, `/quota_status`, `/pricing_refresh`, and `/tokens_*` are handled as no-ops. |
341
+ | `enabledProviders` | `"auto"` | Auto-detect providers, or set an explicit provider list. |
342
+ | `minIntervalMs` | `300000` | Minimum fetch interval between provider updates. |
343
+ | `requestTimeoutMs` | `5000` | Remote provider request timeout in milliseconds. |
344
+ | `formatStyle` | `singleWindow` | Shared quota reset-period display for popup toasts and the Sidebar panel: `singleWindow` shows one reset period per provider; `allWindows` shows all reset periods per provider. Legacy `classic`/`grouped` aliases are still accepted. |
345
+ | `percentDisplayMode` | `remaining` | Shared quota percentage meaning for popup toasts and the Sidebar panel: `remaining` shows quota left; `used` shows quota consumed. `/quota` keeps its existing remaining-percent output. |
346
+ | `onlyCurrentModel` | `false` | Filter quota rows to the current model/provider when that session selection can be resolved. |
347
+ | `showSessionTokens` | `true` | Show the `Session input/output tokens` section when session token data is available. |
348
+ | `pricingSnapshot.source` | `"auto"` | Token pricing snapshot selection for `/tokens_*`: `auto`, `bundled`, or `runtime`. |
349
+ | `pricingSnapshot.autoRefresh` | `7` | Refresh stale local pricing data after this many days. |
350
+
351
+ ### Toast settings
352
+
353
+ | Option | Default | Meaning |
354
+ | --- | --- | --- |
355
+ | `enableToast` | `true` | Show popup toasts. Disabling this does not disable `/quota` or UI surfaces. |
356
+ | `toastDurationMs` | `9000` | Toast duration in milliseconds. |
357
+ | `showOnIdle` | `true` | Show a toast on the idle trigger. |
358
+ | `showOnQuestion` | `true` | Show a toast after a question/assistant response. |
359
+ | `showOnCompact` | `true` | Show a toast after session compaction. |
360
+ | `showOnBothFail` | `true` | Show a fallback toast when providers attempted quota reads and all failed. |
361
+ | `layout.maxWidth` | `50` | Toast formatting width target. |
362
+ | `layout.narrowAt` | `42` | Toast compact-layout breakpoint. |
363
+ | `layout.tinyAt` | `32` | Toast tiny-layout breakpoint. |
364
+ | `debug` | `false` | Append toast debug context when troubleshooting. |
365
+
366
+ ### TUI settings
367
+
368
+ | Option | Default | Meaning |
369
+ | --- | --- | --- |
370
+ | `tuiSidebarPanel.enabled` | `true` | Show the Sidebar `Quota` panel when the TUI plugin is installed. Default is `true` for backward compatibility. |
371
+ | `tuiCompactStatus.enabled` | `false` | Opt in to Compact status line UI surfaces. |
372
+ | `tuiCompactStatus.homeBottom` | `true` | Show the Compact status line at the home bottom location. |
373
+ | `tuiCompactStatus.sessionPrompt` | `true` | Show the Compact status line by wrapping the TUI session prompt. Disable this if you only want the home-bottom line. |
374
+ | `tuiCompactStatus.suppressWhenNativeProviderQuota` | `true` | Hide the Compact status line when OpenCode exposes native provider-quota support. |
375
+ | `tuiCompactStatus.maxWidth` | `96` | Maximum Compact status line text width. |
376
+
377
+ ### Provider-specific settings
378
+
379
+ | Option | Default | Meaning |
380
+ | --- | --- | --- |
381
+ | `anthropicBinaryPath` | `"claude"` | Command/path used for local Claude CLI probing. |
382
+ | `googleModels` | `["CLAUDE"]` | Google model keys to query: `CLAUDE`, `G3PRO`, `G3FLASH`, `G3IMAGE`. |
383
+ | `opencodeGoWindows` | `["rolling", "weekly", "monthly"]` | OpenCode Go usage windows to display. |
384
+ | `alibabaCodingPlanTier` | `"lite"` | Fallback Alibaba Coding Plan tier when auth does not include `tier`. |
385
+ | `cursorPlan` | `"none"` | Cursor included API budget preset: `none`, `pro`, `pro-plus`, `ultra`. |
386
+ | `cursorIncludedApiUsd` | unset | Override Cursor monthly included API budget in USD. |
387
+ | `cursorBillingCycleStartDay` | unset | Local billing-cycle anchor day `1..28`; when unset, Cursor usage resets on the local calendar month. |
271
388
 
272
- | Command | What it shows |
273
- | --------------------- | -------------------------------------------------- |
274
- | `opencode-quota show` | Terminal quota-only quick glance |
275
- | `/quota` | Detailed quota report |
276
- | `/quota_status` | Config, provider, auth, pricing, and live probes |
277
- | `/pricing_refresh` | Refresh local runtime pricing from `models.dev` |
278
- | `/tokens_today` | Tokens used today |
279
- | `/tokens_daily` | Tokens used in the last 24 hours |
280
- | `/tokens_weekly` | Tokens used in the last 7 days |
281
- | `/tokens_monthly` | Tokens used in the last 30 days, including pricing |
282
- | `/tokens_all` | Tokens used across all local history |
283
- | `/tokens_session` | Tokens used in the current session |
284
- | `/tokens_session_all` | Current session plus descendant sessions |
285
- | `/tokens_between` | Tokens used between `YYYY-MM-DD YYYY-MM-DD` |
389
+ </details>
286
390
 
287
- <a id="anthropic-claude-quick-setup"></a>
391
+ ## Provider setup notes
288
392
 
289
- ### Anthropic quick setup
393
+ <a id="anthropic-claude"></a>
394
+ <details>
395
+ <summary><strong>Anthropic (Claude)</strong></summary>
290
396
 
291
397
  Install Claude Code, authenticate it, and make sure `claude` is on your `PATH`:
292
398
 
@@ -297,82 +403,41 @@ claude auth status
297
403
 
298
404
  If Claude lives at a custom path, set `anthropicBinaryPath` in `opencode-quota/quota-toast.json`.
299
405
 
300
- ### Companion providers
301
-
302
- Some providers need an auth companion plugin. Add the companion plugin first and `@slkiser/opencode-quota` second.
303
-
304
- <a id="cursor-quick-setup"></a>
305
-
306
- #### Cursor
307
-
308
- Companion plugin: [`@playwo/opencode-cursor-oauth`](https://github.com/PoolPirate/opencode-cursor#readme)
309
-
310
- Add both plugins to `opencode.json`, with the Cursor auth plugin first:
406
+ </details>
311
407
 
312
- ```jsonc
313
- {
314
- "$schema": "https://opencode.ai/config.json",
315
- "plugin": ["@playwo/opencode-cursor-oauth", "@slkiser/opencode-quota"],
316
- "provider": {
317
- "cursor": {
318
- "name": "Cursor",
319
- },
320
- },
321
- }
322
- ```
408
+ <a id="cursor"></a>
409
+ <details>
410
+ <summary><strong>Cursor</strong></summary>
323
411
 
324
- Then authenticate Cursor once:
412
+ Use companion plugin [`@playwo/opencode-cursor-oauth`](https://github.com/PoolPirate/opencode-cursor#readme). Add it before `@slkiser/opencode-quota` in `opencode.json`, then authenticate once:
325
413
 
326
414
  ```bash
327
415
  opencode auth login --provider cursor
328
416
  ```
329
417
 
330
- <a id="qwen-code-quick-setup"></a>
331
-
332
- #### Qwen Code
333
-
334
- Companion plugin: [`opencode-qwencode-auth`](https://github.com/gustavodiasdev/opencode-qwencode-auth#readme)
335
-
336
- Add both plugins to `opencode.json`, with the Qwen auth plugin first:
337
-
338
- ```jsonc
339
- {
340
- "$schema": "https://opencode.ai/config.json",
341
- "plugin": ["opencode-qwencode-auth", "@slkiser/opencode-quota"],
342
- }
343
- ```
344
-
345
- <a id="google-antigravity-quick-setup"></a>
346
-
347
- #### Google Antigravity
348
-
349
- Companion plugin: [`opencode-antigravity-auth`](https://github.com/NoeFabris/opencode-antigravity-auth#readme)
418
+ </details>
350
419
 
351
- Add both plugins to `opencode.json`, with the Antigravity auth plugin first:
420
+ <a id="qwen-code"></a>
421
+ <details>
422
+ <summary><strong>Qwen Code</strong></summary>
352
423
 
353
- ```jsonc
354
- {
355
- "$schema": "https://opencode.ai/config.json",
356
- "plugin": ["opencode-antigravity-auth", "@slkiser/opencode-quota"],
357
- }
358
- ```
424
+ Use companion plugin [`opencode-qwencode-auth`](https://github.com/gustavodiasdev/opencode-qwencode-auth#readme). Add it before `@slkiser/opencode-quota` in `opencode.json`.
359
425
 
360
- <a id="gemini-cli-quick-setup"></a>
426
+ </details>
361
427
 
362
- #### Gemini CLI
428
+ <a id="google-antigravity"></a>
429
+ <details>
430
+ <summary><strong>Google Antigravity</strong></summary>
363
431
 
364
- Companion plugin: [`opencode-gemini-auth`](https://github.com/jenslys/opencode-gemini-auth#readme)
432
+ Use companion plugin [`opencode-antigravity-auth`](https://github.com/NoeFabris/opencode-antigravity-auth#readme). Add it before `@slkiser/opencode-quota` in `opencode.json`.
365
433
 
366
- Add both plugins to `opencode.json`, with the Gemini auth plugin first:
434
+ </details>
367
435
 
368
- ```jsonc
369
- {
370
- "$schema": "https://opencode.ai/config.json",
371
- "plugin": ["opencode-gemini-auth", "@slkiser/opencode-quota"],
372
- }
373
- ```
436
+ <a id="gemini-cli"></a>
437
+ <details>
438
+ <summary><strong>Gemini CLI</strong></summary>
374
439
 
375
- Then authenticate Google once:
440
+ Use companion plugin [`opencode-gemini-auth`](https://github.com/jenslys/opencode-gemini-auth#readme). Add it before `@slkiser/opencode-quota` in `opencode.json`, then authenticate Google once:
376
441
 
377
442
  ```bash
378
443
  opencode auth login --provider google
@@ -380,9 +445,11 @@ opencode auth login --provider google
380
445
 
381
446
  If you use manual provider selection, include `google-gemini-cli` in `enabledProviders`.
382
447
 
383
- ### OpenCode Go
448
+ </details>
384
449
 
385
- <a id="opencode-go-quick-setup"></a>
450
+ <a id="opencode-go"></a>
451
+ <details>
452
+ <summary><strong>OpenCode Go</strong></summary>
386
453
 
387
454
  OpenCode Go quota scrapes the dashboard and needs a workspace ID plus an `auth` cookie:
388
455
 
@@ -391,36 +458,46 @@ export OPENCODE_GO_WORKSPACE_ID="your-workspace-id"
391
458
  export OPENCODE_GO_AUTH_COOKIE="your-auth-cookie"
392
459
  ```
393
460
 
394
- OpenCode Go can show **5h**, **Weekly**, and **Monthly** windows. Use `opencodeGoWindows` in `opencode-quota/quota-toast.json` to choose a subset.
461
+ Use `opencodeGoWindows` to choose **5h**, **Weekly**, and/or **Monthly** windows. Environment variables take precedence over the optional `opencode-go.json` file.
395
462
 
396
- Environment variables take precedence over the optional `opencode-go.json` file. Run `/quota_status` to see the exact paths checked.
463
+ </details>
397
464
 
398
- ### Troubleshooting
465
+ ## Troubleshooting
399
466
 
400
- If quota or token data looks wrong:
467
+ Start here when quota or token data looks wrong.
401
468
 
402
469
  1. Run `/quota_status`.
403
470
  2. Confirm the expected provider appears in the detected provider list.
404
- 3. Confirm OpenCode has already created `opencode.db` if token reports are empty.
405
- 4. Check companion plugins for Cursor, Qwen Code, Google Antigravity, and Gemini CLI.
406
- 5. Use the quick-setup link in the provider table for provider-specific auth and config notes.
471
+ 3. Confirm companion auth plugins are before `@slkiser/opencode-quota` in `opencode.json`.
472
+ 4. If token reports are empty, start OpenCode once so it creates `opencode.db`, then run a session with model usage.
473
+ 5. Use the provider-specific table below for the failing provider.
474
+
475
+ ### Common symptoms
407
476
 
408
- ### Provider Troubleshooting
477
+ | Symptom | Try this |
478
+ | --- | --- |
479
+ | `/quota` shows no providers | Run `/quota_status`, then check provider detection and auth. |
480
+ | Sidebar panel does not appear | Confirm `tui.json` includes `@slkiser/opencode-quota`, restart OpenCode, and check `tuiSidebarPanel.enabled`. |
481
+ | Compact status line does not appear anywhere | Confirm `tui.json` includes `@slkiser/opencode-quota`, restart OpenCode, check `tuiCompactStatus.enabled`, and check whether `tuiCompactStatus.suppressWhenNativeProviderQuota` is hiding it because OpenCode exposes native provider-quota support. |
482
+ | Compact status appears on home but not in chat/session | Check `tuiCompactStatus.sessionPrompt`; set it to `true` to show the chat/session prompt line. |
483
+ | Popup toasts do not appear | Check `enableToast`, `showOnIdle`, `showOnQuestion`, and `showOnCompact`. |
484
+ | Token reports are empty | Start OpenCode once so `opencode.db` exists, then run a session with model usage. |
485
+ | Pricing looks stale | Run `/pricing_refresh`. |
409
486
 
410
- For companion providers, confirm the auth plugin appears before `@slkiser/opencode-quota` in `opencode.json`.
487
+ ### Provider troubleshooting
411
488
 
412
489
  <details>
413
490
  <summary><strong>Anthropic (Claude)</strong></summary>
414
491
 
415
492
  Run `/quota_status` and check the Anthropic section.
416
493
 
417
- | Symptom | Fix |
418
- | ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
419
- | `claude` not found | Install Claude Code and make sure `claude` is on your `PATH`. |
420
- | Claude is installed at a custom path | Set `anthropicBinaryPath` in `opencode-quota/quota-toast.json`. |
421
- | Not authenticated | Run `claude auth login`, then confirm `claude auth status` works. |
422
- | Auth works but no quota rows appear | Check `quota_source` and `message` in `/quota_status`; re-authenticate Claude if the OAuth credential fallback is missing or stale. |
423
- | Provider not detected | Confirm OpenCode is configured to use the `anthropic` provider. |
494
+ | Symptom | Fix |
495
+ | --- | --- |
496
+ | `claude` not found | Install Claude Code and make sure `claude` is on your `PATH`. |
497
+ | Claude is installed at a custom path | Set `anthropicBinaryPath` in `opencode-quota/quota-toast.json`. |
498
+ | Not authenticated | Run `claude auth login`, then confirm `claude auth status` works. |
499
+ | Auth works but no quota rows appear | Check `quota_source` and `message` in `/quota_status`; re-authenticate Claude if the OAuth credential fallback is missing or stale. |
500
+ | Provider not detected | Confirm OpenCode is configured to use the `anthropic` provider. |
424
501
 
425
502
  </details>
426
503
 
@@ -429,12 +506,12 @@ Run `/quota_status` and check the Anthropic section.
429
506
 
430
507
  Run `/quota_status` and check `copilot_quota_auth`, `billing_mode`, `billing_scope`, and `quota_api`.
431
508
 
432
- | Symptom | Fix |
433
- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
434
- | Personal quota missing | Confirm OpenCode Copilot auth works. The plugin can read OpenCode's Copilot OAuth token. |
435
- | Business or Enterprise quota missing | Add `copilot-quota-token.json` in the OpenCode runtime config directory shown by `opencode debug paths`. |
436
- | PAT config exists but quota fails | Fix `copilot-quota-token.json`; when present, it takes precedence over OAuth and does not silently fall back. |
437
- | Enterprise usage missing | Use a classic PAT with the required billing access. Fine-grained PATs and GitHub App tokens are not supported for Enterprise premium usage. |
509
+ | Symptom | Fix |
510
+ | --- | --- |
511
+ | Personal quota missing | Confirm OpenCode Copilot auth works. The plugin can read OpenCode's Copilot OAuth token. |
512
+ | Business or Enterprise quota missing | Add `copilot-quota-token.json` in the OpenCode runtime config directory shown by `opencode debug paths`. |
513
+ | PAT config exists but quota fails | Fix `copilot-quota-token.json`; when present, it takes precedence over OAuth and does not silently fall back. |
514
+ | Enterprise usage missing | Use a classic PAT with the required billing access. Fine-grained PATs and GitHub App tokens are not supported for Enterprise premium usage. |
438
515
 
439
516
  </details>
440
517
 
@@ -443,10 +520,10 @@ Run `/quota_status` and check `copilot_quota_auth`, `billing_mode`, `billing_sco
443
520
 
444
521
  Run `/quota_status` and check the OpenAI auth source and token status.
445
522
 
446
- | Symptom | Fix |
447
- | --------------------- | ------------------------------------------------------------------------------------------ |
448
- | OpenAI quota missing | Confirm OpenCode native OpenAI OAuth is present in `auth.json`. |
449
- | Token expired | Re-run OpenCode's OpenAI auth flow. |
523
+ | Symptom | Fix |
524
+ | --- | --- |
525
+ | OpenAI quota missing | Confirm OpenCode native OpenAI OAuth is present in `auth.json`. |
526
+ | Token expired | Re-run OpenCode's OpenAI auth flow. |
450
527
  | Provider not detected | Confirm your OpenCode config uses the `openai` provider or a compatible OpenAI auth entry. |
451
528
 
452
529
  </details>
@@ -456,13 +533,13 @@ Run `/quota_status` and check the OpenAI auth source and token status.
456
533
 
457
534
  Run `/quota_status` and check the Cursor section.
458
535
 
459
- | Symptom | Fix |
460
- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------- |
461
- | Cursor not detected | Put `@playwo/opencode-cursor-oauth` before `@slkiser/opencode-quota` in `opencode.json`. |
462
- | Cursor auth missing | Run `opencode auth login --provider cursor`. |
463
- | Quota appears but no remaining percentage | Set `cursorPlan` or `cursorIncludedApiUsd` in `opencode-quota/quota-toast.json`. |
464
- | Billing cycle looks wrong | Set `cursorBillingCycleStartDay` in `opencode-quota/quota-toast.json` to your local billing anchor day. |
465
- | Unknown Cursor pricing | Run `/pricing_refresh`; if still unknown, check `/quota_status` for unknown model ids. |
536
+ | Symptom | Fix |
537
+ | --- | --- |
538
+ | Cursor not detected | Put `@playwo/opencode-cursor-oauth` before `@slkiser/opencode-quota` in `opencode.json`. |
539
+ | Cursor auth missing | Run `opencode auth login --provider cursor`. |
540
+ | Quota appears but no remaining percentage | Set `cursorPlan` or `cursorIncludedApiUsd` in `opencode-quota/quota-toast.json`. |
541
+ | Billing cycle looks wrong | Set `cursorBillingCycleStartDay` in `opencode-quota/quota-toast.json` to your local billing anchor day. |
542
+ | Unknown Cursor pricing | Run `/pricing_refresh`; if still unknown, check `/quota_status` for unknown model ids. |
466
543
 
467
544
  </details>
468
545
 
@@ -471,12 +548,12 @@ Run `/quota_status` and check the Cursor section.
471
548
 
472
549
  Run `/quota_status` and check `qwen_oauth_source`, `qwen_local_plan`, and the `qwen_code` live probe section.
473
550
 
474
- | Symptom | Fix |
475
- | -------------------- | ------------------------------------------------------------------------------------------------------------ |
476
- | Qwen not detected | Put `opencode-qwencode-auth` before `@slkiser/opencode-quota` in `opencode.json`. |
477
- | Auth missing | Complete the Qwen companion plugin auth flow. |
551
+ | Symptom | Fix |
552
+ | --- | --- |
553
+ | Qwen not detected | Put `opencode-qwencode-auth` before `@slkiser/opencode-quota` in `opencode.json`. |
554
+ | Auth missing | Complete the Qwen companion plugin auth flow. |
478
555
  | Counters do not move | Confirm the current model is `qwen-code/*`; Qwen quota is local request estimation for matching model usage. |
479
- | Usage looks stale | Check the local state file path shown by `/quota_status`. |
556
+ | Usage looks stale | Check the local state file path shown by `/quota_status`. |
480
557
 
481
558
  </details>
482
559
 
@@ -485,29 +562,29 @@ Run `/quota_status` and check `qwen_oauth_source`, `qwen_local_plan`, and the `q
485
562
 
486
563
  Run `/quota_status` and check the Alibaba auth, resolved tier, state-file path, and `alibaba_coding_plan` live probe section.
487
564
 
488
- | Symptom | Fix |
489
- | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
565
+ | Symptom | Fix |
566
+ | --- | --- |
490
567
  | API key not detected | Use `ALIBABA_CODING_PLAN_API_KEY`, `ALIBABA_API_KEY`, trusted user/global OpenCode config, or OpenCode auth. Repo-local provider secrets are ignored. |
491
- | Wrong tier | Set `alibabaCodingPlanTier` to `lite` or `pro` in `opencode-quota/quota-toast.json`. |
492
- | Counters do not move | Confirm the current model is `alibaba/*` or `alibaba-cn/*`. |
493
- | Quota seems stale | Check the state-file path shown in `/quota_status`. |
568
+ | Wrong tier | Set `alibabaCodingPlanTier` to `lite` or `pro` in `opencode-quota/quota-toast.json`. |
569
+ | Counters do not move | Confirm the current model is `alibaba/*` or `alibaba-cn/*`. |
570
+ | Quota seems stale | Check the state-file path shown in `/quota_status`. |
494
571
 
495
572
  </details>
496
573
 
497
574
  <details>
498
575
  <summary><strong>MiniMax, Kimi, Chutes AI, Crof.ai, Synthetic, Z.ai, and NanoGPT</strong></summary>
499
576
 
500
- These providers use trusted env vars, trusted user/global OpenCode config, or native OpenCode auth. Run `/quota_status` and check the provider-specific API-key diagnostics (Crof.ai is env/config only).
577
+ These providers use trusted env vars, trusted user/global OpenCode config, or native OpenCode auth. Run `/quota_status` and check the provider-specific API-key diagnostics. Crof.ai is env/config only.
501
578
 
502
- | Provider | Useful checks |
503
- | ------------------- | ----------------------------------------------------------------------------------------------------- |
504
- | MiniMax Coding Plan | Use `MINIMAX_CODING_PLAN_API_KEY` or `MINIMAX_API_KEY`; repo-local provider secrets are ignored. |
505
- | Kimi Code | Use `KIMI_API_KEY` or `KIMI_CODE_API_KEY`; repo-local provider secrets are ignored. |
506
- | Chutes AI | Use `CHUTES_API_KEY` or trusted user/global config. |
507
- | Crof.ai | Use `CROF_API_KEY` or trusted user/global config. |
508
- | Synthetic | Use `SYNTHETIC_API_KEY`, trusted user/global config, or OpenCode auth. |
509
- | Z.ai Coding Plan | Use `ZAI_API_KEY` or `ZAI_CODING_PLAN_API_KEY`; malformed fallback auth is surfaced as an auth error. |
510
- | NanoGPT | Use `NANOGPT_API_KEY`, `NANO_GPT_API_KEY`, trusted user/global config, or OpenCode auth. |
579
+ | Provider | Useful checks |
580
+ | --- | --- |
581
+ | MiniMax Coding Plan | Use `MINIMAX_CODING_PLAN_API_KEY` or `MINIMAX_API_KEY`; repo-local provider secrets are ignored. |
582
+ | Kimi Code | Use `KIMI_API_KEY` or `KIMI_CODE_API_KEY`; repo-local provider secrets are ignored. |
583
+ | Chutes AI | Use `CHUTES_API_KEY` or trusted user/global config. |
584
+ | Crof.ai | Use `CROF_API_KEY`, `CROFAI_API_KEY`, or trusted user/global config. |
585
+ | Synthetic | Use `SYNTHETIC_API_KEY`, trusted user/global config, or OpenCode auth. |
586
+ | Z.ai Coding Plan | Use `ZAI_API_KEY` or `ZAI_CODING_PLAN_API_KEY`; malformed fallback auth is surfaced as an auth error. |
587
+ | NanoGPT | Use `NANOGPT_API_KEY`, `NANO_GPT_API_KEY`, trusted user/global config, or OpenCode auth. |
511
588
 
512
589
  For security, repo-local `opencode.json` / `opencode.jsonc` is ignored for provider secrets in these integrations. Put secrets in environment variables or trusted user/global config.
513
590
 
@@ -518,12 +595,12 @@ For security, repo-local `opencode.json` / `opencode.jsonc` is ignored for provi
518
595
 
519
596
  Run `/quota_status` and check the `google_antigravity` section.
520
597
 
521
- | Symptom | Fix |
522
- | ------------------------ | ------------------------------------------------------------------------------------ |
523
- | Companion missing | Put `opencode-antigravity-auth` before `@slkiser/opencode-quota` in `opencode.json`. |
524
- | Accounts not found | Check the selected `antigravity-accounts.json` path shown by `/quota_status`. |
525
- | Refresh tokens invalid | Re-authenticate with the companion plugin. |
526
- | Provider returns no rows | Check `live_probe`, `live_entry_*`, and `live_error_*` in `/quota_status`. |
598
+ | Symptom | Fix |
599
+ | --- | --- |
600
+ | Companion missing | Put `opencode-antigravity-auth` before `@slkiser/opencode-quota` in `opencode.json`. |
601
+ | Accounts not found | Check the selected `antigravity-accounts.json` path shown by `/quota_status`. |
602
+ | Refresh tokens invalid | Re-authenticate with the companion plugin. |
603
+ | Provider returns no rows | Check `live_probe`, `live_entry_*`, and `live_error_*` in `/quota_status`. |
527
604
 
528
605
  </details>
529
606
 
@@ -532,12 +609,12 @@ Run `/quota_status` and check the `google_antigravity` section.
532
609
 
533
610
  Run `/quota_status` and check the Gemini CLI live probe rows.
534
611
 
535
- | Symptom | Fix |
536
- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
537
- | Companion missing | Put `opencode-gemini-auth` before `@slkiser/opencode-quota` in `opencode.json`. |
538
- | Provider not enabled in manual mode | Include `google-gemini-cli` in `enabledProviders` in `opencode-quota/quota-toast.json`. |
539
- | Auth missing | Run `opencode auth login --provider google`. |
540
- | Project missing | Set `provider.google.options.projectId`, `OPENCODE_GEMINI_PROJECT_ID`, `GOOGLE_CLOUD_PROJECT`, or `GOOGLE_CLOUD_PROJECT_ID`. |
612
+ | Symptom | Fix |
613
+ | --- | --- |
614
+ | Companion missing | Put `opencode-gemini-auth` before `@slkiser/opencode-quota` in `opencode.json`. |
615
+ | Provider not enabled in manual mode | Include `google-gemini-cli` in `enabledProviders` in `opencode-quota/quota-toast.json`. |
616
+ | Auth missing | Run `opencode auth login --provider google`. |
617
+ | Project missing | Set `provider.google.options.projectId`, `OPENCODE_GEMINI_PROJECT_ID`, `GOOGLE_CLOUD_PROJECT`, or `GOOGLE_CLOUD_PROJECT_ID`. |
541
618
 
542
619
  </details>
543
620
 
@@ -546,42 +623,42 @@ Run `/quota_status` and check the Gemini CLI live probe rows.
546
623
 
547
624
  Run `/quota_status` and check the `opencode_go` section.
548
625
 
549
- | Symptom | Fix |
550
- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
551
- | Config not detected | Set both `OPENCODE_GO_WORKSPACE_ID` and `OPENCODE_GO_AUTH_COOKIE`, then rerun `/quota_status`. |
552
- | Incomplete config | `workspaceId` and `authCookie` must come from the same source. |
553
- | Scrape returns no data | Refresh the browser `auth` cookie from `opencode.ai`. |
554
- | Selected window missing | Check `/quota_status` for `selected_windows` and `live_fetch_error`; remove unavailable windows from `opencodeGoWindows` in `opencode-quota/quota-toast.json` or refresh the dashboard cookie. |
555
- | Dashboard format changed | This integration scrapes the dashboard, so it can break if the dashboard markup changes. |
626
+ | Symptom | Fix |
627
+ | --- | --- |
628
+ | Config not detected | Set both `OPENCODE_GO_WORKSPACE_ID` and `OPENCODE_GO_AUTH_COOKIE`, then rerun `/quota_status`. |
629
+ | Incomplete config | `workspaceId` and `authCookie` must come from the same source. |
630
+ | Scrape returns no data | Refresh the browser `auth` cookie from `opencode.ai`. |
631
+ | Selected window missing | Check `/quota_status` for `selected_windows` and `live_fetch_error`; remove unavailable windows from `opencodeGoWindows` in `opencode-quota/quota-toast.json` or refresh the dashboard cookie. |
632
+ | Dashboard format changed | This integration scrapes the dashboard, so it can break if the dashboard markup changes. |
556
633
 
557
634
  </details>
558
635
 
559
636
  <details>
560
- <summary><strong>Token Reports</strong></summary>
637
+ <summary><strong>Token reports</strong></summary>
561
638
 
562
639
  Run `/quota_status` and check pricing snapshot health plus OpenCode database paths.
563
640
 
564
- | Symptom | Fix |
565
- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
566
- | `/tokens_*` is empty | Start OpenCode once so it creates `opencode.db`, then run a session with model usage. |
567
- | Pricing looks stale | Run `/pricing_refresh`. |
641
+ | Symptom | Fix |
642
+ | --- | --- |
643
+ | `/tokens_*` is empty | Start OpenCode once so it creates `opencode.db`, then run a session with model usage. |
644
+ | Pricing looks stale | Run `/pricing_refresh`. |
568
645
  | Runtime pricing does not change output | Check `pricingSnapshot.source` in `opencode-quota/quota-toast.json`; `bundled` keeps packaged pricing active. |
569
- | Cursor model has unknown pricing | Run `/pricing_refresh`; Cursor `auto` and `composer*` use bundled deterministic pricing. |
646
+ | Cursor model has unknown pricing | Run `/pricing_refresh`; Cursor `auto` and `composer*` use bundled deterministic pricing. |
570
647
 
571
648
  </details>
572
649
 
573
- ### Issues
650
+ ## Issues
574
651
 
575
652
  Please use the Bug report or Feature request templates when opening issues. Freeform issues, or bug/feature issues missing the required template sections, may be automatically commented on and closed.
576
653
 
577
- ### License
654
+ ## License
578
655
 
579
656
  MIT
580
657
 
581
- ### Remarks
658
+ ## Remarks
582
659
 
583
660
  OpenCode Quota is not built by the OpenCode team and is not affiliated with OpenCode or any provider listed above.
584
661
 
585
- ### Star History
662
+ ## Star history
586
663
 
587
664
  [![Star History Chart](https://api.star-history.com/chart?repos=slkiser/opencode-quota&type=date&legend=bottom-right)](https://www.star-history.com/?repos=slkiser%2Fopencode-quota&type=date&legend=bottom-right)