CLI
Use the radk CLI to add components to your project.
The radk CLI lets you initialize your project and add components from the registry.
init
Initialize radk in a new project:
npx radk initYou will be asked a few questions:
Where is your global CSS file? › app/globals.css
Configure the components alias: › @/components
Configure the utils alias: › @/lib/utilsThis creates a components.json file and installs the base dependencies.
Options
| Option | Description |
|---|---|
-y, --yes | Skip prompts, use defaults |
-c, --cwd <dir> | Working directory (default: process.cwd()) |
add
Add a component to your project:
npx radk add buttonYou can add multiple components at once:
npx radk add button card dialog selectThe CLI will:
- Fetch the component from the registry
- Resolve and fetch dependencies
- Install npm packages
- Write component files to
src/components/ui/
Options
| Option | Description |
|---|---|
-y, --yes | Skip confirmation |
--dry-run | Preview what would be installed without writing files |
-c, --cwd <dir> | Working directory |
Dry run
Preview what a component add would do:
npx radk add button --dry-rundiff
Check if a locally installed component is up to date with the registry:
npx radk diff buttonOutput:
button: up to date
card: differs from registry
Run `radk add --yes card` to update