组件
2025年7月 - 本地文件支持
初始化项目并从本地 JSON 文件添加组件。
shadcn CLI 现在支持本地文件。可以从本地 JSON 文件初始化项目并添加组件、主题、钩子、工具等。
🌐 The shadcn CLI now supports local files. Initialize projects and add components, themes, hooks, utils and more from local JSON files.
# Initialize a project from a local file
npx shadcn init ./template.json
# Add a component from a local file
npx shadcn add ./block.json此功能启用强大的新工作流程:
🌐 This feature enables powerful new workflows:
- 零设置 - 无需远程注册表
- 更快的开发 - 在发布前先本地测试注册表项
- 为代理和 MCP 提升的工作流程 - 本地生成和运行注册表项
- 私有组件 - 保持专有组件本地化和私有化。