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.0.1

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 前端工程规范(目录结构、命名、模板等)
  • 项目分析:扫描项目中 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 standards                    # 列出所有规范主题
hrdc standards overview           # 工程规范总览
hrdc standards structure          # 目录结构规范
hrdc standards naming             # 命名规范
hrdc standards components         # 组件开发规范
hrdc standards api                # API 接口规范

业务代码模板

查询业务代码模板。不指定 name 时列出所有可用模板,指定 name 时输出完整模板内容。

hrdc templates                         # 列出所有可用模板
hrdc templates list-page               # 列表页模板
hrdc templates form-page               # 表单页模板
hrdc templates detail-page             # 详情页模板
hrdc templates dialog-form             # 抽屉表单模式
hrdc templates --format json

项目分析

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)
--detail            # 显示详细信息
-V, --cli-version   # 显示 CLI 版本

组件命名

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

更新组件数据

组件元数据存储在 data/components.json。更新方法:

# 从内部 GitLab 拉取(需要内网环境)
npm run extract -- --from-gitlab

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

开发

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

License

MIT