跳到主要内容
    ↑↓ 选择↵ 打开esc 关闭
    中文English
    dmmop
    @dmmop/opencode-tps

    OpenCode TUI plugin that displays response performance metrics.

    GitHub 星标

    1

    月装机量

    166

    近 7 天 16

    综合评分SCORE

    36.1

    生态多维模型

    最近提交

    1 天前

    2026-08-18

    快速安装与配置

    opencode.json

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

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["@dmmop/opencode-tps@1.0.1"]
    }

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

    npm version npm downloads Release License: MIT

    OpenCode TUI plugin that displays response performance metrics while a session is running.

    Features

    • Live tokens-per-second (TPS) estimate for the active response.
    • Session-wide average output and reasoning token rate (AVG).
    • Time to first token (TTFT).
    • Tracks text, reasoning, and tool-input streaming events.
    • Uses the OpenCode TUI session composer slot without changing conversation output.

    Installation

    Add the published package to the plugins array in your OpenCode configuration:

    {
      "$schema": "https://opencode.ai/config.json",
      "plugins": ["@dmmop/opencode-tps"]
    }
    

    OpenCode installs the package and its production dependencies automatically. To pin a release, use a versioned package specifier such as @dmmop/opencode-tps@1.0.0.

    Development

    Requirements:

    • Bun
    • An OpenCode V2 environment with TUI plugin support

    Install dependencies:

    bun install
    

    The plugin entrypoint is src/index.ts. Load that entrypoint using your OpenCode plugin configuration while developing locally.

    Releasing

    A maintainer can trigger a release from GitHub Actions:

    1. Go to Actions > Release > Run workflow.
    2. Choose patch, minor, or major.
    3. The workflow installs the locked dependencies, checks the npm package, bumps the version, creates and pushes a Git tag, creates a GitHub Release, and publishes @dmmop/opencode-tps to npm with provenance.

    Metric notes

    TPS is an estimate based on the byte length of streamed deltas. AVG is calculated from the output and reasoning token counts reported when a session step ends. TTFT measures the time from the start of a session step until the first streamed token.

    License

    MIT