CLI

的 boardui CLI 将组件源文件直接复制到您的项目中 - 没有运行时包,代码是您的。它可以传递地解析每个组件的内部依赖项(实用程序、图标、其他组件),并使用包管理器安装任何缺少的 npm 包。

npx boardui@latest add button select date-picker

初始化

在现有 Next.js 项目中设置 BoardUI:安装运行时依赖项 (react-aria-components, tailwind-merge, @remixicon/react,Tailwind v4),写道 样式/主题.css, 样式/typography.css, 样式/globals.css, 和 实用程序/cx.ts,然后打印需要添加到根布局中的代码行:样式表导入和 Inter 字体。

如果项目已经在编译 Tailwind v4(例如 create-next-app 16.4 及更高版本通过 @tailwindcss/turbopack 编译),init 不会改动 PostCSS。否则它会安装 @tailwindcss/postcss 并打印 postcss.config.mjs 中需要的那一行。传入 --postcss 可在任何情况下都设置 PostCSS。

npx boardui@latest init
选项描述
-y, --yesSkip confirmation prompts
-o, --overwriteOverwrite existing files
-d, --dir <dir>Target directory (defaults to the project source root)
--proAlso install dependencies used by BoardUI Pro components
--postcssSet up @tailwindcss/postcss even when Tailwind already compiles another way

添加

添加一个或多个组件。默认情况下,文件与此站点保持相同的结构(components/base/…, components/application/…),导入使用 @/ 别名,并且现有文件将被跳过,除非您通过 --overwrite。对于交互式选择器,在不带参数的情况下运行它。

npx boardui@latest add # interactive pickernpx boardui@latest add table paginationnpx boardui@latest add --all
选项描述
-a, --allAdd every component in the registry
-p, --path <path>Custom directory to write files into
-d, --dir <dir>Target directory (defaults to the project source root)
-o, --overwriteOverwrite existing files
-y, --yesSkip prompts — keep existing files, install dependencies

CI、脚本和编码智能体

init 和 add 在安装包或改动已有文件之前会先询问。在没有终端可以回答的环境中(例如 CI、脚本或编码智能体),它们会以退出码 1 停止,而不是自行猜测。传入 --yes 即可接受默认设置:安装依赖并保留已有文件。添加 --overwrite 可替换已有文件;不使用选择器时,请直接写出组件名称或传入 --all。

npx boardui@latest init --yesnpx boardui@latest add button select --yes

自定义路径和单一存储库

添加一个可选的 boardui.json 目的地包裹旁边 package.json 配置文件的去向以及它们使用的导入别名。两者都 初始化 和 添加 阅读它,包括 Pro 组件。没有它,现有的根和 源代码/ 布局的行为与以前一样。

配置配对 paths 和 aliases 组件、实用程序、挂钩、样式或库的条目。在目标包中运行 CLI,以便 npm 依赖项也安装在那里。配置的映射不能与 --path 或 --dir;这些标志仍然可用于未配置的项目。更改配置不会迁移以前安装的文件。

配置共享 UI 包和使用应用程序

清单

打印按类型分组的每个可用组件 - 基本组件、应用程序块和基础。

npx boardui@latest list

技能

安装 BoardUI智能体技巧 (SKILL.md 加上目录、主题和模式参考),因此 Claude Code 和 Codex 等 AI 助手在每次会话时都会加载 BoardUI 知识。默认为项目的 .claude/skills/boardui;重新运行 --force 更新。

npx boardui@latest skill
选项描述
-g, --globalInstall to ~/.claude/skills/boardui instead of the project
-c, --client <client>Install to ~/.agents/skills/boardui (codex, gemini)
-p, --path <dir>Custom directory to install the skill into
-f, --forceOverwrite an existing install (how you update)

更新组件

安装的组件是副本 - 您可以编辑,永远不会默默地触摸。要从注册表中提取组件的最新版本,请重新运行 添加 与 --overwrite.

npx boardui@latest add button --overwrite

匿名遥测

成功后 初始化,CLI 发送一个匿名事件,其中包含其版本、您的包管理器以及是否 --pro 被使用了。成功后 添加,它发送您明确请求的组件名称,但不发送它们自动解析的依赖项。成功后 技能 安装时,它会发送技能的放置位置(项目、全局或智能体目录),而不是路径本身。操作系统的用户配置目录中的随机 ID 可以让我们区分重复运行。 BoardUI 不会发送项目路径、源代码、依赖项名称、电子邮件地址、其他命令参数或遥测数据 清单.

通过设置禁用遥测 BOARDUI_TELEMETRY_DISABLED=1 或 DO_NOT_TRACK=1.

事件保留为生命周期计数器和匿名每日存储桶,用于每日、每周和每月趋势报告。每日存储桶不会自动过期。

shadcn兼容性

注册表使用 shadcn 项架构,因此如果您愿意,每个组件也会使用 shadcn CLI 进行安装:

npx shadcn@latest add https://www.boardui.com/r/button.json