@animate-ui/cli

中文文档
2.4.0发布于 2026/10/27SEE LICENSE IN LICENSE.mdES Module近 30 天下载 2938

Swap your shadcn/ui primitives for Animate UI's animated ones, and migrate from Animate UI v1.

原始使用文档

@animate-ui/cli

# Animate installed shadcn/ui components
pnpm dlx @animate-ui/cli@latest animate accordion
pnpm dlx @animate-ui/cli@latest animate all

# Migrate Animate UI v1 components to v2
pnpm dlx @animate-ui/cli@latest migrate all

# List what moves in a project, and how
pnpm dlx @animate-ui/cli@latest audit

Pass --dry-run to preview the changes.

animate only changes import sources, mirroring each library's style: import { Accordion, Slot } from "radix-ui" becomes import { Accordion, Slot } from "@animate-ui/react/primitives/radix-ui" (the barrel re-exports everything else from radix-ui), @base-ui/react moves to @animate-ui/react/primitives/base-ui, react-aria-components to @animate-ui/react/primitives/react-aria, and per-package imports (@radix-ui/react-accordion, @base-ui/react/accordion, vaul, input-otp, embla-carousel-react, @shadcn/react/questionnaire) to the matching per-primitive path (@animate-ui/react/primitives/radix-ui/accordion, @animate-ui/react/primitives/carousel, @animate-ui/react/primitives/questionnaire…). An import with nothing Animate UI animates is left alone. shadcn/ui's code block has no primitive import to swap: animate code-block rewrites it in place (its pre becomes @animate-ui/react/primitives/code-block's Content, its copy button is built on the Copy Button), and leaves a part changed by hand as it is.

migrate moves every import it can to @animate-ui/react. In an import mixing mappable parts with v1-only ones (a highlight part, a context hook), the mappable parts move and the v1-only names stay on the v1 file, each reported as a manual step: once their parent is v2 they throw at runtime, so remove them or replace the component with shadcn/ui's + animate-ui animate. The v1 files v2 has no equivalent for (Files, Preview Link Card, the Headless UI primitives, a few hooks) stay yours and keep working: they stay on the v1 Radix UI and Base UI primitives they're built on. The Flip and Liquid buttons are registry files in v2: their imports stay on the v1 file too, and a manual step gives the shadcn add command for each.

At the end, migrate lists the v1 files @animate-ui/react replaces that nothing imports anymore. In a terminal it asks before deleting them (one by one, or all at once); --delete deletes them and --keep keeps them without asking. Outside a terminal (CI, piped) they're kept unless you pass --delete.

audit lists the animations of a project (or of the folders and files you pass): the properties each one changes and what they cost the browser, and the patterns worth a look (transition: all, ease-in entrances, long durations, hover scales, missing reduced-motion paths…). The Animate UI skill weighs these facts for you.

Documentation: https://animate-ui.com

版本与发布记录

@animate-ui/cli 共发布 4 个版本,首次发布于 2026/10/18;过去 12 个月发布了 4 个版本。

版本发布日期距今
2.4.0latest2026/10/2711 天前
2.2.02026/10/2415 天前
2.0.02026/10/1820 天前
0.0.0-stage2026/10/1820 天前

关于 @animate-ui/cli 的常见问题

@animate-ui/cli 是什么?

Swap your shadcn/ui primitives for Animate UI's animated ones, and migrate from Animate UI v1.

如何安装 @animate-ui/cli?

在项目目录运行 npm install @animate-ui/cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 animate-ui,可以用 npx animate-ui 直接运行。

@animate-ui/cli 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/animate-ui__cli 是否存在。

@animate-ui/cli 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@animate-ui/cli 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.12。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@animate-ui/cli 可以商用吗?

@animate-ui/cli 使用 SEE LICENSE IN LICENSE.md 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@animate-ui/cli 的下载量有多少?

根据 npm 官方下载统计,@animate-ui/cli 在 2026/10/06 – 2026/11/04 这 30 天内被下载 2,938 次,日均约 98 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@animate-ui/cli 还在维护吗?

最新版本 2.4.0 发布于 2026/10/27(11 天前);至今共发布 4 个版本,其中过去 12 个月发布了 4 个;首次发布于 2026/10/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。