@slkiser/opencode-quota 3.6.2 → 3.8.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.
Files changed (99) hide show
  1. package/README.md +376 -295
  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/entries.d.ts +9 -1
  7. package/dist/lib/entries.d.ts.map +1 -1
  8. package/dist/lib/format.d.ts.map +1 -1
  9. package/dist/lib/format.js +2 -45
  10. package/dist/lib/format.js.map +1 -1
  11. package/dist/lib/google-gemini-cli-companion.d.ts.map +1 -1
  12. package/dist/lib/google-gemini-cli-companion.js +43 -6
  13. package/dist/lib/google-gemini-cli-companion.js.map +1 -1
  14. package/dist/lib/init-installer.d.ts +4 -1
  15. package/dist/lib/init-installer.d.ts.map +1 -1
  16. package/dist/lib/init-installer.js +179 -42
  17. package/dist/lib/init-installer.js.map +1 -1
  18. package/dist/lib/jsonc.d.ts.map +1 -1
  19. package/dist/lib/jsonc.js +2 -1
  20. package/dist/lib/jsonc.js.map +1 -1
  21. package/dist/lib/minimax-auth.d.ts +18 -8
  22. package/dist/lib/minimax-auth.d.ts.map +1 -1
  23. package/dist/lib/minimax-auth.js +124 -45
  24. package/dist/lib/minimax-auth.js.map +1 -1
  25. package/dist/lib/minimax-endpoints.d.ts +10 -0
  26. package/dist/lib/minimax-endpoints.d.ts.map +1 -0
  27. package/dist/lib/minimax-endpoints.js +19 -0
  28. package/dist/lib/minimax-endpoints.js.map +1 -0
  29. package/dist/lib/provider-metadata.d.ts +1 -1
  30. package/dist/lib/provider-metadata.d.ts.map +1 -1
  31. package/dist/lib/provider-metadata.js +29 -0
  32. package/dist/lib/provider-metadata.js.map +1 -1
  33. package/dist/lib/quota-entry-display.d.ts +5 -0
  34. package/dist/lib/quota-entry-display.d.ts.map +1 -0
  35. package/dist/lib/quota-entry-display.js +45 -0
  36. package/dist/lib/quota-entry-display.js.map +1 -0
  37. package/dist/lib/quota-render-data.d.ts +1 -0
  38. package/dist/lib/quota-render-data.d.ts.map +1 -1
  39. package/dist/lib/quota-render-data.js +13 -4
  40. package/dist/lib/quota-render-data.js.map +1 -1
  41. package/dist/lib/quota-runtime-context.d.ts.map +1 -1
  42. package/dist/lib/quota-runtime-context.js +3 -0
  43. package/dist/lib/quota-runtime-context.js.map +1 -1
  44. package/dist/lib/quota-stats.d.ts +4 -0
  45. package/dist/lib/quota-stats.d.ts.map +1 -1
  46. package/dist/lib/quota-stats.js +21 -5
  47. package/dist/lib/quota-stats.js.map +1 -1
  48. package/dist/lib/quota-status.d.ts.map +1 -1
  49. package/dist/lib/quota-status.js +124 -45
  50. package/dist/lib/quota-status.js.map +1 -1
  51. package/dist/lib/session-tokens-format.d.ts.map +1 -1
  52. package/dist/lib/session-tokens-format.js +19 -5
  53. package/dist/lib/session-tokens-format.js.map +1 -1
  54. package/dist/lib/session-tokens.d.ts.map +1 -1
  55. package/dist/lib/session-tokens.js +2 -0
  56. package/dist/lib/session-tokens.js.map +1 -1
  57. package/dist/lib/tui-compact-format.d.ts +8 -0
  58. package/dist/lib/tui-compact-format.d.ts.map +1 -0
  59. package/dist/lib/tui-compact-format.js +180 -0
  60. package/dist/lib/tui-compact-format.js.map +1 -0
  61. package/dist/lib/tui-native-provider-quota.d.ts +7 -0
  62. package/dist/lib/tui-native-provider-quota.d.ts.map +1 -0
  63. package/dist/lib/tui-native-provider-quota.js +25 -0
  64. package/dist/lib/tui-native-provider-quota.js.map +1 -0
  65. package/dist/lib/tui-panel-state.d.ts +15 -1
  66. package/dist/lib/tui-panel-state.d.ts.map +1 -1
  67. package/dist/lib/tui-panel-state.js +13 -0
  68. package/dist/lib/tui-panel-state.js.map +1 -1
  69. package/dist/lib/tui-runtime.d.ts +28 -1
  70. package/dist/lib/tui-runtime.d.ts.map +1 -1
  71. package/dist/lib/tui-runtime.js +140 -29
  72. package/dist/lib/tui-runtime.js.map +1 -1
  73. package/dist/lib/types.d.ts +20 -0
  74. package/dist/lib/types.d.ts.map +1 -1
  75. package/dist/lib/types.js +10 -0
  76. package/dist/lib/types.js.map +1 -1
  77. package/dist/lib/zhipu-auth.d.ts +38 -0
  78. package/dist/lib/zhipu-auth.d.ts.map +1 -0
  79. package/dist/lib/zhipu-auth.js +107 -0
  80. package/dist/lib/zhipu-auth.js.map +1 -0
  81. package/dist/lib/zhipu.d.ts +11 -0
  82. package/dist/lib/zhipu.d.ts.map +1 -0
  83. package/dist/lib/zhipu.js +87 -0
  84. package/dist/lib/zhipu.js.map +1 -0
  85. package/dist/providers/minimax-coding-plan.d.ts +4 -0
  86. package/dist/providers/minimax-coding-plan.d.ts.map +1 -1
  87. package/dist/providers/minimax-coding-plan.js +106 -56
  88. package/dist/providers/minimax-coding-plan.js.map +1 -1
  89. package/dist/providers/registry.d.ts.map +1 -1
  90. package/dist/providers/registry.js +4 -1
  91. package/dist/providers/registry.js.map +1 -1
  92. package/dist/providers/zhipu.d.ts +8 -0
  93. package/dist/providers/zhipu.d.ts.map +1 -0
  94. package/dist/providers/zhipu.js +79 -0
  95. package/dist/providers/zhipu.js.map +1 -0
  96. package/dist/tui.d.ts +0 -1
  97. package/dist/tui.d.ts.map +1 -1
  98. package/dist/tui.tsx +383 -45
  99. 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
