命令行工具
了解 JGuang UI 的项目初始化、组件获取与 Registry 管理方式。
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.
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
Options
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
The create command is an alias for init:
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.
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
Options
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.
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:
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
Supported values for --only are theme and font.
Options
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.
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
preset decode
Use preset decode to decode a preset code.
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
Options
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.
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
The preset info command is an alias for preset resolve:
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
Options
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.
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
Options
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.
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
Options
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.
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
You can view multiple items at once:
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
Or view items from namespaced registries:
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
Options
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
search
Use the search command to search for items from registries.
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
You can search with a query:
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
Or search multiple registries at once:
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
The list command is an alias for search:
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
Options
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
build
Use the build command to generate the registry JSON files.
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
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
To customize the output directory, use the --output option.
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.
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
Options
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
info
Use the info command to get information about your project.
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
Options
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
migrate
Use the migrate command to run migrations on your project.
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
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.
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
This will:
- Update
components.jsonto setrtl: true - Transform physical CSS properties to logical equivalents (e.g.,
ml-4→ms-4,text-left→text-start) - 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:
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.
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
This will:
- Transform imports from
@radix-ui/react-*toradix-ui - Add the
radix-uipackage to yourpackage.json
Before
import * as DialogPrimitive from "@radix-ui/react-dialog"
import * as SelectPrimitive from "@radix-ui/react-select"
After
import { Dialog as DialogPrimitive, Select as SelectPrimitive } from "radix-ui"
Migrate specific files
You can migrate specific files or use glob patterns:
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 initJGuang 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.
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
Before
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
After
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:
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
Options
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
来源: (root)/cli.mdx
JGuang UI 技术文档。
Introduction介绍
JGuang UI is a set of beautifully-designed, accessible components and a code distribution platform. Works with your favorite frameworks and AI models. Open Source. Open Code.了解 JGuang UI 的组件源码、安装方式与设计原则。
components.jsoncomponents.json 配置
Configuration for your project.配置组件样式、路径别名、图标库和 Tailwind CSS。