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

tokscale-corp

v0.1.11

Published

公司内部大模型用量排行榜上报工具

Readme

tokscale-corp

公司内部大模型用量排行榜上报工具。把你本地的 Claude Code / Cursor / Codex / Antigravity 用量数据脱敏后上传到内部排行榜服务器。

一分钟接入

# 1. 登录(自动打开浏览器走飞书 OAuth)
npx tokscale-corp@latest login

# 2. 注册每小时自动上报(cron / launchd / Task Scheduler)
npx tokscale-corp@latest install

跑完这两步就完事了。打开内部 finance-review /llm-usage 看排行榜。

命令清单

| 命令 | 说明 | |------|------| | tokscale-corp login | 完成飞书登录,保存 token 到 ~/.tokscale-corp/auth.json(mode 0600) | | tokscale-corp upload [--verbose] [--quiet] | 立即扫描并上传一次 | | tokscale-corp install | 注册每小时自动上报 | | tokscale-corp uninstall | 删除定时任务和本地配置(服务器上已上传的历史数据保留) | | tokscale-corp pause | 暂停上传(保留 token / cron) | | tokscale-corp resume | 恢复上传 | | tokscale-corp status | 显示登录状态 / 上次上传 / 定时任务 / 本地扫描统计 |

隐私清单

会上传

  • Token 用量数值(input / output / cache_read / cache_write / reasoning)
  • 模型名(如 claude-sonnet-4gpt-4o
  • 时间戳
  • 脱敏后的项目名(仓库名或目录名,去掉路径和用户名)
  • 模型成本(如果数据源里有)

不会上传

  • 你的 prompt 内容
  • AI 的回复内容
  • 文件路径或本机用户名
  • 代码内容
  • 机器名、IP

数据来源

| 工具 | 数据位置 | |------|----------| | Claude Code | ~/.claude/projects/*/.jsonl | | Cursor | ~/Library/Application Support/Cursor/User/workspaceStorage/*/state.vscdb (Mac)%APPDATA%/Cursor/User/workspaceStorage/*/state.vscdb (Win)~/.config/Cursor/User/workspaceStorage/*/state.vscdb (Linux) | | Codex | ~/.codex/sessions/*.jsonl~/.codex/history.jsonl | | Antigravity | 运行中的 Antigravity 本地 Language Server RPC + ~/.gemini/antigravity/conversations/*.pb session id;SQLite User/globalStorage/state.vscdb / workspaceStorage/*/state.vscdb 仅作保底 |

每条记录有唯一的 external_id(基于 session + message id),重复上传幂等,不会重计。

故障排查

npx 慢 / 拉不下包

切换 npm 国内镜像:

npm config set registry https://registry.npmmirror.com

找不到数据

  • 跑过 Claude Code / Cursor / Antigravity 但 status 显示 0 条记录?检查目录是否存在
  • Antigravity 精确用量优先从运行中的本地 RPC 读取;如果 Antigravity 没打开,本次扫描会跳过,下一次定时任务会再试
  • Cursor / Antigravity SQLite 文件可能被锁,CLI 会自动复制到 tmp 重试
  • Codex 数据格式版本差异较大,识别失败会跳过(不会让整体上传失败)
  • Antigravity 采用精确优先策略:只上传 RPC/本地库里的明确 usage token 字段,不把 context-window 估算值或文本长度估算当成用量

登录超时

登录会话 10 分钟过期。重新跑 tokscale-corp login

想换服务器

设置环境变量:

export TOKSCALE_CORP_API=https://your-finance-review.company.com

支持 http://https://

想退出

npx tokscale-corp@latest uninstall

删除:定时任务 + ~/.tokscale-corp/ 本地配置。服务器上你已上传的历史数据保留——本工具不提供删除服务器数据的能力,需要联系管理员。

内部支持

有问题找 #finance-review 飞书群。