55
67
 
56
- Add the server plugin to `opencode.json` or `opencode.jsonc`:
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)
111
+
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,103 @@ 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
+ ```
134
139
 
135
- ### What opencode-quota adds
140
+ Start with this, then adjust the UI choices in the next section:
136
141
 
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
142
+ ```jsonc
143
+ {
144
+ "enabledProviders": "auto",
145
+ "enableToast": true,
146
+ "tuiSidebarPanel": {
147
+ "enabled": true,
148
+ },
149
+ "tuiCompactStatus": {
150
+ "enabled": false,
151
+ },
152
+ }
153
+ ```
143
154
 
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>
155
+ > [!TIP]
156
+ > Run `/quota_status` to see the exact config paths OpenCode Quota loaded.
157
+
158
+ ## Choose your UI surfaces
159
+
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
174
+
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
+ | MiniMax Coding Plan (CN) | Automatic | Remote API |
204
+ | Kimi Code | Automatic | Remote API |
205
+ | Chutes AI | Usually automatic | Remote API |
206
+ | Crof.ai | Manual env/config | Remote API |
207
+ | Synthetic | Automatic | Remote API |
208
+ | Google Antigravity | [Needs setup](#google-antigravity) | Remote API |
209
+ | Gemini CLI | [Needs setup](#gemini-cli) | Remote API |
210
+ | Z.ai Coding Plan | Automatic | Remote API |
211
+ | Zhipu Coding Plan | Automatic | Remote API |
212
+ | NanoGPT | Usually automatic | Remote API |
213
+ | OpenCode Go | [Needs setup](#opencode-go) | Dashboard scraping |
214
+
215
+ ## Common configuration
216
+
217
+ Customize these settings in `opencode-quota/quota-toast.json`, next to the OpenCode config for your install scope.
218
+
219
+ Common locations:
220
+
221
+ - Project install: `<your-repo>/opencode-quota/quota-toast.json`
222
+ - Global install: usually `~/.config/opencode/opencode-quota/quota-toast.json`
223
+ - Custom config dir: `$OPENCODE_CONFIG_DIR/opencode-quota/quota-toast.json`
224
+
225
+ If you are unsure, run `/quota_status`; it prints the config path it loaded.
158
226
 
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`, `CROFAI_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`:
227
+ <details>
228
+ <summary><strong>Choose providers explicitly</strong></summary>
181
229
 
