radkradk

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 init

You 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/utils

This creates a components.json file and installs the base dependencies.

Options

OptionDescription
-y, --yesSkip prompts, use defaults
-c, --cwd <dir>Working directory (default: process.cwd())

add

Add a component to your project:

npx radk add button

You can add multiple components at once:

npx radk add button card dialog select

The CLI will:

  1. Fetch the component from the registry
  2. Resolve and fetch dependencies
  3. Install npm packages
  4. Write component files to src/components/ui/

Options

OptionDescription
-y, --yesSkip confirmation
--dry-runPreview 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-run

diff

Check if a locally installed component is up to date with the registry:

npx radk diff button

Output:

  button: up to date
  card: differs from registry
  Run `radk add --yes card` to update