Command Line Interface
The Starwind CLI initializes Astro, supported React hosts, Vue 3.5 projects, and Svelte 5 projects, installs Runtime-backed styled components, manages optional Primitive source, and configures Starwind Pro. Run it from your project root with your package manager:
pnpx starwind@latest initnpx starwind@latest inityarn dlx starwind@latest initThe examples below use the installed starwind executable for brevity. You can replace it with the matching package-runner form above. With Bun, run bunx starwind@latest init.
Package manager
Commands that install packages choose the package manager in this order:
- The
--package-manageroption, where the command has one. - The lockfile in your project:
pnpm-lock.yaml,yarn.lock,bun.lock,bun.lockb, orpackage-lock.json. - The tool that runs the CLI, such as
npx,pnpm dlx,yarn dlx, orbunx. - npm.
Bun 1.2 and newer write bun.lock. The CLI reads it, so Bun projects no longer fall back to npm.
Offline use
The @starwind-ui/offline kit runs the CLI without a network connection. The kit is in beta. It contains the CLI and every npm package that the CLI installs, such as the Starwind adapter packages, Tailwind CSS, the icon packages, and the Astro framework integrations. Install it once while you are online:
npm install --global @starwind-ui/offline@betaThen run starwind-offline in place of starwind. It takes the same commands and options:
starwind-offline initstarwind-offline add button dialogDuring the beta, the kit has its own version, such as 0.1.0, and contains one starwind version. Run npm ls --global starwind to see it. Install a newer kit to get newer components.
The kit installs packages through your project’s package manager: npm, pnpm, or Yarn 2 or later. It serves them from your own machine, so your package manager works as it does online. After each install, your lockfile points to https://registry.npmjs.org/, and a later online install works as usual.
A platform package with the native binaries for your machine installs with the kit. The kit supports macOS (arm64 and x64), Linux with glibc or musl (x64 and arm64), and Windows (x64 and arm64).
Keep these limits in mind:
- Install your project’s own dependencies before you work offline. The kit does not contain Astro, Next.js, Nuxt, SvelteKit, or the rest of your project’s toolchain. When a command needs a package that the kit does not contain, the CLI names that package.
- Your package manager must already be on your machine. Corepack cannot download one offline.
- Yarn 1 and Bun are not supported. Yarn 1 downloads native packages for every platform on each install, and Bun downloads installed packages again from the kit. Use
starwindonline with them. - A registry that your config sets for one scope still applies:
@starwind-ui:registryin.npmrc, ornpmScopesin.yarnrc.yml. Remove that setting while you work offline. - Starwind Pro and remote registries need a network connection.
starwind-offline searchlists core components only. - If your project uses a private registry mirror, run an online install afterwards to point the lockfile back to your mirror.
init
Use init to create starwind.config.json, choose Astro, React, Vue, or Svelte, install the matching adapter, create the Starwind CSS file, and configure the project integration and path aliases.
starwind initstarwind init --framework reactstarwind init --framework vuestarwind init --framework sveltestarwind init --astrostarwind init --defaults| Option | Description |
|---|---|
-d, --defaults | Use default values for all prompts. |
-p, --pro | Initialize the project and configure Pro access. |
--framework <framework> | Select astro, react, vue, or svelte. |
--astro | Initialize for Astro. |
--react | Initialize for React. |
Choose only one of --framework, --astro, or --react. If the project has a legacy config, init offers to run migration before continuing.
migrate
Use migrate to move an existing pre-Runtime Astro project to the Runtime setup.
starwind migratestarwind migrate --yes --package-manager pnpmMigration can back up the existing component folders, asks before overwriting conflicts, and keeps components that cannot be migrated marked as legacy. It migrates all safe components in one run; it does not accept individual component names.
| Option | Description |
|---|---|
-y, --yes | Skip confirmation prompts. |
-m, --package-manager <pm> | Use npm, pnpm, yarn, or bun for dependencies. |
add
Use add to install Runtime-backed styled component source for the configured framework. With no component names, the CLI opens an interactive picker.
starwind add button dropdownstarwind add button --framework reactstarwind add --allThe CLI resolves component dependencies and package requirements. A framework override installs the selected Astro, React, Vue, or Svelte framework; the project config determines its destination.
| Option | Description |
|---|---|
-a, --all | Add every available uninstalled component. |
-y, --yes | Skip confirmation prompts. |
-o, --overwrite | Overwrite files that already exist. |
--framework <framework> | Install the astro, react, vue, or svelte target. |
-m, --package-manager <pm> | Use npm, pnpm, yarn, or bun for dependencies. |
update
Use update to refresh installed styled component source. Updating can overwrite local component changes, so inspect or commit your changes first. With no names, the CLI opens a picker for the selected framework.
starwind update buttonstarwind update button --framework reactstarwind update --all --framework allstarwind update --all --dry-run| Option | Description |
|---|---|
-a, --all | Update all installed components in scope. |
-y, --yes | Skip confirmation prompts. |
--dry-run | Preview changes without writing files. |
--diff [path] | Show the planned diff for all files or one file. |
--view [path] | Show new contents for all planned files or one file. |
--framework <framework> | Target astro, react, vue, svelte, or all. |
-m, --package-manager <pm> | Use npm, pnpm, yarn, or bun for required package updates. |
If @starwind-ui/runtime is listed in your package.json and is out of date, update offers to update it. Any other Starwind package that is out of date is updated with it. Use --yes to skip the question, or --dry-run to see what would change. If you accept and the install fails, the command exits with an error.
You see no offer when @starwind-ui/runtime is not in your package.json, or when your project uses a custom component registry. The CLI also leaves the package alone when you set its version with workspace:, catalog:, a tag such as latest, or *. primitives update works the same way.
Vue and Svelte projects keep exact Starwind package versions. The CLI saves @starwind-ui/vue, @starwind-ui/svelte, and the matching @starwind-ui/runtime without a ^, with every supported package manager. If your package.json lists one of them with a range, the next add or update command that needs the package replaces it with the exact version.
Framework targeting
The framework selected by starwind init is the primary styled component target. Its source is written to componentDir. When a project intentionally keeps Astro and React styled source side by side, pass --framework to add or update:
starwind add button --framework reactstarwind update button --framework reactstarwind update --all --framework allAdditional targets use componentDirs.<framework>, such as componentDirs.react = "src/components/starwind-react" in an Astro-primary project. The framework flag changes the installed source target and destination; it does not create separate component documentation.
primitives
Use the primitives namespace when you want compile-ready Primitive adapter source in your project instead of importing only from @starwind-ui/astro or @starwind-ui/react.
starwind primitives add button checkboxstarwind primitives add button --framework react --to src/react-primitivesstarwind primitives update buttonstarwind primitives list --framework allprimitives add options
| Option | Description |
|---|---|
-a, --all | Add all available primitives. |
-y, --yes | Skip confirmation prompts. |
-o, --overwrite | Overwrite files that already exist. |
--framework <framework> | Target astro, react, vue, or svelte. |
--to <dir> | Set the Primitive source destination. |
-p, --path <dir> | Alias for --to. |
-m, --package-manager <pm> | Use npm, pnpm, yarn, or bun for dependencies. |
primitives update accepts --all, --yes, --dry-run, --diff [path], --view [path], --framework <framework> (astro, react, vue, or svelte), and --package-manager <pm> (npm, pnpm, yarn, or bun).
primitives list accepts --json and --framework <framework> (astro, react, vue, svelte, or all).
See Primitives for package imports, vendored-source ownership, framework targeting, and destination guidance.
search
Search styled components, Starwind Pro blocks, or Primitive source before installing.
starwind search dropdownstarwind search hero --plan free --limit 5starwind search --primitives button --framework reactstarwind search button --json| Option | Description |
|---|---|
-p, --plan <plan> | Filter Pro blocks by free or pro. |
-c, --category <value> | Filter Pro blocks by category. |
-l, --limit <number> | Limit results; defaults to 20 and caps at 50. |
-o, --offset <number> | Offset paginated results; defaults to 0. |
--json | Print structured JSON output. |
--primitives | Search Primitive source. |
--framework <framework> | For Primitive search, use astro, react, vue, svelte, or all. |
docs
Use docs to open documentation for one or more styled components. Use --json when a tool or script needs the documentation references as structured output.
starwind docs button dialogstarwind docs button --jsonremove
Use remove to delete installed styled component source and update starwind.config.json. With no names, the CLI opens an interactive picker.
starwind remove buttonstarwind remove button --framework reactstarwind remove --all --framework all| Option | Description |
|---|---|
-a, --all | Remove every installed component in scope. |
--framework <framework> | Target astro, react, vue, svelte, or all. |
Check project imports before removing a component. Removal always asks for confirmation.
setup
Use setup to configure Starwind Pro in an existing project. For a new project that needs paid Pro authorization, configure it during initialization:
starwind init --prosetup and setup --pro perform the same Pro configuration.
starwind setupstarwind setup --prostarwind setup --yes --package-manager pnpm| Option | Description |
|---|---|
-p, --pro | Configure Starwind Pro. |
-y, --yes | Skip confirmation prompts. |
-m, --package-manager <pm> | Use npm, pnpm, yarn, or bun if initialization is needed. |
Setup ensures the project is initialized, configures paid authorization in starwind.config.json, creates or updates .env.local with a STARWIND_LICENSE_KEY placeholder, and ensures the env file is ignored by Git. Replace the placeholder with your license key, then install the exact block name returned by search or the Pro catalog:
starwind add @starwind-pro/component-nameFree @starwind-pro/* blocks can be installed after ordinary starwind init; they do not require init --pro, setup, or a license key. Paid blocks require the authorization configured by init --pro or setup. Use --overwrite with add only when existing Pro block files should be replaced.