@modus-ui/cli
v0.1.1
Published
Add Modus UI animated React components to your project.
Maintainers
Readme
@modus-ui/cli
Add Modus UI animated React components to your project. The CLI copies each component's source into your codebase, so you own and can edit it.
Usage
npx @modus-ui/cli add blur-text magnet
npx @modus-ui/cli listCommands
add <name...>
Copies one or more components into your project and installs their npm dependencies.
- Writes
<componentsDir>/<name>.tsx. The default directory issrc/components/uiwhen the project has asrc/folder, otherwisecomponents/ui. - Creates the
cn()helper (src/lib/utils.tsorlib/utils.ts) if neitherlib/utils.tsnorsrc/lib/utils.tsexists. - Installs the dependencies your
package.jsondoesn't already list (for exampleframer-motion,clsx,tailwind-merge), using pnpm, yarn, bun or npm depending on the lockfile it finds. - Leaves existing files alone unless you pass
--overwrite.
| Flag | Description |
| -------------- | ----------------------------------------------- |
| --path <dir> | Directory to write components to |
| --cwd <dir> | Project root (default: current directory) |
| --overwrite | Replace component files that already exist |
| --no-install | Print the install command instead of running it |
list
Lists every component, grouped by category, with a short description.
Global flags
-h, --help shows help. -v, --version shows the version.
Environment
| Variable | Description |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| MODUS_UI_URL | Registry origin. Defaults to https://modusui.kasimkazmi.com. Handy for testing against a local dev server, for example MODUS_UI_URL=http://localhost:3000. |
Requirements
- Node.js 20 or newer.
- A React project set up with Tailwind CSS and shadcn-style CSS variables (
--background,--foreground,--primaryand so on). Components are client components. - The
@/import alias must resolve to your source root, because components importcnfrom@/lib/utils. framer-motion,clsxandtailwind-mergeare installed for you.
License
MIT
