@changehow/oc-insight

中文文档
1.2.1发布于 2026/11/09GPL-3.0-onlyES Module近 30 天下载 2110

Local-first token usage dashboard for OpenCode sessions.

原始使用文档
文档目录5 节
  1. Dashboard
  2. From npm (recommended)
  3. From source
  4. OpenCode + OpenChamber plugins
  5. Host-shared instance

OpenCode Insight

Node pnpm

Local-first usage analytics and session insight for OpenCode.

  • Dashboard: explore token usage, estimated cost, activity trends, and model/provider breakdowns. Drill into sessions and message/tool timelines, query usage from the CLI, and optionally sync aggregates across machines. Reads local OpenCode usage and Codex transcripts.
  • OpenCode + OpenChamber Insight: an OpenCode V2 capture plugin and an OpenChamber panel for generation speed, context-source estimates, reported token usage, and tool timing. The panel works without the dashboard; the dashboard can also display V2 session insight.

Dashboard showing usage totals, token composition, and activity trends with synthetic data

Insight panel showing generation speed, token composition, and tool timing with synthetic data

Screenshots use synthetic data. The Insight image is a standalone preview of the actual panel, not the OpenChamber application shell. Source estimates are not billing measurements, and capture begins when the plugin loads.

Usage

Dashboard

Requires Node.js 24+. No source checkout, pnpm, or local build is needed.

npm install -g @changehow/[email protected]
opendash server

Open localhost:8787. Keep the default loopback binding: the dashboard has no authentication and can display private session content.

The dashboard reads OpenCode data from its default local directory and Codex transcripts from CODEX_HOME, defaulting to ~/.codex. For custom data paths or sync settings, create a .env.local file in your working directory. Set OPENCODE_DATA_DIR to your OpenCode data directory (containing opencode.db or legacy storage/), then explicitly load the file when starting the globally installed CLI:

OPENDASH_ENV=.env.local opendash server

Relative OPENDASH_ENV paths resolve from the directory where you run the command. If the daemon is already running, run opendash stop before restarting it to load the configuration.

opendash summary --range month
opendash models --json
opendash stop

From source

Requires Node.js 24+ and pnpm 10+. Use this option for development or local builds.

git clone https://github.com/ChangeHow/opencode-insight.git
cd opencode-insight
pnpm install
cp .env.example .env.local

Set OPENCODE_DATA_DIR in .env.local to your OpenCode data directory (containing opencode.db or legacy storage/). Codex transcripts are read from CODEX_HOME, defaulting to ~/.codex.

pnpm build
node scripts/opendash.mjs server

For this installation, use node scripts/opendash.mjs in place of opendash for the query and stop commands above.

For live V2 session metrics, install the capture plugin below, then use Inspect an OpenCode V2 session on the overview. Optional multi-machine sync is documented in Connect another machine.

OpenCode + OpenChamber plugins

Insight 1.2.0 requires Node.js 24+ and OpenChamber 2.7.0+ for the host-shared panel. OpenChamber 2.7.0 requires OpenCode 2.2.4+; this integration is verified with OpenCode 2.2.5. The panel follows OpenChamber's selected instance without a host patch. Insight 1.1.0 used independent connection discovery instead.

OpenChamber can load the bundled capture plugin into its managed OpenCode. For an externally managed local OpenCode or a standalone dashboard, add the matching package to plugins in your global ~/.config/opencode/opencode.jsonc or project-local opencode.jsonc, preserving existing entries:

{
  "$schema": "https://opencode.ai/config.json",
  "plugins": ["@changehow/[email protected]"],
}

OpenCode installs and loads the capture plugin itself. To install the OpenChamber panel:

npm install -g @changehow/[email protected]
opendash extension-path openchamber

In OpenChamber, open Settings → Extensions → Add, select the printed openchamber/ folder, and approve the local service, OpenCode reads, and bundled OpenCode plugin. Open Insight on the rail and select an OpenCode session. When upgrading, update both the panel and any separately configured capture plugin to the same version; avoid loading an older capture build alongside the host-managed bundle.

OpenCode must already be running with the capture plugin loaded. Insight never starts or restarts it. See the Insight guide for source builds, remote connections, upgrades, and measurement limits.

Host-shared instance

Insight 1.2.0 includes shared-instance support. It requires OpenChamber 2.7.0+, with no host patch, and the capture plugin and panel from the same Insight build.

The OpenChamber backend and OpenCode must run on the same machine. The browser may connect remotely. An OpenChamber backend pointing to OpenCode on another machine is not supported by this mode. The panel follows the host-selected instance exclusively; it never falls back to Service.discover() or connection.json.

For a source installation, build with pnpm install and pnpm build:extensions, then install the folder printed by node scripts/opendash.mjs extension-path openchamber. Approve the same capabilities as for the npm installation above. See host-shared connections for delivery limits.

License

Copyright (C) 2026 ChangeHow. Original project code is licensed under the GNU General Public License, version 3 only (GPL-3.0-only). When distributing covered versions, provide the corresponding source under the GPL; private use and modification do not require public disclosure. Vendored AgentPrism code retains its upstream MIT license and notices in THIRD_PARTY_NOTICES.md.

版本与发布记录

@changehow/oc-insight 共发布 20 个版本,首次发布于 2026/08/21;过去 12 个月发布了 20 个版本。

版本发布日期距今
1.2.1latest2026/11/091 天前
1.2.02026/11/081 天前
1.1.02026/10/2317 天前
1.1.0-beta.12beta2026/10/2317 天前
1.1.0-beta.112026/10/2318 天前
1.1.0-beta.102026/10/2218 天前

关于 @changehow/oc-insight 的常见问题

@changehow/oc-insight 是什么?

Local-first token usage dashboard for OpenCode sessions.

如何安装 @changehow/oc-insight?

在项目目录运行 npm install @changehow/oc-insight,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 opendash,可以用 npx opendash 直接运行。

@changehow/oc-insight 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/changehow__oc-insight 是否存在。

@changehow/oc-insight 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@changehow/oc-insight 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=24.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@changehow/oc-insight 可以商用吗?

@changehow/oc-insight 使用 GPL-3.0-only 许可。强 Copyleft:分发包含该代码的软件时,整个作品需以 GPL-3.0 兼容许可开源,并附带专利与反锁定条款。仅内部使用不触发此义务。以上为概括,不构成法律意见,请以许可原文为准。

@changehow/oc-insight 的下载量有多少?

根据 npm 官方下载统计,@changehow/oc-insight 在 2026/10/10 – 2026/11/08 这 30 天内被下载 2,110 次,日均约 70 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@changehow/oc-insight 还在维护吗?

最新版本 1.2.1 发布于 2026/11/09(1 天前);至今共发布 20 个版本,其中过去 12 个月发布了 20 个;首次发布于 2026/08/21。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。