182
230
  ```jsonc
183
231
  {
@@ -185,14 +233,10 @@ Providers are auto-detected by default. To choose providers explicitly, set `ena
185
233
  }
186
234
  ```
187
235
 
188
- ### Common Options
189
-
190
- Customize these settings in `opencode-quota/quota-toast.json`.
236
+ </details>
191
237
 
192
238
  <details>
193
- <summary><strong>Show every quota window</strong></summary>
194
-
195
- Instead of the default most-constrained window:
239
+ <summary><strong>Show all quota reset periods</strong></summary>
196
240
 
197
241
  ```jsonc
198
242
  {
@@ -203,48 +247,63 @@ Instead of the default most-constrained window:
203
247
  </details>
204
248
 
205
249
  <details>
206
- <summary><strong>Choose OpenCode Go windows</strong></summary>
207
-
208
- Choose which OpenCode Go windows to display:
250
+ <summary><strong>Show used percentages</strong></summary>
209
251
 
210
252
  ```jsonc
211
253
  {
212
- "opencodeGoWindows": ["rolling", "weekly", "monthly"],
254
+ "percentDisplayMode": "used",
213
255
  }
214
256
  ```
215
257
 
216
258
  </details>
217
259
 
218
260
  <details>
219
- <summary><strong>Show used percentages</strong></summary>
261
+ <summary><strong>Turn off popup toasts</strong></summary>
220
262
 
221
- Show percentages as used instead of remaining in toasts and the sidebar:
263
+ Keeps `/quota`, `/quota_status`, terminal checks, and any enabled UI surfaces.
222
264
 
223
265
  ```jsonc
224
266
  {
225
- "percentDisplayMode": "used",
267
+ "enableToast": false,
226
268
  }
227
269
  ```
228
270
 
229
271
  </details>
230
272
 
231
273
  <details>
232
- <summary><strong>Turn off popup toasts</strong></summary>
274
+ <summary><strong>Turn off the Sidebar panel</strong></summary>
233
275
 
234
- Keep `/quota` and the sidebar enabled:
276
+ Useful when you want Compact status line only, toasts only, or slash commands only.
235
277
 
236
278
  ```jsonc
237
279
  {
238
- "enableToast": false,
280
+ "tuiSidebarPanel": {
281
+ "enabled": false,
282
+ },
239
283
  }
240
284
  ```
241
285
 
242
286
  </details>
243
287
 
244
288
  <details>
245
- <summary><strong>Increase request timeout</strong></summary>
289
+ <summary><strong>Keep Compact status line on home only</strong></summary>
246
290
 
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.
291
+ Useful when you want the compact line on the home screen but not in the chat/session prompt area.
292
+
293
+ ```jsonc
294
+ {
295
+ "tuiCompactStatus": {
296
+ "enabled": true,
297
+ "homeBottom": true,
298
+ "sessionPrompt": false,
299
+ },
300
+ }
301
+ ```
302
+
303
+ </details>
304
+
305
+ <details>
306
+ <summary><strong>Increase provider request timeout</strong></summary>
248
307
 
249
308
  ```jsonc
250
309
  {
@@ -267,26 +326,75 @@ This is only for users who intentionally want `experimental.quotaToast` mirrored
267
326
 
268
327
  </details>
269
328
 
270
- ### Commands
329
+ ## Full configuration reference
330
+
331
+ Settings go in the same `opencode-quota/quota-toast.json` sidecar described above.
271
332
 
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` |
333
+ Existing `experimental.quotaToast` settings still work when no sidecar file exists. Quota settings do not live in `tui.json`.
286
334
 
287
- <a id="anthropic-claude-quick-setup"></a>
335
+ <details>
336
+ <summary><strong>All settings</strong></summary>
337
+
338
+ ### Core/shared settings
339
+
340
+ | Option | Default | Meaning |
341
+ | --- | --- | --- |
342
+ | `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. |
343
+ | `enabledProviders` | `"auto"` | Auto-detect providers, or set an explicit provider list. |
344
+ | `minIntervalMs` | `300000` | Minimum fetch interval between provider updates. |
345
+ | `requestTimeoutMs` | `5000` | Remote provider request timeout in milliseconds. |
346
+ | `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. |
347
+ | `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. |
348
+ | `onlyCurrentModel` | `false` | Filter quota rows to the current model/provider when that session selection can be resolved. |
349
+ | `showSessionTokens` | `true` | Show the `Session input/output tokens` section when session token data is available. When cached input is present, the section keeps the legacy `in/out` layout and appends cached input in parentheses next to the input amount. |
350
+ | `pricingSnapshot.source` | `"auto"` | Token pricing snapshot selection for `/tokens_*`: `auto`, `bundled`, or `runtime`. |
351
+ | `pricingSnapshot.autoRefresh` | `7` | Refresh stale local pricing data after this many days. |
352
+
353
+ ### Toast settings
354
+
355
+ | Option | Default | Meaning |
356
+ | --- | --- | --- |
357
+ | `enableToast` | `true` | Show popup toasts. Disabling this does not disable `/quota` or UI surfaces. |
358
+ | `toastDurationMs` | `9000` | Toast duration in milliseconds. |
359
+ | `showOnIdle` | `true` | Show a toast on the idle trigger. |
360
+ | `showOnQuestion` | `true` | Show a toast after a question/assistant response. |
361
+ | `showOnCompact` | `true` | Show a toast after session compaction. |
362
+ | `showOnBothFail` | `true` | Show a fallback toast when providers attempted quota reads and all failed. |
363
+ | `layout.maxWidth` | `50` | Toast formatting width target. |
364
+ | `layout.narrowAt` | `42` | Toast compact-layout breakpoint. |
365
+ | `layout.tinyAt` | `32` | Toast tiny-layout breakpoint. |
366
+ | `debug` | `false` | Append toast debug context when troubleshooting. |
367
+
368
+ ### TUI settings
369
+
370
+ | Option | Default | Meaning |
371
+ | --- | --- | --- |
372
+ | `tuiSidebarPanel.enabled` | `true` | Show the Sidebar `Quota` panel when the TUI plugin is installed. Default is `true` for backward compatibility. |
373
+ | `tuiCompactStatus.enabled` | `false` | Opt in to Compact status line UI surfaces. |
374
+ | `tuiCompactStatus.homeBottom` | `true` | Show the Compact status line at the home bottom location. |
375
+ | `tuiCompactStatus.sessionPrompt` | `true` | Show the Compact status line by wrapping the TUI session prompt. Disable this if you only want the home-bottom line. |
376
+ | `tuiCompactStatus.suppressWhenNativeProviderQuota` | `true` | Hide the Compact status line when OpenCode exposes native provider-quota support. |
377
+ | `tuiCompactStatus.maxWidth` | `96` | Maximum Compact status line text width. |
378
+
379
+ ### Provider-specific settings
380
+
381
+ | Option | Default | Meaning |
382
+ | --- | --- | --- |
383
+ | `anthropicBinaryPath` | `"claude"` | Command/path used for local Claude CLI probing. |
384
+ | `googleModels` | `["CLAUDE"]` | Google model keys to query: `CLAUDE`, `G3PRO`, `G3FLASH`, `G3IMAGE`. |
385
+ | `opencodeGoWindows` | `["rolling", "weekly", "monthly"]` | OpenCode Go usage windows to display. |
386
+ | `alibabaCodingPlanTier` | `"lite"` | Fallback Alibaba Coding Plan tier when auth does not include `tier`. |
387
+ | `cursorPlan` | `"none"` | Cursor included API budget preset: `none`, `pro`, `pro-plus`, `ultra`. |
388
+ | `cursorIncludedApiUsd` | unset | Override Cursor monthly included API budget in USD. |
389
+ | `cursorBillingCycleStartDay` | unset | Local billing-cycle anchor day `1..28`; when unset, Cursor usage resets on the local calendar month. |
288
390
 
289
- ### Anthropic quick setup
391
+ </details>
392
+
393
+ ## Provider setup notes
394
+
395
+ <a id="anthropic-claude"></a>
396
+ <details>
397
+ <summary><strong>Anthropic (Claude)</strong></summary>
290
398
 
291
399
  Install Claude Code, authenticate it, and make sure `claude` is on your `PATH`:
292
400
 
@@ -297,82 +405,41 @@ claude auth status
297
405
 
298
406
  If Claude lives at a custom path, set `anthropicBinaryPath` in `opencode-quota/quota-toast.json`.
299
407
 
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:
408
+ </details>
311
409
 
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
- ```
410
+ <a id="cursor"></a>
411
+ <details>
412
+ <summary><strong>Cursor</strong></summary>
323
413
 
324
- Then authenticate Cursor once:
414
+ 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
415
 
326
416
  ```bash
327
417
  opencode auth login --provider cursor
328
418
  ```
329
419
 
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)
420
+ </details>
350
421
 
