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

heren-design-cli

v1.1.0

Published

CLI tool for querying heren-design-web-vue knowledge and analyzing usage in projects

Readme

heren-design-cli

heren-design-web-vue 知识查询和项目分析 CLI 工具,专为 AI 代码助手优化。

功能

  • 组件知识查询:查询 hr-*hrd-* 组件的 Props、Events、Slots、方法和示例代码
  • 项目分析:扫描项目中 heren-design-web-vue 的使用情况,检查规范问题
  • 项目诊断:检查 heren-design 的安装和配置
  • MCP 集成:作为 MCP 服务器与 AI 助手集成

安装

npm install -g heren-design-cli

命令

组件知识查询

hrdc list                         # 列出所有组件
hrdc list --category business     # 按分类过滤

hrdc info hr-button               # 查询组件 API
hrdc info hrd-page-layout --detail # 查看完整 API

hrdc doc hr-form                  # 获取完整文档
hrdc demo hr-dialog               # 列出所有示例
hrdc demo hr-dialog basic         # 获取指定示例代码
hrdc info Button                  # 也支持 PascalCase 组件名

项目分析

hrdc usage [dir]                  # 扫描组件使用统计
hrdc lint [target]                # 检查规范问题
hrdc doctor                       # 诊断项目配置
hrdc env                          # 收集环境信息

接口相关

hrdc api-resolve <url> --project-path <path> --format json
hrdc api-probe <url> --project-path <path> --format json

说明:

  • 研发场景下可直接通过 CLI 使用接口解析与探测能力,无需先配置 MCP
  • api-resolve / api-probe 是普通 CLI 入口,复用现有 heren_api_resolve / heren_api_probe 主逻辑
  • 相对路径场景优先结合项目代理配置与环境解析

MCP 服务器

hrdc mcp                          # 启动 MCP 服务器

Claude Desktop 配置~/.claude/claude_desktop_config.json):

{
  "mcpServers": {
    "heren-design": {
      "command": "hrdc",
      "args": ["mcp"]
    }
  }
}

全局选项

--format <format>   # 输出格式:json、text、markdown(默认:text)
--lang <lang>       # 输出语言:en、zh(默认:zh)
--data-version <v>  # 指定内置元数据版本,如 1.8.0
--detail            # 显示详细信息
-V, --cli-version   # 显示 CLI 版本

组件命名

  • 基础组件hr- 前缀):hr-buttonhr-inputhr-selecthr-formhr-tablehr-dialoghr-paginationhr-tabshr-tree
  • 业务组合组件hrd- 前缀):hrd-page-layouthrd-search-bar

更新组件数据

组件元数据存储在版本化文件中,例如 data/1.8.0.json。CLI 只读取合法 semver 文件名的元数据,不再读取 data/components.json 或项目本地 web-types.json

# 从源码提取
npm run extract -- --source <heren-design-web-vue 源码路径>

# 精简提取,不生成 doc、demos、changelog、faq
npm run extract:lite -- --source <heren-design-web-vue 源码路径>

版本选择优先级:

  1. --data-version <version>HEREN_DESIGN_VERSION
  2. 当前项目安装的 heren-design-web-vue 版本
  3. 当前项目 package.json 中声明的 heren-design-web-vue 版本
  4. data/ 目录中的最高内置版本

如果没有精确版本文件,CLI 会选择不高于目标版本的最接近元数据;只有没有任何低版本可选时才回退到最高内置版本。

开发

npm run build        # 构建
npm run dev          # 监视模式
npm run test         # 运行测试
npm run typecheck    # 类型检查

License

MIT