npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opencode-provider-balance

v0.1.1

Published

OpenCode TUI plugin displaying DeepSeek account balance in the sidebar

Readme

opencode-provider-balance

OpenCode TUI 插件 · 在侧边栏实时显示 DeepSeek 账户余额

License


功能

  • 余额展示:在 TUI 侧边栏显示 DeepSeek 账户的总余额、赠金余额、充值余额
  • 可用状态:实时显示账户是否可调用 API
  • 自动刷新:每次 LLM 输出完成后自动查询余额
  • 手动刷新:输入 /balance 命令立即刷新
  • 折叠面板:默认折叠,点击标题展开查看详情
  • 自适应主题:颜色跟随 OpenCode 主题自动适配

安装

方式一:命令面板安装

在 OpenCode 中按 Ctrl + P 打开命令面板,搜索 install plugin,输入:

opencode-provider-balance@latest

方式二:手动配置

创建或编辑 ~/.config/opencode/tui.jsonc

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": ["opencode-provider-balance@latest"]
}

使用

安装后重启 OpenCode,侧边栏即可看到余额面板:

▶ DeepSeek 余额     ¥110.00

点击展开:

▼ DeepSeek 余额
────────────────────
  ✅ 可用       CNY
  ────────────────────
  ¥110.00        总余额
  ────────────────────
  ¥10.00      赠金余额
  ¥100.00     充值余额
  ────────────────────
  上次更新: 16:53:22

斜杠命令

| 命令 | 功能 | | ---------- | ------------ | | /balance | 手动刷新余额 |

API Key 配置

插件按以下优先级自动获取 DeepSeek API Key:

  1. auth.json — 通过 /connect 选择 DeepSeek 时自动存储于 ~/.local/share/opencode/auth.json
  2. 环境变量DEEPSEEK_API_KEY

开发

git clone <repo-url>
cd opencode-provider-balance
pnpm install
pnpm tsc          # 编译
pnpm typecheck    # 类型检查

License

MIT