Skip to content

GLFzr/dsh-opencode-go-quota

40Last commit Aug 15, 2026

dsh-opencode-go-quota DSH plugin

This plugin displays a 22px progress ring next to the model selector in the chat input, showing OpenCode Go quota usage (5-hour, weekly, monthly). It changes color based on urgency, pulsates when ≥80%, and injects quota status into the system prompt during agent requests to warn about approaching limits.

How to install the dsh-opencode-go-quota DSH plugin

dsh plugin --profile web add github:GLFzr/dsh-opencode-go-quota

Copying does not run this command. Review the repository and version before installing the dsh-opencode-go-quota DSH plugin.

dsh-opencode-go-quota DSH plugin data source

dsh-opencode-go-quota DSH plugin snapshot date: Aug 16, 2026

discovered

What the dsh-opencode-go-quota DSH plugin can do

  • Displays a 22px color-coded quota ring (green/blue/orange/red) with hover tooltip showing percentage and reset countdown.
  • Supports switching between 5-hour, weekly, and monthly usage windows by clicking the ring.
  • Auto-refreshes every 5 minutes; forces refresh on switch if data is older than 1 minute.
  • Injects quota status into the system prompt dynamically, only once per threshold level, to avoid prompt bloat.
  • Configurable thresholds (warnAt, criticalAt, escalateFrom, escalateStep, cacheTtl) via cordis.yml.
  • When quota is unavailable (no key or API failure), shows a gray '!' indicator with error reason in tooltip and console logs.

Where the dsh-opencode-go-quota DSH plugin fits

  • Monitor your OpenCode Go quota usage directly from the DSH chat interface without switching tabs.
  • Get proactive warnings when quota is running low, helping you manage costs and avoid interruptions.
  • Automatically adjust agent behavior based on quota levels (e.g., suggest pausing when near limit).
  • Combine with dsh-token-ledger to separate quota from token usage for detailed cost analysis.
  • Track quota reset timers for 5-hour, weekly, and monthly windows to plan usage efficiently.

Who the dsh-opencode-go-quota DSH plugin is for

  • DSH Web users who rely on OpenCode Go for API access and need to monitor usage.
  • Developers and power users who want real-time quota visibility and automated cost management within their coding environment.

dsh-opencode-go-quota DSH plugin limitations

  • Requires an OpenCode Go account and API key (either in auth.json or environment variable).
  • On Windows, the DSH sandbox policy may block child process execution if the workspace root is in a system TEMP directory; a fixed workspaceRoot is required.
  • Quota data depends on the official OpenCode API availability; failures result in a gray indicator and no prompt injection.
  • The plugin is designed specifically for DSH Web and does not work in other environments.

dsh-opencode-go-quota DSH plugin: from the repository README

Quoted from the GLFzr/dsh-opencode-go-quota README, the upstream source of the dsh-opencode-go-quota DSH plugin. Copyright remains with the original authors.

OpenCode Go 额度圆环 —— DSH Web 的持久化插件。 在聊天输入框**模型选择器左侧**显示一个 22px 进度圆环: - 中央字母 **5 / W / M**,点击循环切换 5小时 / 每周 / 每月 用量窗口 - 悬停显示「5小时 已用 X% · 重置倒计时」 - 颜色按紧急程度:绿 &lt;30% / 蓝 30-60% / 橙 60-80% / 红 ≥80% - 每 5 分钟自动刷新,点击切换时若数据超过 1 分钟则强制刷新 - **额度告急(≥80%)时圆环红色脉冲闪烁**,悬停提示「⚠ 5小时额度即将用尽,建议暂停等重置」 ## 配合 dsh-token-ledger 使用 额度(钱)与 token 用量是两回事:本插件回答「还剩多少额度」, [dsh-token-ledger](https://github.com/GLFzr/dsh-token-ledger) 则逐请求记录 真实的**输入 / 输出 / 缓存命中 token 数**(会话顶部「用量」页,堆叠柱状图, 支持按请求/按小时/按天/按轮次查看)。两个插件可同时安装、互不依赖: 额度圆环在输入框左侧,token 用量在「用量」页。 ## 对话内额度提醒(Codex CLI 式) 每次 agent 请求时,插件会把**当前额度状态动态注入 system prompt**,**只在进入新档位时注入一次**(同档内后续请求不重复,prompt 前缀稳定、省 token、利于缓存命中): | 5小时用量 | 行为 | |---|---| | <60%(warnAt) | **不注入**(零 prompt 成本) | | 60%-79% | 注入一次:注意档——建议在合适节点提醒用户、暂停待恢复 | | 80%-89% | 注入一次:告急档——主动提醒、任务边界暂停 | | 90% 起 | **每增长 2% 递进一档**(90/92/94/...),措辞紧急程度递增:严重 → 濒临耗尽 → 即将耗尽 → 几乎耗尽 → 近极限 → 已用尽(100%),每档只提醒一次 | 窗口重置回 60% 以下后,升档记忆自动清除,下次爬升会重新按档提醒。 阈值可通过 cordis.yml 配置(`warnAt` / `criticalAt` / `escalateFrom` / `escalateStep`,默认 60 / 80 / 90 / 2;`cacheTtl` 为用量缓存秒数,默认 60;`weeklyWarnAt` / `monthlyWarnAt` 为周/月圆环警示阈值,默认 90 / 95): ```yaml - id: dsh-opencode-go-quota config: warnAt: 60 criticalAt: 80

Read the full READMERepository license: MIT

dsh-opencode-go-quota DSH plugin questions

How do I install the OpenCode Go quota ring plugin?

You can install it by running `dsh plugin --profile web add <path-to-plugin>` for a local path, or `dsh plugin --profile web add github:GLFzr/dsh-opencode-go-quota` for GitHub installation. After installation, restart DSH Web for the plugin to take effect.

Why does the ring show a gray exclamation mark?

A gray exclamation mark indicates that the quota data is unavailable. This can happen if the OpenCode Go API key is missing or the API call fails. Check your key in `~/.local/share/opencode/auth.json` or set the `OPENCODE_GO_API_KEY` environment variable. Also ensure the DSH shell can run subprocesses, especially on Windows with sandbox policies.

Can I use this plugin without an OpenCode Go account?

No. The plugin requires a valid OpenCode Go API key to fetch quota data. You need an OpenCode Go account and a key (either from the auth.json file or the environment variable). Without it, the ring will show a gray indicator and no quota information will be displayed.

How do I configure the warning thresholds?

You can configure thresholds in your cordis.yml file under the plugin config. The parameters are `warnAt` (default 60%), `criticalAt` (80%), `escalateFrom` (90%), `escalateStep` (2), `cacheTtl` (60 seconds), and `weeklyWarnAt`/`monthlyWarnAt` (90/95). Add these to your profile's cordis.patch.yml.

Does this plugin affect token usage or prompt size?

The plugin injects quota status into the system prompt only when entering a new threshold level, and only once per level. When usage is below 60%, nothing is injected. This design minimizes prompt size and helps with cache hit ratios. It does not track token usage itself; that's handled by the separate dsh-token-ledger plugin.