跳到主要内容
    ↑↓ 选择↵ 打开esc 关闭
    中文English
    taraksh01

    Oc Usage

    v1.0.0可观测与分析
    @taraksh011/oc-usage

    OpenCode plugin — live token usage, cost, and TPS display

    GitHub 星标

    1

    月装机量

    93

    近 7 天 7

    综合评分SCORE

    33.6

    生态多维模型

    最近提交

    23 天前

    2026-07-27

    快速安装与配置

    opencode.json

    写入当前项目的 opencode.json,只对这个仓库生效。

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["@taraksh011/oc-usage@1.0.0"]
    }

    opencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。

    OpenCode TUI plugin — displays per-session token usage, cost, and TPS in the prompt bar.

    ↑1.2K [450] ↓3.5K [2.1K] $0.0214 ⚡45 ∅38
    
    • ↑ total [current] — input tokens (cumulative / last message)
    • ↻ total [current] — cache read tokens (cumulative / last message)
    • ↓ total [current] — output tokens including reasoning (cumulative / last message)
    • $cost — total session cost
    • ⚡tps — instant tokens/sec (1s rolling window)
    • ∅ tps — average tokens/sec (across streaming duration)

    Data persists across restarts via TuiKV.

    Install

    // ~/.config/opencode/tui.jsonc
    {
      "plugins": ["@taraksh011/oc-usage"]
    }
    

    Then restart OpenCode.