@aliveui/ui-cli
CLI tool for adding Alive UI components to your project.
Requirements
- Node.js 18.0.0 or higher (Node.js 20+ recommended)
- React 18.0.0 or higher (including React 19)
- A project with Next.js, Vite, or another React framework
Prerequisites
Before using the CLI, make sure you have:
- An existing React project
- Basic understanding of React and Tailwind CSS
- Package manager: npm, yarn, or pnpm
Usage
Initialize Your Project
# npm
npx @aliveui/ui-cli@latest init
# pnpm
pnpm dlx @aliveui/ui-cli@latest init
# yarn
yarn dlx @aliveui/ui-cli@latest init
This will:
- Create a
components.json
file in your project
- Configure your project for using Alive UI
- Set up Tailwind CSS v4 with the correct configuration (or upgrade existing Tailwind if needed)
- Create necessary utility files
Add Components
# npm
npx @aliveui/ui-cli@latest add button
# pnpm
pnpm dlx @aliveui/ui-cli@latest add button
# yarn
yarn dlx @aliveui/ui-cli@latest add button
This will copy the component files to your project.
Installation Modes
The CLI supports two installation modes:
1. File Mode (Default)
In this mode, the CLI will copy the component files into your project directory. This is the default behavior and gives you full control over the component source code.
# Initialize in file mode (default) - npm
npx @aliveui/ui-cli@latest init
# Initialize in file mode (default) - pnpm
pnpm dlx @aliveui/ui-cli@latest init
# Add components by copying files - npm
npx @aliveui/ui-cli@latest add button
# Add components by copying files - pnpm
pnpm dlx @aliveui/ui-cli@latest add button
2. NPM Mode
In this mode, the CLI will install the components from npm instead of copying files into your project. This is useful for projects where you want to keep your codebase clean and leverage the package system.
# Initialize in npm mode - npm
npx @aliveui/ui-cli@latest init --npm
# Initialize in npm mode - pnpm
pnpm dlx @aliveui/ui-cli@latest init --npm
# Initialize in npm mode - yarn
yarn dlx @aliveui/ui-cli@latest init --npm
# Add components by installing from npm - npm
npx @aliveui/ui-cli@latest add button --npm
# Add components by installing from npm - pnpm
pnpm dlx @aliveui/ui-cli@latest add button --npm
# Add components by installing from npm - yarn
yarn dlx @aliveui/ui-cli@latest add button --npm
Troubleshooting
Dependencies Issues
If you encounter dependency conflicts, try:
# npm
npm install @aliveui/ui --legacy-peer-deps
# pnpm
pnpm add @aliveui/ui --ignore-peer-deps
# yarn
yarn add @aliveui/ui --ignore-engines
TypeScript Configuration
For TypeScript projects, make sure your tsconfig.json
includes the proper paths configuration. The CLI should handle this automatically, but you can verify with:
{
"compilerOptions": {
"paths": {
"@/*": ["./*"]
}
}
}
License
Licensed under the MIT license.
Documentation
Visit https://aliveui.com/docs/installation to view the documentation.