351
- Add both plugins to `opencode.json`, with the Antigravity auth plugin first:
422
+ <a id="qwen-code"></a>
423
+ <details>
424
+ <summary><strong>Qwen Code</strong></summary>
352
425
 
353
- ```jsonc
354
- {
355
- "$schema": "https://opencode.ai/config.json",
356
- "plugin": ["opencode-antigravity-auth", "@slkiser/opencode-quota"],
357
- }
358
- ```
426
+ Use companion plugin [`opencode-qwencode-auth`](https://github.com/gustavodiasdev/opencode-qwencode-auth#readme). Add it before `@slkiser/opencode-quota` in `opencode.json`.
359
427
 
360
- <a id="gemini-cli-quick-setup"></a>
428
+ </details>
361
429
 
362
- #### Gemini CLI
430
+ <a id="google-antigravity"></a>
431
+ <details>
432
+ <summary><strong>Google Antigravity</strong></summary>
363
433
 
364
- Companion plugin: [`opencode-gemini-auth`](https://github.com/jenslys/opencode-gemini-auth#readme)
434
+ Use companion plugin [`opencode-antigravity-auth`](https://github.com/NoeFabris/opencode-antigravity-auth#readme). Add it before `@slkiser/opencode-quota` in `opencode.json`.
365
435
 
366
- Add both plugins to `opencode.json`, with the Gemini auth plugin first:
436
+ </details>
367
437
 
368
- ```jsonc
369
- {
370
- "$schema": "https://opencode.ai/config.json",
371
- "plugin": ["opencode-gemini-auth", "@slkiser/opencode-quota"],
372
- }
373
- ```
438
+ <a id="gemini-cli"></a>
439
+ <details>
440
+ <summary><strong>Gemini CLI</strong></summary>
374
441
 
375
- Then authenticate Google once:
442
+ 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
443
 
377
444
  ```bash
378
445
  opencode auth login --provider google
@@ -380,9 +447,11 @@ opencode auth login --provider google
380
447
 
381
448
  If you use manual provider selection, include `google-gemini-cli` in `enabledProviders`.
382
449
 
383
- ### OpenCode Go
450
+ </details>
384
451
 
385
- <a id="opencode-go-quick-setup"></a>
452
+ <a id="opencode-go"></a>
453
+ <details>
454
+ <summary><strong>OpenCode Go</strong></summary>
386
455
 
387
456
  OpenCode Go quota scrapes the dashboard and needs a workspace ID plus an `auth` cookie:
388
457
 
@@ -391,36 +460,46 @@ export OPENCODE_GO_WORKSPACE_ID="your-workspace-id"
391
460
  export OPENCODE_GO_AUTH_COOKIE="your-auth-cookie"
392
461
  ```
393
462
 
394
- OpenCode Go can show **5h**, **Weekly**, and **Monthly** windows. Use `opencodeGoWindows` in `opencode-quota/quota-toast.json` to choose a subset.
463
+ Use `opencodeGoWindows` to choose **5h**, **Weekly**, and/or **Monthly** windows. Environment variables take precedence over the optional `opencode-go.json` file.
395
464
 
396
- Environment variables take precedence over the optional `opencode-go.json` file. Run `/quota_status` to see the exact paths checked.
465
+ </details>
397
466
 
398
- ### Troubleshooting
467
+ ## Troubleshooting
399
468
 
400
- If quota or token data looks wrong:
469
+ Start here when quota or token data looks wrong.
401
470
 
402
471
  1. Run `/quota_status`.
403
472
  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.
473
+ 3. Confirm companion auth plugins are before `@slkiser/opencode-quota` in `opencode.json`.
474
+ 4. If token reports are empty, start OpenCode once so it creates `opencode.db`, then run a session with model usage.
475
+ 5. Use the provider-specific table below for the failing provider.
476
+
477
+ ### Common symptoms
407
478
 
408
- ### Provider Troubleshooting
479
+ | Symptom | Try this |
480
+ | --- | --- |
481
+ | `/quota` shows no providers | Run `/quota_status`, then check provider detection and auth. |
482
+ | Sidebar panel does not appear | Confirm `tui.json` includes `@slkiser/opencode-quota`, restart OpenCode, and check `tuiSidebarPanel.enabled`. |
483
+ | 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. |
484
+ | Compact status appears on home but not in chat/session | Check `tuiCompactStatus.sessionPrompt`; set it to `true` to show the chat/session prompt line. |
485
+ | Popup toasts do not appear | Check `enableToast`, `showOnIdle`, `showOnQuestion`, and `showOnCompact`. |
486
+ | Token reports are empty | Start OpenCode once so `opencode.db` exists, then run a session with model usage. |
487
+ | Pricing looks stale | Run `/pricing_refresh`. |
409
488
 
410
- For companion providers, confirm the auth plugin appears before `@slkiser/opencode-quota` in `opencode.json`.
489
+ ### Provider troubleshooting
411
490
 
412
491
  <details>
413
492
  <summary><strong>Anthropic (Claude)</strong></summary>
414
493
 
415
494
  Run `/quota_status` and check the Anthropic section.
416
495
 
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. |
496
+ | Symptom | Fix |
497
+ | --- | --- |
498
+ | `claude` not found | Install Claude Code and make sure `claude` is on your `PATH`. |
499
+ | Claude is installed at a custom path | Set `anthropicBinaryPath` in `opencode-quota/quota-toast.json`. |
500
+ | Not authenticated | Run `claude auth login`, then confirm `claude auth status` works. |
501
+ | 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. |
502
+ | Provider not detected | Confirm OpenCode is configured to use the `anthropic` provider. |
424
503
 
425
504
  </details>
426
505
 
@@ -429,12 +508,12 @@ Run `/quota_status` and check the Anthropic section.
429
508
 
430
509
  Run `/quota_status` and check `copilot_quota_auth`, `billing_mode`, `billing_scope`, and `quota_api`.
431
510
 
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. |
511
+ | Symptom | Fix |
512
+ | --- | --- |
513
+ | Personal quota missing | Confirm OpenCode Copilot auth works. The plugin can read OpenCode's Copilot OAuth token. |
514
+ | Business or Enterprise quota missing | Add `copilot-quota-token.json` in the OpenCode runtime config directory shown by `opencode debug paths`. |
515
+ | PAT config exists but quota fails | Fix `copilot-quota-token.json`; when present, it takes precedence over OAuth and does not silently fall back. |
516
+ | 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
517
 
439
518
  </details>
440
519
 
@@ -443,10 +522,10 @@ Run `/quota_status` and check `copilot_quota_auth`, `billing_mode`, `billing_sco
443
522
 
444
523
  Run `/quota_status` and check the OpenAI auth source and token status.
445
524
 
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. |
525
+ | Symptom | Fix |
526
+ | --- | --- |
527
+ | OpenAI quota missing | Confirm OpenCode native OpenAI OAuth is present in `auth.json`. |
528
+ | Token expired | Re-run OpenCode's OpenAI auth flow. |
450
529
  | Provider not detected | Confirm your OpenCode config uses the `openai` provider or a compatible OpenAI auth entry. |
451
530
 
452
531
  </details>
@@ -456,13 +535,13 @@ Run `/quota_status` and check the OpenAI auth source and token status.
456
535
 
457
536
  Run `/quota_status` and check the Cursor section.
458
537
 
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. |
538
+ | Symptom | Fix |
539
+ | --- | --- |
540
+ | Cursor not detected | Put `@playwo/opencode-cursor-oauth` before `@slkiser/opencode-quota` in `opencode.json`. |
541
+ | Cursor auth missing | Run `opencode auth login --provider cursor`. |
542
+ | Quota appears but no remaining percentage | Set `cursorPlan` or `cursorIncludedApiUsd` in `opencode-quota/quota-toast.json`. |
543
+ | Billing cycle looks wrong | Set `cursorBillingCycleStartDay` in `opencode-quota/quota-toast.json` to your local billing anchor day. |
544
+ | Unknown Cursor pricing | Run `/pricing_refresh`; if still unknown, check `/quota_status` for unknown model ids. |
466
545
 
467
546
  </details>
468
547
 
@@ -471,12 +550,12 @@ Run `/quota_status` and check the Cursor section.
471
550
 
472
551
  Run `/quota_status` and check `qwen_oauth_source`, `qwen_local_plan`, and the `qwen_code` live probe section.
473
552
 
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. |
553
+ | Symptom | Fix |
554
+ | --- | --- |
555
+ | Qwen not detected | Put `opencode-qwencode-auth` before `@slkiser/opencode-quota` in `opencode.json`. |
556
+ | Auth missing | Complete the Qwen companion plugin auth flow. |
478
557
  | 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`. |
558
+ | Usage looks stale | Check the local state file path shown by `/quota_status`. |
480
559
 
481
560
  </details>
482
561
 
@@ -485,29 +564,31 @@ Run `/quota_status` and check `qwen_oauth_source`, `qwen_local_plan`, and the `q
485
564
 
486
565
  Run `/quota_status` and check the Alibaba auth, resolved tier, state-file path, and `alibaba_coding_plan` live probe section.
487
566
 
488
- | Symptom | Fix |
489
- | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
567
+ | Symptom | Fix |
568
+ | --- | --- |
490
569
  | 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`. |
570
+ | Wrong tier | Set `alibabaCodingPlanTier` to `lite` or `pro` in `opencode-quota/quota-toast.json`. |
571
+ | Counters do not move | Confirm the current model is `alibaba/*` or `alibaba-cn/*`. |
572
+ | Quota seems stale | Check the state-file path shown in `/quota_status`. |
494
573
 
495
574
  </details>
496
575
 
497
576
  <details>
498
- <summary><strong>MiniMax, Kimi, Chutes AI, Crof.ai, Synthetic, Z.ai, and NanoGPT</strong></summary>
499
-
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).
501
-
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`, `CROFAI_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. |
577
+ <summary><strong>MiniMax, Kimi, Chutes AI, Crof.ai, Synthetic, Z.ai, Zhipu, and NanoGPT</strong></summary>
578
+
579
+ 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.
580
+
581
+ | Provider | Useful checks |
582
+ | --- | --- |
583
+ | MiniMax Coding Plan | Use `MINIMAX_CODING_PLAN_API_KEY` or `MINIMAX_API_KEY` for the international endpoint. Runtime/config ids like `minimax` and `minimax-coding-plan` use this provider. Repo-local provider secrets are ignored. |
584
+ | MiniMax Coding Plan (CN) | Use `MINIMAX_CHINA_CODING_PLAN_API_KEY` or trusted user/global OpenCode config under `minimax-china-coding-plan`, `minimax-cn-coding-plan`, `minimax-cn`, or `minimax-china`. Runtime id `minimax-cn-coding-plan` uses this provider. |
585
+ | Kimi Code | Use `KIMI_API_KEY` or `KIMI_CODE_API_KEY`; repo-local provider secrets are ignored. |
586
+ | Chutes AI | Use `CHUTES_API_KEY` or trusted user/global config. |
587
+ | Crof.ai | Use `CROF_API_KEY`, `CROFAI_API_KEY`, or trusted user/global config. |
588
+ | Synthetic | Use `SYNTHETIC_API_KEY`, trusted user/global config, or OpenCode auth. |
589
+ | Z.ai Coding Plan | Use `ZAI_API_KEY` or `ZAI_CODING_PLAN_API_KEY`; malformed fallback auth is surfaced as an auth error. |
590
+ | Zhipu Coding Plan | Use `ZHIPU_API_KEY` or `ZHIPU_CODING_PLAN_API_KEY`; malformed fallback auth is surfaced as an auth error. |
591
+ | NanoGPT | Use `NANOGPT_API_KEY`, `NANO_GPT_API_KEY`, trusted user/global config, or OpenCode auth. |
511
592
 
512
593
  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
594
 
@@ -518,12 +599,12 @@ For security, repo-local `opencode.json` / `opencode.jsonc` is ignored for provi
518
599
 
519
600
  Run `/quota_status` and check the `google_antigravity` section.
520
601
 
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`. |
602
+ | Symptom | Fix |
603
+ | --- | --- |
604
+ | Companion missing | Put `opencode-antigravity-auth` before `@slkiser/opencode-quota` in `opencode.json`. |
605
+ | Accounts not found | Check the selected `antigravity-accounts.json` path shown by `/quota_status`. |
606
+ | Refresh tokens invalid | Re-authenticate with the companion plugin. |
607
+ | Provider returns no rows | Check `live_probe`, `live_entry_*`, and `live_error_*` in `/quota_status`. |
527
608
 
528
609
  </details>
529
610
 
@@ -532,12 +613,12 @@ Run `/quota_status` and check the `google_antigravity` section.
532
613
 
533
614
  Run `/quota_status` and check the Gemini CLI live probe rows.
534
615
 
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`. |
616
+ | Symptom | Fix |
617
+ | --- | --- |
618
+ | Companion missing | Put `opencode-gemini-auth` before `@slkiser/opencode-quota` in `opencode.json`. |
619
+ | Provider not enabled in manual mode | Include `google-gemini-cli` in `enabledProviders` in `opencode-quota/quota-toast.json`. |
620
+ | Auth missing | Run `opencode auth login --provider google`. |
621
+ | Project missing | Set `provider.google.options.projectId`, `OPENCODE_GEMINI_PROJECT_ID`, `GOOGLE_CLOUD_PROJECT`, or `GOOGLE_CLOUD_PROJECT_ID`. |
541
622
 
542
623
  </details>
543
624
 
@@ -546,42 +627,42 @@ Run `/quota_status` and check the Gemini CLI live probe rows.
546
627
 
547
628
  Run `/quota_status` and check the `opencode_go` section.
548
629
 
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. |
630
+ | Symptom | Fix |
631
+ | --- | --- |
632
+ | Config not detected | Set both `OPENCODE_GO_WORKSPACE_ID` and `OPENCODE_GO_AUTH_COOKIE`, then rerun `/quota_status`. |
633
+ | Incomplete config | `workspaceId` and `authCookie` must come from the same source. |
634
+ | Scrape returns no data | Refresh the browser `auth` cookie from `opencode.ai`. |
635
+ | 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. |
636
+ | Dashboard format changed | This integration scrapes the dashboard, so it can break if the dashboard markup changes. |
556
637
 
557
638
  </details>
558
639
 
559
640
  <details>
560
- <summary><strong>Token Reports</strong></summary>
641
+ <summary><strong>Token reports</strong></summary>
561
642
 
562
643
  Run `/quota_status` and check pricing snapshot health plus OpenCode database paths.
563
644
 
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`. |
645
+ | Symptom | Fix |
646
+ | --- | --- |
647
+ | `/tokens_*` is empty | Start OpenCode once so it creates `opencode.db`, then run a session with model usage. |
648
+ | Pricing looks stale | Run `/pricing_refresh`. |
568
649
  | 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. |
650
+ | Cursor model has unknown pricing | Run `/pricing_refresh`; Cursor `auto` and `composer*` use bundled deterministic pricing. |
570
651
 
571
652
  </details>
572
653
 
573
- ### Issues
654
+ ## Issues
574
655
 
575
656
  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
657
 
577
- ### License
658
+ ## License
578
659
 
579
660
  MIT
580
661
 
581
- ### Remarks
662
+ ## Remarks
582
663
 
583
664
  OpenCode Quota is not built by the OpenCode team and is not affiliated with OpenCode or any provider listed above.
584
665
 
585
- ### Star History
666
+ ## Star history
586
667
 
587
668
  [![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)