@kuso_zz/opencode-token-dashboard
v0.1.4
Published
Token usage dashboard for OpenCode TUI sidebar
Maintainers
Readme
opencode-token-dashboard
Token usage dashboard for OpenCode TUI sidebar. 在 OpenCode 侧边栏显示 Token 用量看板。
安装 Installation
自动配置 Auto Setup
npx @kuso_zz/opencode-token-dashboard手动配置 Manual
在 ~/.config/opencode/tui.json 中添加:
{
"plugin": ["@kuso_zz/opencode-token-dashboard"]
}重启 OpenCode 即可生效。 Restart OpenCode to activate.
功能 Features
侧边栏显示:
- 当前会话 token 用量(输入/输出/缓存比例/费用)
- Tab 切换:今日 / 7天 / 30天 汇总
- 堆叠条 + 模型用量排行
通过命令面板(Ctrl+P)搜索「今日」「7天」「30天」切换时间范围。
TUI 界面效果
Token 用量 ← 标题
输入 1.90M / 输出 214.5K ← 当前会话
缓存 97.2% / $0.5864 ← 当前会话
今日 | 7天 | 30天 ← 时间范围切换
3302 条 · 7.70M · $2.39 ← 选中范围汇总
████████████████████████████ ← 堆叠条
* v4-flash(max) 70% 5.40M ← 模型排行
* v4-flash 20% 1.54M
* v2.5(medium) 8% 610.7K通过命令面板(Ctrl+P)搜索「今日」「7天」「30天」切换时间范围。
Theme colors / 多语言 Multi-language
- 输入 Input: default text
- 输出 Output: primary (blue)
- 缓存 Cache: success (green)
- 费用 Cost: warning (yellow)
- 当前选中标签 Active tab: accent
根据系统语言自动切换中英文界面。LANG=zh* → 中文,否则 → English。
Auto-detects system language via LANG env variable.
License
MIT
