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

llm-cny

v1.0.11

Published

在 OpenCode TUI 右侧栏显示 DeepSeek V4 与 moonshot China 人民币费用和账户余额。

Readme

llm-cny

在 OpenCode TUI 右侧栏显示 DeepSeek V4、moonshot China 的人民币费用和账户余额。

功能

  • 统计 deepseek 提供商下的 deepseek-v4-flashdeepseek-v4-pro
  • 统计 moonshotai-cn 提供商下的 kimi-k2.5kimi-k2.6
  • 基于当前 session 的 assistant 消息 token 用量重新计算人民币费用。
  • 区分缓存命中输入、缓存未命中输入、输出 token;推理 token 按输出价格计费。
  • deepseek-v4-pro 使用常态化特价。
  • 新会话未使用已支持模型时只显示激活提示,不显示费用和余额信息。
  • 每次已支持模型回复完成后自动刷新对应余额,仍可手动点击“刷新”或按间隔自动刷新。
  • 自动复用已有 API Key 读取余额,来源依次为:
    • OpenCode provider 的 key
    • provider options.apiKey
    • provider 声明的环境变量,例如 DEEPSEEK_API_KEYMOONSHOT_API_KEY
    • 当前进程的 DEEPSEEK_API_KEYMOONSHOT_API_KEY
    • OpenCode 配置里的 provider.<id>.options.apiKey

价格

单位为人民币 / 百万 tokens。

| 模型 | 缓存命中输入 | 缓存未命中输入 | 输出 | | --- | ---: | ---: | ---: | | deepseek-v4-flash | 0.02 元 | 1 元 | 2 元 | | deepseek-v4-pro | 0.025 元 | 3 元 | 6 元 | | kimi-k2.5 | 0.7 元 | 4 元 | 21 元 | | kimi-k2.6 | 1.1 元 | 6.5 元 | 27 元 |

安装

opencode plugin llm-cny

或在 .opencode/tui.jsonc 中手动添加:

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": [
    [
      "llm-cny",
      {
        "balanceRefreshMs": 600000,
        "showWhenEmpty": true
      }
    ]
  ]
}

本地开发

bun install
bun test
bun run typecheck
bun run build

本地调试时可以把插件入口写进 .opencode/tui.jsonc

{
  "plugin": ["./llm-cny/src/tui.tsx"]
}

配置

  • balanceRefreshMs:DeepSeek 激活后的余额刷新间隔,默认 600000,最小 60000
  • showWhenEmpty:当前 session 未使用 DeepSeek 时是否显示激活提示,默认 true

说明

DeepSeek 余额接口使用 GET https://api.deepseek.com/user/balance,moonshot China 余额接口使用 GET https://api.moonshot.cn/v1/users/me/balance。插件不会显示或记录 API Key。费用统计只在本地 TUI 中展示,实际扣费以官方账单为准。