0
1,049
近 7 天 67
38.1
生态多维模型
14 天前
2026-09-20
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@npv12/opencode-context-sidebar@0.4.7"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@npv12/opencode-context-sidebar@0.4.7"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D @npv12/opencode-context-sidebarOpenCode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
OpenCode V2 TUI sidebar plugin that displays context window usage, token counts, and session cost as a progress bar.
Rendered as the first element of the sidebar at all times — the plugin prepends to sidebar.content, so it sits above every section the host appends.
Features
- Visual progress bar showing context window usage percentage
- Color-coded bar (success → warning → error as usage increases)
- Displays token count, context window limit, and session cost
- Mirrors the host's context math: last assistant step after the most recent compaction, respecting reverts
- Updates in real-time via the reactive V2 data layer
Installation
opencode2 plugin add @npv12/opencode-context-sidebar
Or add to your cli.json:
{
"plugins": ["@npv12/opencode-context-sidebar/tui"]
}
Requires OpenCode 0.0.0-beta-17963 or compatible. Not compatible with V1.
To avoid duplicating the built-in Context section, disable it:
{
"plugins": ["@npv12/opencode-context-sidebar/tui", "-opencode.sidebar.context"]
}
Attribution
This plugin is adapted from streetturtle's context-progress plugin in the opencode-better-sidebar repository.
License
MIT
同类生态推荐
Context Progress
@streetturtle/opencode-context-progress
OpenCode TUI sidebar plugin for context usage progress
User Message Jumper
opencode-user-message-jumper
OpenCode TUI plugin that adds a user-message index to the session sidebar.
Skills Tui
opencode-skills-tui
OpenCode TUI plugin that shows skills and loaded state in the sidebar