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

dsh-opencode-go-stats

v0.1.4

Published

OpenCode Go 用量统计侧边栏插件 for DSH Web — 远程 quota 优先 + 本地 token 兜底

Readme

dsh-opencode-go-stats

npm version npm downloads

DSH Web 侧边栏插件:用量监控 — OpenCode Go 与火山引擎 CodingPlan,可一键切换。已发布到 npm([email protected])。

  • 形态:左侧栏页脚按钮 + 内联展开面板(三档进度条 + 重置倒计时 + 状态色点),轮询默认 5min。
  • 数据源(面板顶部切换,凭据按源独立存储于 localStorage):
    • OpenCode Go:GET https://opencode.ai/zen/go/v1/usage,返回 rolling / weekly / monthly 三档 usage_percent 与 resets_in_seconds。无订阅时返回 EntitlementError,面板黄条提示。
    • 火山引擎 CodingPlan:控制台抓包接口 GetCodingPlanUsage,5小时 / 7天 / 30天 三档用量。凭据为登录控制台后的 Cookie(含 digest 与 csrfToken),会话过期需重新抓取。
  • 源码:https://github.com/cxykyw/dsh-opencode-go-stats

安装

从 npm 安装(其他电脑,推荐)

dsh plugin --profile web add dsh-opencode-go-stats
pkill -f "dsh web"; dsh web

本地开发(源码安装)

cd /Users/kyw/project/source-code/dsh-opencode-go-stats
npm install
npm run build
dsh plugin --profile web add /Users/kyw/project/source-code/dsh-opencode-go-stats
pkill -f "dsh web"; dsh web

离线安装

将 npm pack 产出的 dsh-opencode-go-stats-0.1.0.tgz 拷贝到目标机器,dsh plugin --profile web add /path/to/dsh-opencode-go-stats-0.1.0.tgz 后重启。

使用

  1. 打开任意会话,左栏页脚出现用量监控按钮(带绿/黄/红色状态点)。
  2. 点开面板:
    • OpenCode Go:粘贴 OPENCODE_GO_API_KEY(与 llm-pi-ai.providers.opencode-go.apiKeyEnv 同源)。
    • 火山 CodingPlan:浏览器登录火山控制台 Coding Plan 额度页 → F12 → Network 搜 GetCodingPlanUsage → 复制请求头的 Cookie 粘贴到输入框(需含 digest 与 csrfToken)。
  3. 面板顶部可随时切换数据源。

发布新版本(维护者)

npm version patch && npm run build && git add -A && git commit -m "chore: release vX.Y.Z" && git push && npm publish

安全说明

  • 代码中不含任何真实凭据;API Key / Cookie 仅保存在本机浏览器 localStorage,经 host 同源代理转发。
  • 火山 Cookie 为登录会话凭据,请勿泄露给第三方。