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

@chartgen.ai/claw-bi

v0.1.0

Published

OpenClaw usage cost analytics, output value assessment, and optimization suggestions.

Downloads

14

Readme

ClawBI

OpenClaw 用量成本分析插件。自动采集 agent 运行数据,生成交互式报告,帮你看清每天花了多少、花在哪里、效率如何。

功能

  • 成本追踪:按 agent、模型、渠道、时间段统计 token 用量和费用
  • 效率分析:缓存命中率、异常中断率、上下文长度趋势
  • 互动分析:用户响应间隔、heartbeat/cron 任务占比
  • 多格式输出:HTML(交互图表)、Markdown、文本简报、PDF
  • AI 对话集成:直接问 AI「帮我分析费用」,自动调用分析工具

支持模型:Claude(全系列)、GPT-4.1/4o、Gemini 2.5/2.0/1.5、GLM-5/4

安装

前置条件OpenClaw >= 2026.3.2

# 克隆到本地
git clone https://github.com/your-org/claw-bi.git
cd claw-bi
npm install
npm run build

然后在 ~/.openclaw/openclaw.jsonplugins.load.paths 中添加路径:

{
  "plugins": {
    "load": {
      "paths": ["/path/to/claw-bi"]
    },
    "entries": {
      "claw-bi": { "enabled": true }
    }
  }
}

重启 OpenClaw 即可。

使用

命令行

/bi           # 显示帮助
/bi 7d        # 分析最近 7 天
/bi 30d       # 分析最近 30 天
/bi all       # 全量历史数据
/bi 7d markdown   # 输出 Markdown 格式
/bi 7d pdf        # 输出 PDF(需要 puppeteer)

AI 对话

直接在对话中说,AI 会自动调用分析工具:

「帮我分析一下最近的费用」 「最近 7 天哪个 agent 花钱最多?」 「我的缓存命中率怎么样?」

配置

~/.openclaw/openclaw.json 中配置插件选项:

{
  "plugins": {
    "entries": {
      "claw-bi": {
        "enabled": true,
        "locale": "zh-CN",
        "currency": "CNY",
        "outputDir": "./reports"
      }
    }
  }
}

| 参数 | 默认值 | 说明 | |------|--------|------| | locale | zh-CN | 报告语言,支持 zh-CN / en-US | | currency | CNY | 显示货币,支持 CNY / USD / EUR | | outputDir | ./reports | 报告输出目录 |

报告格式

| 格式 | 命令 | 说明 | |------|------|------| | HTML | /bi 7d | 交互式,含图表、下钻、时间筛选 | | Markdown | /bi 7d markdown | 适合 AI 对话展示或文档嵌入 | | 文本简报 | /bi 7d text | 7 行摘要,适合通知推送 | | PDF | /bi 7d pdf | 需要 npm install puppeteer |

修改代码后更新

claw-bi 加载的是编译后的 dist/,修改源码后需要重新 build:

npm run build
# 重启 OpenClaw

插件扩展

可以通过 PluginRegistry 添加自定义分析 tab,详见 docs/plugin-development.md

文档

License

MIT