# CLI

Search, inspect, install, and update SUI source with shadcn.

Page: https://sui.draco.dev/docs/cli

SUI uses the shadcn CLI's GitHub registry support. Prepare the consuming application using [Installation](/docs/installation#prepare-the-consuming-application), then run commands from that application's directory. No registry namespace configuration is required.

## Search and inspect

```bash
npx shadcn@latest search draco-china/sui -q input
npx shadcn@latest view draco-china/sui/copy-button
```

With pnpm, Yarn or Bun, use `pnpm dlx`, `yarn dlx` or `bunx --bun` in place of `npx`, and `pnpm add`, `yarn add` or `bun add` in place of `npm install`.

Search matches registry names and descriptions. View shows a manifest's files and dependencies before you install it. The [registry guide](/docs/registry) explains the catalog and item formats.

## Install source

```bash
npx shadcn@latest add draco-china/sui/button draco-china/sui/copy-button
npx shadcn@latest add draco-china/sui/data-table
```

With pnpm, Yarn or Bun, use `pnpm dlx`, `yarn dlx` or `bunx --bun` in place of `npx`, and `pnpm add`, `yarn add` or `bun add` in place of `npm install`.

The CLI copies required source files into your configured `ui`, `components` (blocks, layouts, viewers, chat and charts), `lib`, and `hooks` directories, installs package dependencies, and merges SUI styles into the CSS file in `components.json`. Files become part of your application and can be edited locally.

Each item carries its local dependency closure. Installing a component does not require first installing the entire library. Use `draco-china/sui/sui` for the complete collection, `draco-china/sui/sui-style` for shared CSS, or `draco-china/sui/sui-theme` for the theme helpers and styles.

Code Editor and the complete collection require the local Monaco worker setup described in [compatibility](/docs/compatibility#editor-workers).

## Review an update

```bash
npx shadcn@latest add draco-china/sui/button --dry-run
npx shadcn@latest add draco-china/sui/button --diff
```

With pnpm, Yarn or Bun, use `pnpm dlx`, `yarn dlx` or `bunx --bun` in place of `npx`, and `pnpm add`, `yarn add` or `bun add` in place of `npm install`.

An update can affect shared dependencies and CSS as well as the requested component. Compare changes with your local edits before accepting an overwrite. Installation is a source copy; installed files do not automatically follow future changes in the SUI repository.

## Validate and select a version

```bash
npx shadcn@latest registry validate draco-china/sui
npx shadcn@latest add draco-china/sui/button#main
```

With pnpm, Yarn or Bun, use `pnpm dlx`, `yarn dlx` or `bunx --bun` in place of `npx`, and `pnpm add`, `yarn add` or `bun add` in place of `npm install`.

`#ref` selects a branch, tag, or commit SHA; omitted refs use the repository default branch. Existing Raw URLs and `@sui` addresses remain supported; see [optional namespace configuration](/docs/installation#optional-namespace) for short addresses.

## Common issues

| Symptom | Check |
| --- | --- |
| Unknown `@sui` registry | Run from the consuming application and check its `components.json`. |
| GitHub returns `404` | Check the configured URL and whether the requested item is available in the registry. |
| Import path differs from a docs example | Follow configured aliases, rather than workspace paths. See [import mapping](/docs/installation#import-installed-source). |
| Missing animation or theme styles | Confirm the configured CSS file is imported by the application. |
| Monaco worker import fails | Use a compatible `?worker` loader and include the installed declaration file. |

For installation through an assistant, see [MCP](/docs/mcp). For API and example text, see [LLMs](/docs/llms-txt).
