# Command Line Interface

Starwind CLI manages the Runtime-backed V3 components that Pro blocks depend on. Run commands from
the project root.

## Initialize Pro

Use `--pro` to configure the Pro registry. The CLI also initializes Starwind UI when required.

```bash
pnpm dlx starwind@latest init --pro
```

For an existing V3 project, use `setup`:

```bash
pnpm dlx starwind@latest setup --pro
```

## Migrate from V2

```bash
pnpm dlx starwind@latest migrate
```

Migration is guided by default. It can create a component backup, replace registered conflicts,
apply public rename codemods, and report any unresolved `source: "legacy"` entries. Read the
[V3 migration guide](/docs/getting-started/migration/) before you update Pro blocks.

## Search

Search styled components, Primitives, and Pro blocks before installation.

```bash
pnpm dlx starwind@latest search hero --plan free --limit 5
pnpm dlx starwind@latest search combobox
```

## Add

Install a Pro block with the exact command shown on its preview page. Starwind resolves its V3
component and package dependencies.

```bash
pnpm dlx starwind@latest add @starwind-pro/hero-01
```

Free blocks install without a license. Premium blocks require Pro setup and a valid license key.

Useful options include `--all`, `--yes`, `--overwrite`, `--framework astro`, and
`--package-manager pnpm`.

## Update

Preview changes before you replace customized component source.

```bash
pnpm dlx starwind@latest update button --dry-run
pnpm dlx starwind@latest update button --diff
pnpm dlx starwind@latest update button
```

## Docs and Primitives

```bash
pnpm dlx starwind@latest docs dialog combobox
pnpm dlx starwind@latest primitives add dialog
```

Use styled components for normal Pro projects. Choose Primitives or direct Runtime APIs when you
own the adapter or raw DOM contract.

The frozen V2 registry is documented in the
[V3 migration guide](/docs/getting-started/migration/#frozen-v2-registry).

See the current [Starwind UI CLI guide](https://starwind.dev/docs/getting-started/cli/) for every
command and option.