SuperAPI AI 工具集

shadcn-registries

通用与其它

查看项目

更新于 10-15 21:49

技能介绍

用途:配置 shadcn/ui 的注册表(registry)、components.json 与 CLI 命令,覆盖默认 Radix 注册表、Base UI 注册表(@basecn)和自定义注册表。

主要能力:区分 @shadcn(Radix UI,样式 new-york、default)与 @basecn(Base UI,样式 base-vega)及自定义注册表;维护 components.json 与实际 primitive 同步;通过 MCP 查询注册表组件并获取精确 CLI 命令。

使用方式:先检测包管理器,{runner} 为 bunx | npx | pnpm dlx | yarn dlx。初始化:{runner} shadcn@latest init,或 {runner} shadcn@latest init --style new-york。添加组件(默认 Radix):{runner} shadcn@latest add button dialog select。从 Base UI 注册表添加:{runner} shadcn@latest add --registry=basecn button dialog。MCP 命令:mcp__shadcn__search_items_in_registries 查找组件,mcp__shadcn__get_add_command_for_items 获取精确 CLI 命令。

components.json 结构示例:{"$schema":"https://ui.shadcn.com/schema.json","style":"new-york","tailwind":{"config":"tailwind.config.ts","css":"app/globals.css"},"aliases":{"components":"@/components","utils":"@/lib/utils"}}。

限制与规则:始终先检测包管理器;添加组件前先查 MCP;同一项目不得混用注册表;保持 components.json 与实际 primitive 同步;只用 CLI 添加组件,不手动复制;不检查注册表来源就编辑组件内部。资料未提供具体版本、收费或平台信息。