caomeiyouren/cmyr-skills-agents/opencode-usage

Claude Code and agent skill by caomeiyouren/cmyr-skills-agents

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

OpenCode Token 消耗统计插件,读取本地 SQLite 数据库生成 token 和费用消耗报表,提供 TUI 斜杠命令与 CLI 模式。

Install

npx vskill@latest install caomeiyouren/cmyr-skills-agents/opencode-usage

SKILL.md

⚠️ 已弃用(deprecated):保留文件仅供回溯,不再进入索引、L0 分发与推荐路径。替代:直接使用对应的 CLI / 插件,不需要技能封装。移除条件:下游项目一个发布周期内无回退需求后再物理删除。

opencode-usage

OpenCode Token 消耗统计插件。读取 OpenCode 本地 SQLite 数据库,生成 token 和费用消耗报表。

功能

  • TUI 斜杠命令:在 OpenCode TUI 中键入 /usage(或别名 /cost、/tokens)弹出统计弹窗
  • 时段统计:今日 / 本周 / 本月 / 总计
  • 每日明细:最近 30 天逐日统计
  • 模型维度:按 provider/model 逐模型拆分
  • CLI 模式:也可作为独立命令行脚本运行

CLI 用法

sh
node .opencode/skills/opencode-usage/usage.mjs # 总览
node .opencode/skills/opencode-usage/usage.mjs daily # 每日明细(近 30 天)
node .opencode/skills/opencode-usage/usage.mjs models # 按模型统计
node .opencode/skills/opencode-usage/usage.mjs today # 仅今日
node .opencode/skills/opencode-usage/usage.mjs week # 仅本周
node .opencode/skills/opencode-usage/usage.mjs month # 仅本月
node .opencode/skills/opencode-usage/usage.mjs all # 全部

数据来源

读取 OpenCode 的 SQLite 数据库:

环境变量用途
OPENCODE_DB指定完整数据库路径
OPENCODE_DATA_DIR指定数据目录
XDG_DATA_HOMEXDG 数据目录(Linux/macOS)
APPDATA / XDG_DATA_HOME数据目录(默认 ~/.local/share/opencode)

安装

插件已声明在 .opencode/tui.json 中,OpenCode TUI 会自动加载该插件。

全局安装(可选)

若要在所有项目中都可用,可将 plugin 声明添加到 ~/.config/opencode/tui.json:

json
{
"$schema": "https://opencode.ai/tui.json",
"plugin": ["/absolute/path/to/cmyr-skills-agents/.opencode/skills/opencode-usage/usage-plugin.ts"]
}

依赖

  • @opencode-ai/plugin — OpenCode TUI 插件 API

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/caomeiyouren/cmyr-skills-agents/opencode-usage/badge)](https://verified-skill.com/skills/caomeiyouren/cmyr-skills-agents/opencode-usage)

Something wrong with this skill or its page? Tell us.