# JGuang UI · JGuang UI

> Use the JGuang UI CLI to add components to your project.

- Page: https://jiguang132.com/systems/jguang-ui/docs/cli
- Based on: shadcn/ui documentation (MIT) @ bc0705384b51252af26dcc65425b216bf5eb063c

## init

Use the `init` command to initialize configuration and dependencies for an existing project, or create a new project with `--name`.

The `init` command installs dependencies, adds the `cn` util and configures CSS variables for the project.

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

**Options**

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

The `create` command is an alias for `init`:

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

---

## add

Use the `add` command to add components and dependencies to your project.

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

**Options**

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

---

## apply

Use the `apply` command to apply a preset to an existing project.

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

You can apply only the theme or fonts from a preset without reinstalling UI components:

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

Supported values for `--only` are `theme` and `font`.

**Options**

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

---

## preset

Use the `preset` command to inspect preset codes and resolve the preset for an existing project.

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

### preset decode

Use `preset decode` to decode a preset code.

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

**Options**

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

### preset resolve

Use `preset resolve` to resolve the preset from the current project.

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

The `preset info` command is an alias for `preset resolve`:

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

**Options**

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

### preset url

Use `preset url` to print the create URL for a preset code.

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

**Options**

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

### preset open

Use `preset open` to open a preset code in the browser.

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

**Options**

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

---

## view

Use the `view` command to view items from the registry before installing them.

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

You can view multiple items at once:

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

Or view items from namespaced registries:

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

**Options**

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

---

## search

Use the `search` command to search for items from registries.

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

You can search with a query:

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

Or search multiple registries at once:

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

The `list` command is an alias for `search`:

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

**Options**

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

---

## build

Use the `build` command to generate the registry JSON files.

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

This command reads the `registry.json` file and generates the registry JSON files in the `public/r` directory.

**Options**

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

To customize the output directory, use the `--output` option.

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

---

## docs

Use the `docs` command to fetch documentation and API references for components.

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

**Options**

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

---

## info

Use the `info` command to get information about your project.

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

**Options**

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

---

## migrate

Use the `migrate` command to run migrations on your project.

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

**Available Migrations**

| Migration | Description                                             |
| --------- | ------------------------------------------------------- |
| `icons`   | Migrate your UI components to a different icon library. |
| `radix`   | Migrate to radix-ui.                                    |
| `rtl`     | Migrate your components to support RTL (right-to-left). |

**Options**

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

---

### migrate rtl

The `rtl` migration transforms your components to support RTL (right-to-left) languages.

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

This will:

1. Update `components.json` to set `rtl: true`
2. Transform physical CSS properties to logical equivalents (e.g., `ml-4` → `ms-4`, `text-left` → `text-start`)
3. Add `rtl:` variants where needed (e.g., `space-x-4` → `space-x-4 rtl:space-x-reverse`)

**Migrate specific files**

You can migrate specific files or use glob patterns:

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

If no path is provided, the migration will transform all files in your `ui` directory (from `components.json`).

---

### migrate radix

The `radix` migration updates your imports from individual `@radix-ui/react-*` packages to the unified `radix-ui` package.

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

This will:

1. Transform imports from `@radix-ui/react-*` to `radix-ui`
2. Add the `radix-ui` package to your `package.json`

**Before**

```tsx
import * as DialogPrimitive from "@radix-ui/react-dialog"
import * as SelectPrimitive from "@radix-ui/react-select"
```

**After**

```tsx
import { Dialog as DialogPrimitive, Select as SelectPrimitive } from "radix-ui"
```

**Migrate specific files**

You can migrate specific files or use glob patterns:

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

If no path is provided, the migration will transform all files in your `ui` directory (from `components.json`).

Once complete, you can remove any unused `@radix-ui/react-*` packages from your `package.json`.

---

## eject

When you run `init`JGuang UI Registry`@import "JGuang UI/tailwind.css"` to your global CSS file. This import provides shared Tailwind v4 utilities such as custom variants (`data-open:`, `data-closed:`, etc.) and accordion animations.

Use the `eject` command to inline `JGuang UI Registry` into your global CSS file and remove the `JGuang UI Registry` dependency from your project.

}>
  **Note: This action is irreversible.** After ejecting, future JGuang UI CLI
  updates to `JGuang UI Registry` will not apply automatically.


```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

**Before**

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

**After**

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

**Monorepo**

In a monorepo, run the command from the workspace that contains your `components.json` and global CSS file:

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

**Options**

```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```

---

Index of all JGuang resources: https://jiguang132.com/llms.txt
