2
7
近 7 天 1
22.6
生态多维模型
4 个月前
2026-04-12
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-crof-sidebar@0.1.2"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-crof-sidebar@0.1.2"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D opencode-crof-sidebaropencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
CrofAI usage stats in the OpenCode sidebar. Shows requests/day and credits.
Install
git clone https://github.com/Red44/crofai-opencode.git
cd crofai-opencode
bun install
bun install automatically registers the plugin in your global OpenCode tui.json.
It also configures the global OpenCode opencode.json CrofAI provider automatically using the live https://crof.ai/v1/models API.
On plugin startup it also performs a best-effort live refresh of the running OpenCode config, so newly fetched CrofAI models can apply without a restart.
Updating
On every OpenCode start the plugin runs git pull --ff-only in the background. If new commits are found it runs bun install automatically. No manual steps needed.
Requirements
- CrofAI must be configured as an OpenCode provider in your
opencode.json bun installauto-configures the CrofAI provider inopencode.json- The plugin reads the API key from the configured CrofAI provider automatically
CROFAI_API_KEYcan still be used as a fallback override- Existing
provider.CrofAI.options.apiKeyvalues are preserved and never overwritten
Behavior
- Shows
Requests: XXX/dayandCredits: $X.XXXX - Shows current model speed as
~XX t/susing data extracted from the CrofAI pricing page HTML - Only appears for sessions that already have CrofAI message history
- Updates in real-time after every message
- Falls back to 30-second interval if no messages are sent
- Refreshes the CrofAI model list from
/v1/modelsand pushes a best-effort live config update on plugin startup - Auto-updates from git on every OpenCode start (non-blocking)
License
MIT