1
478
近 7 天 48
38.9
生态多维模型
6 天前
2026-09-29
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-cost-details@0.5.0"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-cost-details@0.5.0"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D opencode-cost-detailsOpenCode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
Small plugins for OpenCode. Each package supports OpenCode 1 and OpenCode 2.
Plugins
opencode-cost-details
Shows the current and previous prompt-turn cost in the sidebar Context section.
opencode2 plugin add opencode-cost-details
opencode-prs
Shows GitHub pull requests opened by the current session. Every title links to GitHub.
opencode2 plugin add opencode-prs
opencode-awake
Keeps your computer awake while a session works, including with the laptop lid closed on macOS and Linux.
opencode2 plugin add opencode-awake
See each plugin README for OpenCode 1 installation and configuration.
Development
pnpm install
pnpm typecheck
pnpm test
Packages live under packages/. Each package builds its TypeScript and JSX into dist/ before publishing because OpenCode loads published plugins from node_modules.
To use both plugins from this checkout:
pnpm dev:link
pnpm dev
dev:link configures both compiled plugin directories in cli.json and removes the published versions. dev rebuilds both plugins when their source changes. Restart the OpenCode client after a rebuild to load it.
Restore the published configuration with:
pnpm dev:unlink
Releasing
Releases use Changesets and npm trusted publishing. There is no npm token in the repository.
- Run
pnpm changesetin a feature branch and commit the generated file. - Merge the feature PR. CI opens or updates
release: version packages. - Merge the release PR. CI publishes every changed package to npm.
Each npm package must trust the release.yml workflow in vvo/opencode-plugins.
License
MIT
同类生态推荐
Oc Usage
@taraksh011/oc-usage
OpenCode plugin — live token usage, cost, and TPS display
Usage Panel
opencode-usage-panel
Sidebar token-usage and cost panel for the opencode TUI. Breaks a session down by model with per-model cost, context usage, and configurable peak/off-peak pricing.
Openrouter Costs
opencode-openrouter-costs
OpenCode TUI plugin — sidebar widget showing OpenRouter session cost and account balance