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

@hi-ui/hiui-cli

v5.0.0

Published

HiUI CLI for AI agents — fetch component docs and props from llms endpoints

Readme

@hi-ui/hiui-cli

面向 AI Agent 的 HiUI 命令行工具,用于查询组件文档与 Props API。设计参考 @ant-design/cli,数据从 HiUI 官方 llms 端点拉取。

安装

npm install -g @hi-ui/hiui-cli
# 或在 monorepo 根目录
yarn --cwd scripts/hiui-cli install

命令

| 命令 | 说明 | | --- | --- | | hiui version | 查询当前 CLI 版本号(亦支持 hiui -V / hiui --version) | | hiui list | 列出所有可用组件(来自 llms.txt) | | hiui doc <component> | 获取组件完整 Markdown 文档 | | hiui info <component> | 获取组件 Props 表格(解析自文档) | | hiui url <component> | 输出组件 llms 文档 URL | | hiui migrate <from> <to> | 跨主版本迁移(如 hiui migrate 4 5) | | hiui patch-for-react | 安装 React 19 兼容包并在入口顶部引入 |

全局选项

| 选项 | 说明 | 默认值 | | --- | --- | --- | | --base-url <url> | 文档站点根地址 | https://xiaomi.github.io/hiui | | --format text\|json | 输出格式(Agent 推荐 json) | text | | --timeout <ms> | HTTP 超时 | 30000 |

也可通过环境变量 HIUI_DOCS_BASE_URL 设置文档根地址。

使用示例

# 查询 CLI 版本
hiui version
hiui version --format json
hiui --version

# 列出组件
hiui list
hiui list --format json

# 获取 Alert 完整文档(对应 https://xiaomi.github.io/hiui/llms/alert.md)
hiui doc alert
hiui doc Alert --format json

# 仅获取 Props
hiui info button --format json

# 获取文档 URL
hiui url cascader

V4 升级到 V5

hiui migrate 4 5 会在指定目录(默认当前目录)内:

  1. 将所有 package.json 中的 @hi-ui/* 依赖版本更新为 ^5.0.0(工具包 @hi-ui/hi-build 等除外)
  2. 将项目文件中的 .hi-v4 替换为 .hi-v5,并将 hi-v4- 类名前缀替换为 hi-v5-(覆盖 [class^='hi-v4-'] 等写法)
# 预览变更(不写入文件)
hiui migrate 4 5 --dry-run

# 升级当前项目
hiui migrate 4 5

# 升级指定目录
hiui migrate 4 5 --path ./apps/web

# 仅升级 package.json
hiui migrate 4 5 --deps-only

# 仅替换样式类名
hiui migrate 4 5 --class-only

升级完成后请执行 npm installyarn 安装依赖,并参考 从 V4 升级至 V5 处理 API 变更。

React 19 兼容包

在 React 19 业务项目中快速接入 @hi-ui/patch-for-react

# 自动修改 package.json、入口文件并执行 npm/yarn/pnpm install
hiui patch-for-react

# 预览
hiui patch-for-react --dry-run

# 指定项目目录与入口
hiui patch-for-react --path ./apps/web --entry src/main.tsx

# 仅改文件,不执行安装
hiui patch-for-react --skip-install

入口文件顶部将添加:

import '@hi-ui/patch-for-react'

若存在 'use client' 等指令,会插入在指令之后、其他 import 之前。

JSON 输出示例

hiui info alert --format json
{
  "component": "alert",
  "url": "https://xiaomi.github.io/hiui/llms/alert.md",
  "description": "作用于页面的内容区域的提示,非触发类信息",
  "props": [
    {
      "name": "Alert",
      "props": [
        {
          "name": "type",
          "description": "警告提示类型",
          "type": "AlertTypeEnum",
          "enum": "\"primary\" | \"warning\"",
          "default": "\"primary\"",
          "required": false
        }
      ]
    }
  ]
}

程序化调用

const { resolveComponentDoc } = require('@hi-ui/hiui-cli/lib/docs')
const { parsePropsFromMarkdown } = require('@hi-ui/hiui-cli/lib/parse')

async function main() {
  const { markdown } = await resolveComponentDoc('alert')
  const props = parsePropsFromMarkdown(markdown)
  console.log(props)
}

开发

cd scripts/hiui-cli
yarn install
node bin/index.js doc alert
node __tests__/parse.test.js
node __tests__/utils.test.js

与 Ant Design CLI 的对比

| 能力 | @ant-design/cli | @hi-ui/hiui-cli | | --- | --- | --- | | 数据来源 | 内置离线数据 | 在线 llms 端点 | | list / doc / info | ✅ | ✅ | | migrate (V4→V5) | — | ✅ | | MCP Server | ✅ (antd mcp) | 规划中 | | --format json | ✅ | ✅ |

相关链接