dsh-allowance
Shows the remaining allowance of OpenCode Go, Grok, Command Code, ChatGPT and Claude in DSH, adds model providers with their key, counts token usage and cost, warns at thresholds, predicts the next message as ghost text, reads the DeepSeek API balance, stores their API keys, runs Grok's sign-in, reads the ChatGPT and Claude subscription windows from the local CLI login, and shows the working folder plus git branch beside the composer.
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:xuluoluo/dsh-quota说明文档
阅读完整 README ↗七、配置(都是可选的)
- id: dsh-quota
name: 'dsh-allowance'
config:
enabled: true # false = 整页停用(chip 也消失)
refreshMs: 60000 # 额度快照缓存与自动刷新间隔(10s–1h)
timeoutMs: 8000 # 单个厂商接口超时
providers: # 不写就是空页;写了就是整份替换,页面上的「添加」也是写到这儿
- id: opencode-go
preset: opencode-go
apiKeyEnv: OPENCODE_GO_API_KEY
- id: grok
preset: xai-billing
record: llm-pi-ai/xai
- id: commandcode
preset: commandcode
apiKeyEnv: COMMANDCODE_API_KEY
- id: deepseek
preset: deepseek-api
apiKeyEnv: DEEPSEEK_API_KEY
- id: bailian # 目录里没有 → 需要 llm-pi-ai.providers 里那条路由
preset: bailian
apiKeyEnv: DASHSCOPE_API_KEY
- id: my-oc # 换网关:baseURL 替换预设的默认根路径
preset: opencode-go
baseURL: https://opencode.ai/inference/go
predict: # 输入预测(默认关)
enabled: true
provider: opencode-go # 留空则跟随会话模型
model: deepseek-v4.1-flash
systemPrompt: '' # 留空用内置提示词
maxTokens: 120
maxContextMessages: 12
debounceMs: 700
showChip: true # 把 composer 右侧那枚 chip 打开(默认只有下方窄条)
alertAt: 90 # 最紧窗口到这个百分比 → ⚠ 接近上限
alertCriticalAt: 97 # 再到这个 → ⚠ 已达上限(红色)
balanceFloor: 5 # 余额卡低于这个数(同币种单位)也算告警
prices: # 覆盖/补充 build/prices.js 的目录价(USD / 百万 token)
"opencode-go/deepseek-v4.1-flash": { input: 0.15, output: 0.6, cacheRead: 0.003 }