@radish-ui/cli
v0.2.0
Published
CLI for copying radish-ui registry components into your project
Maintainers
Readme
@radish-ui/cli
CLI for managing radish-ui registry components.
Installation
npm install -g @radish-ui/cli
# or use directly with npx
npx @radish-ui/cli <command>Commands
radish init
Initialize radish-ui in an existing project. Creates a radish.json configuration file and optionally sets up the components directory and a sample component.
npx @radish-ui/cli init [options]Options:
| Option | Description |
| ------------------ | ------------------------------------------------ |
| --registry <url> | Registry URL or path to use in radish.json |
| -y, --yes | Accept all defaults and skip interactive prompts |
What it does:
- Creates a
radish.jsonin the project root with recommended defaults - Creates the default components directory (
src/components/radish/) - Optionally creates a sample placeholder component
- Prints instructions for installing recommended peer dependencies
Example – interactive:
npx @radish-ui/cli initExample – non-interactive (CI / scripts):
npx @radish-ui/cli init --yesradish new [directory]
Scaffold a brand-new radish-ui powered react-admin project in a new directory.
npx @radish-ui/cli new [directory] [options]Options:
| Option | Description |
| ------------------- | ---------------------------------------------------------- |
| --registry <path> | Path to a local registry directory to copy components from |
| -y, --yes | Accept all defaults and skip interactive prompts |
radish add <components...>
Copy one or more components from the registry into your project.
npx @radish-ui/cli add <component> [component...] [options]Options:
| Option | Description |
| ------------------- | --------------------------------------------------- |
| --registry <path> | Path or URL to the registry |
| --target <path> | Output directory (default: src/components/radish) |
| --force | Overwrite existing files |
radish remove <components...>
Remove one or more installed components from your project. Files are deleted from disk and the component entries are removed from radish.lock.json.
npx @radish-ui/cli remove <component> [component...] [options]Options:
| Option | Description |
| ----------------- | --------------------------------------------------- |
| --target <path> | Output directory (default: src/components/radish) |
| --force | Remove files even if they have local modifications |
Behaviour:
- Files that are shared with another installed component are skipped and not deleted (the other component still depends on them).
- Files that have local modifications are skipped unless
--forceis passed — you will see a warning for each skipped file. - The component entry is always removed from
radish.lock.jsonregardless of whether individual files were skipped because they were shared or locally modified. - If a file cannot be deleted or read due to an unexpected error (for example, a permission error), the component entry is kept in
radish.lock.jsonso it remains tracked. Resolve the issue and runradish remove <component>again.
Example:
# Remove a single component
npx @radish-ui/cli remove skeleton
# Remove multiple components at once
npx @radish-ui/cli remove skeleton datagrid
# Remove even if files have been locally modified
npx @radish-ui/cli remove skeleton --forceradish sync
Update previously-added components to the latest registry versions.
npx @radish-ui/cli sync [options]Options:
| Option | Description |
| ------------------- | --------------------------------------------------- |
| --registry <path> | Path or URL to the registry |
| --target <path> | Output directory (default: src/components/radish) |
| --force | Overwrite all files, ignoring local modifications |
radish diff <component>
Show what changed upstream since you last synced a component.
npx @radish-ui/cli diff <component> [options]Options:
| Option | Description |
| ------------------- | --------------------------------------------------- |
| --registry <path> | Path or URL to the registry |
| --target <path> | Output directory (default: src/components/radish) |
radish list
Show all components available in the registry and which ones are currently installed in your project.
npx @radish-ui/cli list [options]Options:
| Option | Description |
| ------------------- | --------------------------- |
| --registry <path> | Path or URL to the registry |
Example output:
Available components (5 available, 2 installed):
Component Status
─────────── ─────────
✓ skeleton installed
- datagrid available
✓ form/input installed
- dialog available
- reference availableExample:
# List all components (uses registry from radish.json if present)
npx @radish-ui/cli list
# List using a specific registry
npx @radish-ui/cli list --registry ./my-local-registryConfiguration (radish.json)
The radish.json file at the project root configures the CLI. It is created by radish init or radish new.
{
"registry": "https://saebyn.github.io/radish-ui/registry",
"outputDir": "src/components/radish"
}| Field | Description | Default |
| ----------- | -------------------------------------- | --------------------------------------------- |
| registry | Registry URL or local path | https://saebyn.github.io/radish-ui/registry |
| outputDir | Directory where components are written | src/components/radish |
