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

    Stats For Nerds

    v1.0.0可观测与分析
    opencode-stats-for-nerds

    OpenCode TUI plugin — token usage, speed, and cost stats in the sidebar

    GitHub 星标

    1

    月装机量

    49

    近 7 天 10

    综合评分SCORE

    30.5

    生态多维模型

    最近提交

    1 个月前

    2026-07-02

    快速安装与配置

    opencode.json

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

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["opencode-stats-for-nerds@1.0.0"]
    }

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

    OpenCode TUI plugin that shows token usage, context window, generation speed, cost, and file changes in the sidebar after each response.

    Install

    opencode plugin opencode-stats-for-nerds
    

    Restart OpenCode. A Stats for Nerds panel appears in the right sidebar.

    What it shows

    ▼ Stats for Nerds
      Tokens       13.4k in · 1.2k out · 2.0k thinking
      Cached       3.8k read · 2.7k write
      Context      23.2k / 200k (11%)
      ────────────────
      Cost         $0.0070
      Gen Time     2m 14s
      TTFT         1.35s
      Speed        42.3 tok/s
      ────────────────
      Changes      +234 -56 · 5 files
      Model        claude-sonnet-4
    

    Click the header to collapse/expand.

    Stats reference

    Stat Scope Description
    Tokens Cumulative Input, output, and thinking tokens across all turns
    Cached Cumulative Prompt cache hits (read = reused, write = newly cached)
    Context Current Context window used vs model limit, with percentage
    Cost Cumulative Total session cost at provider rates
    Gen Time Cumulative Total time the model spent generating
    Think Time Cumulative Total time the model spent reasoning (off by default)
    TTFT Last response Time-to-first-token
    Speed Last response Output tokens per second
    Activity Cumulative Tool-call steps and invocations (off by default)
    Changes Session File additions, deletions, and count
    Model Last response Model ID

    Configuration

    Disable any stat via tui.json:

    {
      "$schema": "https://opencode.ai/tui.json",
      "plugin": [
        ["opencode-stats-for-nerds", {
          "show": {
            "cache": false,
            "activity": true,
            "model": false
          }
        }]
      ]
    }
    

    All options default to true except thinkTime and activity.

    Key Default Controls
    tokens true Input/output/thinking row
    cache true Cache read/write row
    context true Context window used / limit (%)
    cost true Session cost
    genTime true Total generation time
    thinkTime false Total reasoning time
    ttft true Time-to-first-token
    speed true Tokens per second
    activity false Steps and tool calls
    changes true File additions/deletions
    model true Model name

    Requirements

    License

    MIT