# Commands
URL: /react/getting-started/cli/commands
Source: https://github.com/daangn/seed-design/blob/dev/docs/content/react/getting-started/cli/commands.mdx
Guide to @seed-design/cli commands.
## Common Behavior
- Node.js 20.19.0 or higher is required to run the CLI.
- `add` and `add-all` use the `seed-design.json` configuration file.
- If the configuration file is missing or unreadable, it first asks whether to create one.
- Required npm package dependencies are automatically installed when adding items.
- When running `add` or `add-all`, if the snippet's required seed-design package version differs from the current project version, a warning is shown. (React: `@seed-design/react`, `@seed-design/css` / Lynx: `@seed-design/lynx-react`, `@seed-design/lynx-css`)
- If an existing file has different content, by default you can choose `Overwrite / Backup and Replace / Skip`.
- You can fix the conflict handling method in advance by providing the `--on-diff` option.
- Use the `--verbose` option to see detailed information about the cause of failure.
## init
A command to create the `seed-design.json` file.
Learn about the `seed-design.json` file.
### Running the init command
- npm: npx @seed-design/cli@latest init
- pnpm: pnpm dlx @seed-design/cli@latest init
- yarn: yarn dlx @seed-design/cli@latest init
- bun: bun x @seed-design/cli@latest init
### Configure seed-design
```sh
◇ Do you use TypeScript?
│ Yes
│
◇ Do you use React Server Components?
│ No
│
◇ Which framework do you use?
│ React
│
◇ Enter the seed-design folder path. (The default is the project root.)
│ ./seed-design
│
◇ Collect anonymous usage data for improvements?
│ Yes
```
### Options
| Option | Description |
| ----------------- | ----------------------------------------------------------------- |
| `-c, --cwd ` | Working directory. Default is current directory |
| `-y, --yes` | Create `seed-design.json` with defaults without questions |
| `--default` | Deprecated. Same as `--yes`, creates with defaults |
| `--verbose` | Print detailed error information including stack trace on failure |
| `-h, --help` | Print help |
- npm: npx @seed-design/cli@latest init --yes
- pnpm: pnpm dlx @seed-design/cli@latest init --yes
- yarn: yarn dlx @seed-design/cli@latest init --yes
- bun: bun x @seed-design/cli@latest init --yes
## add
A command to download and add snippets to your project.
Learn about snippets that help with reusing commonly used UI patterns.
- npm: npx @seed-design/cli@latest add \[...item-ids]
- pnpm: pnpm dlx @seed-design/cli@latest add \[...item-ids]
- yarn: yarn dlx @seed-design/cli@latest add \[...item-ids]
- bun: bun x @seed-design/cli@latest add \[...item-ids]
If you omit `item-ids`, you can interactively select items to download.
- npm: npx @seed-design/cli@latest add
- pnpm: pnpm dlx @seed-design/cli@latest add
- yarn: yarn dlx @seed-design/cli@latest add
- bun: bun x @seed-design/cli@latest add
```sh copy
◆ Select items to add (multiple selection available with space)
│ ◻ ui:action-button
│ ◻ ui:alert-dialog
│ ◻ ui:callout
│ ◻ ui:checkbox
│ ◻ ui:switch
│ ◻ ui:text-field
│ ◻ ui:tabs
│ ◻ (deprecated) ui:old-component
│ ◻ ...
└
```
You can also specify multiple items directly.
- npm: npx @seed-design/cli@latest add ui:action-button ui:alert-dialog
- pnpm: pnpm dlx @seed-design/cli@latest add ui:action-button ui:alert-dialog
- yarn: yarn dlx @seed-design/cli@latest add ui:action-button ui:alert-dialog
- bun: bun x @seed-design/cli@latest add ui:action-button ui:alert-dialog
### Options
| Option | Description |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `-c, --cwd ` | Working directory. Default is current directory |
| `-u, --baseUrl ` | Registry base URL |
| `--seed-react-version ` | Use registry for specified Crispy React version (e.g., `1.2`). Takes precedence over `--baseUrl`/`--framework` |
| `-f, --framework ` | Target framework (`react` or `lynx`). Overrides `framework` value in config |
| `--on-diff ` | Specify file conflict handling mode (`overwrite` or `backup`) |
| `-a, --all` | **Deprecated**. Currently outputs an error and recommends using `add-all` |
| `--verbose` | Print detailed error information including stack trace on failure |
| `-h, --help` | Print help |
### Getting snippets for your version
If you need snippets compatible with the Crispy package version installed in your project, use the version option. The CLI automatically finds the registry address where that version is deployed.
- npm: npx @seed-design/cli@latest add --seed-react-version 1.2 ui:action-button
- pnpm: pnpm dlx @seed-design/cli@latest add --seed-react-version 1.2 ui:action-button
- yarn: yarn dlx @seed-design/cli@latest add --seed-react-version 1.2 ui:action-button
- bun: bun x @seed-design/cli@latest add --seed-react-version 1.2 ui:action-button
The version option determines base URL and framework (react) together, so it takes precedence over `--baseUrl` / `--framework`.
#### Specifying baseUrl directly
To specify the registry address directly, use `--baseUrl`. The default is [`https://crispy.carrot-soft.tech`](https://crispy.carrot-soft.tech) for the production environment.
- npm: npx @seed-design/cli@latest add --baseUrl https://v1-2.crispy.carrot-soft.tech
- pnpm: pnpm dlx @seed-design/cli@latest add --baseUrl https://v1-2.crispy.carrot-soft.tech
- yarn: yarn dlx @seed-design/cli@latest add --baseUrl https://v1-2.crispy.carrot-soft.tech
- bun: bun x @seed-design/cli@latest add --baseUrl https://v1-2.crispy.carrot-soft.tech
### File conflict handling
If you don't specify `--on-diff`, when an existing file differs from a new snippet, you can choose one of the following:
- Overwrite
- Backup existing file as `legacy--` and replace
- Skip
## add-all
A command to add items from a registry at once.
- npm: npx @seed-design/cli@latest add-all \[...registry-ids]
- pnpm: pnpm dlx @seed-design/cli@latest add-all \[...registry-ids]
- yarn: yarn dlx @seed-design/cli@latest add-all \[...registry-ids]
- bun: bun x @seed-design/cli@latest add-all \[...registry-ids]
To add all items from all registries, use the `--all` option.
- npm: npx @seed-design/cli@latest add-all --all # Add all items from all registries
- pnpm: pnpm dlx @seed-design/cli@latest add-all --all # Add all items from all registries
- yarn: yarn dlx @seed-design/cli@latest add-all --all # Add all items from all registries
- bun: bun x @seed-design/cli@latest add-all --all # Add all items from all registries
You can also add all items from a specific registry.
- npm: npx @seed-design/cli@latest add-all breeze # Add all items from breeze registry
- pnpm: pnpm dlx @seed-design/cli@latest add-all breeze # Add all items from breeze registry
- yarn: yarn dlx @seed-design/cli@latest add-all breeze # Add all items from breeze registry
- bun: bun x @seed-design/cli@latest add-all breeze # Add all items from breeze registry
To include deprecated items, use the `--include-deprecated` option.
- npm: npx @seed-design/cli@latest add-all ui --include-deprecated # Add all items from ui registry (including deprecated)
- pnpm: pnpm dlx @seed-design/cli@latest add-all ui --include-deprecated # Add all items from ui registry (including deprecated)
- yarn: yarn dlx @seed-design/cli@latest add-all ui --include-deprecated # Add all items from ui registry (including deprecated)
- bun: bun x @seed-design/cli@latest add-all ui --include-deprecated # Add all items from ui registry (including deprecated)
If you omit both registry IDs and `--all`, you can interactively select registries to add.
### Options
| Option | Description |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `-a, --all` | Add all items from all registries |
| `--include-deprecated` | Include deprecated items |
| `-c, --cwd ` | Working directory. Default is current directory |
| `-u, --baseUrl ` | Registry base URL |
| `--seed-react-version ` | Use registry for specified Crispy React version (e.g., `1.2`). Takes precedence over `--baseUrl`/`--framework` |
| `-f, --framework ` | Target framework (`react` or `lynx`). Overrides `framework` value in config |
| `--on-diff ` | Specify file conflict handling mode (`overwrite` or `backup`) |
| `--verbose` | Print detailed error information including stack trace on failure |
| `-h, --help` | Print help |
## compat
Checks if the seed-design package version in your current project is compatible with the version required by snippets. The target package varies depending on the platform. (React: `@seed-design/react`, `@seed-design/css` / Lynx: `@seed-design/lynx-react`, `@seed-design/lynx-css`)
- npm: npx @seed-design/cli@latest compat
- pnpm: pnpm dlx @seed-design/cli@latest compat
- yarn: yarn dlx @seed-design/cli@latest compat
- bun: bun x @seed-design/cli@latest compat
By default, it only checks snippets already added under the `path` in `seed-design.json`.
If there's a compatibility issue, it exits with code `1`; if there's no problem, it exits with `0`, so it can be used directly in CI/agent environments.
You can also check specific items only.
- npm: npx @seed-design/cli@latest compat ui:action-button ui:alert-dialog
- pnpm: pnpm dlx @seed-design/cli@latest compat ui:action-button ui:alert-dialog
- yarn: yarn dlx @seed-design/cli@latest compat ui:action-button ui:alert-dialog
- bun: bun x @seed-design/cli@latest compat ui:action-button ui:alert-dialog
When using component shorthand, use the `-c` option.
- npm: npx @seed-design/cli@latest compat -c action-button -c alert-dialog
- pnpm: pnpm dlx @seed-design/cli@latest compat -c action-button -c alert-dialog
- yarn: yarn dlx @seed-design/cli@latest compat -c action-button -c alert-dialog
- bun: bun x @seed-design/cli@latest compat -c action-button -c alert-dialog
To check all registry items, use `--all`.
- npm: npx @seed-design/cli@latest compat --all
- pnpm: pnpm dlx @seed-design/cli@latest compat --all
- yarn: yarn dlx @seed-design/cli@latest compat --all
- bun: bun x @seed-design/cli@latest compat --all
### Options
| Option | Description |
| ----------------------------- | --------------------------------------------------------------------------- |
| `-c, --component ` | Component ID to check. Can be specified multiple times or comma-separated |
| `-r, --registry ` | Specify default registry when using shorthand in `--component` |
| `-a, --all` | Check all registry items |
| `--cwd ` | Working directory. Default is current directory |
| `-u, --baseUrl ` | Registry base URL |
| `-f, --framework ` | Target framework (`react` or `lynx`). Overrides `framework` value in config |
| `--verbose` | Print detailed error information including stack trace on failure |
| `-h, --help` | Print help |
## docs
A command to retrieve documentation links, llms.txt links, and snippet links.
- npm: npx @seed-design/cli@latest docs \[query]
- pnpm: pnpm dlx @seed-design/cli@latest docs \[query]
- yarn: yarn dlx @seed-design/cli@latest docs \[query]
- bun: bun x @seed-design/cli@latest docs \[query]
If you omit `query`, you can interactively select category → section → item.
- npm: npx @seed-design/cli@latest docs
- pnpm: pnpm dlx @seed-design/cli@latest docs
- yarn: yarn dlx @seed-design/cli@latest docs
- bun: bun x @seed-design/cli@latest docs
```sh copy
◆ Select category
│ React
│
◆ Select section
│ Components
│
◆ Select item
│ Action Button
│
│ action-button
│ - docs: https://crispy.carrot-soft.tech/react/components/action-button
│ - llms.txt: https://crispy.carrot-soft.tech/llms/react/components/action-button.txt
│ - snippet: https://raw.githubusercontent.com/daangn/seed-design/refs/heads/dev/docs/registry/react/ui/action-button.tsx
│
```
### Direct search
You can search directly by item name.
- npm: npx @seed-design/cli@latest docs action-button
- pnpm: pnpm dlx @seed-design/cli@latest docs action-button
- yarn: yarn dlx @seed-design/cli@latest docs action-button
- bun: bun x @seed-design/cli@latest docs action-button
### Path-based search
You can specify the path directly in the form `category/section/item`.
- npm: npx @seed-design/cli@latest docs react/components/action-button
- pnpm: pnpm dlx @seed-design/cli@latest docs react/components/action-button
- yarn: yarn dlx @seed-design/cli@latest docs react/components/action-button
- bun: bun x @seed-design/cli@latest docs react/components/action-button
If you specify only the category, you can select sections/items in that category.
- npm: npx @seed-design/cli@latest docs react
- pnpm: pnpm dlx @seed-design/cli@latest docs react
- yarn: yarn dlx @seed-design/cli@latest docs react
- bun: bun x @seed-design/cli@latest docs react
If you specify up to category/section, you can select items in that section.
- npm: npx @seed-design/cli@latest docs react/components
- pnpm: pnpm dlx @seed-design/cli@latest docs react/components
- yarn: yarn dlx @seed-design/cli@latest docs react/components
- bun: bun x @seed-design/cli@latest docs react/components
### Typo suggestions
If there's a typo in the path, it suggests similar valid paths.
```sh copy
react/component/action-buton: Documentation not found.
💡 Did you mean?
- react/components/action-button
```
### Raw mode
Using the `--raw` option outputs llms.txt content as pure markdown without UI. It can be used in LLM pipes or scripts.
- npm: npx @seed-design/cli@latest docs react/components/action-button --raw
- pnpm: pnpm dlx @seed-design/cli@latest docs react/components/action-button --raw
- yarn: yarn dlx @seed-design/cli@latest docs react/components/action-button --raw
- bun: bun x @seed-design/cli@latest docs react/components/action-button --raw
You can also get package changelogs.
- npm: npx @seed-design/cli@latest docs react/updates/changelog/react/1.2.5 --raw
- pnpm: pnpm dlx @seed-design/cli@latest docs react/updates/changelog/react/1.2.5 --raw
- yarn: yarn dlx @seed-design/cli@latest docs react/updates/changelog/react/1.2.5 --raw
- bun: bun x @seed-design/cli@latest docs react/updates/changelog/react/1.2.5 --raw
### Options
| Option | Description |
| ------------------------- | ----------------------------------------------------------------- |
| `--raw` | Output llms.txt content as pure markdown without UI |
| `-u, --baseUrl ` | Registry base URL |
| `--verbose` | Print detailed error information including stack trace on failure |
| `-h, --help` | Print help |