Reference · CLI 2.7.1
CLI reference
fsd and create-fsd-architecture are the same CLI. Install it globally to use fsd, or run it once with npx. Run fsd --help for the same summary in your terminal.
Usage
bash
fsd create [project-name] [options]
fsd generate <type> <name...> [--force] [--dry-run] # alias: fsd g
fsd <check|doctor> [--architecture]
fsd config
fsd upgrade [--dry-run] [--check] [--yes] [--no-install] [--allow-dirty]The flag form works everywhere, including npx:
bash
npx create-fsd-architecture@latest [project-name] [options]
npx create-fsd-architecture@latest -g <type> <name...> [--force] [--dry-run]
npx create-fsd-architecture@latest -g <type> [names...] --segments ui,api [--root src]
npx create-fsd-architecture@latest -g shared <ui|api> [components...]Commands
| Name | Values | Description |
|---|---|---|
| create [project-name] | default action | Scaffold a new FSD project. |
| generate <type> <name...> | alias g, -g, --generate | Generate one or more slices in the current project. |
| check | --architecture | Inspect config and layers. With --architecture, run the project's installed Steiger. |
| doctor | --architecture | Run check plus toolchain diagnostics (Node.js, Git, package manager). |
| config | Print the resolved fsd.config.json. | |
| upgrade | see upgrade options | Safely migrate CLI-owned project tooling. |
| --list-templates | Show stable and planned framework templates. |
Generator types
| Name | Values | Description |
|---|---|---|
| feature | <name...> | User interactions, e.g. auth, cart, search. |
| entity | <name...> | Business entities, e.g. product, customer. |
| widget | <name...> | Composite UI blocks. navbar, sidebar, footer, and bottom-bar are accessible layout presets. |
| page | <name...> | Routed pages. home, about, and consult are content presets. |
| shared | ui [components...] | api | Shared primitives (button, input, label, card) or an apiClient. |
| shared, app | --segments only | Structure-only layers without a slice name. |
Several names create a batch: every slice is checked before writing, and earlier slices roll back if a later one fails. See the slice generator guide.
Create options
| Name | Values | Description |
|---|---|---|
| -f, --framework <id> | react-vite | nextjs | vue-vite | nuxt | sveltekit | Select the framework without the template prompt. |
| -y, --yes | Accept defaults. Requires a project name and --framework. | |
| --package-manager <id> | npm | pnpm | yarn | bun | Package manager and lockfile. |
| --api-client <id> | axios | fetch | Generated request helpers. |
| --server-state <id> | react-query | vue-query | svelte-query | none | Override the framework server-state default. |
| --client-state <id> | zustand | redux | pinia | svelte-store | none | Override the framework client-state default. |
| --forms <id> | react-hook-form-zod | vee-validate-zod | sveltekit-superforms-zod | none | Override the framework forms default. |
| --no-install | Create the project without installing packages. | |
| --no-start | Do not start the development server. | |
| --dry-run | Preview every planned change without writing files. | |
| --force | Replace an existing target, with automatic rollback. |
State and forms values must match the framework; the CLI rejects mixed stacks such as Pinia in a React project. See project configuration.
Generate options
| Name | Values | Description |
|---|---|---|
| --dry-run | Print planned files and route/store edits; write nothing. | |
| --force | Overwrite an existing slice. Refused in batch mode. | |
| --segments <names> | comma-separated, e.g. ui,api | Structure-only mode: create missing segment folders and empty public APIs, keep existing files. |
| -r, --root <path> | e.g. src/lib | Source root for structure-only mode. Requires --segments. |
| --auth-provider <id> | supabase | Only with feature auth: generate the opt-in Supabase browser adapter. |
Upgrade options
| Name | Values | Description |
|---|---|---|
| --dry-run | Show the upgrade plan and make no changes. | |
| --check | Read-only status for CI; see exit codes below. | |
| -y, --yes | Apply only when the complete plan has no conflicts. | |
| --no-install | Skip installing dependencies after a dependency migration. | |
| --allow-dirty | Permit apply in a dirty Git worktree after a warning. |
Global options
| Name | Values | Description |
|---|---|---|
| -h, --help | Show help. | |
| -v, --version | Show the installed CLI version. |
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success. For upgrade --check: the project is current. |
| 1 | The command failed (invalid arguments, failed check, write error). |
| 2 | upgrade --check: an upgrade is available. |
| 3 | upgrade --check: an upgrade is blocked by conflicts. |
| 4 | upgrade --check: the project or its manifest is invalid. |
Examples
bash
fsd create my-app --framework react-vite --yes
fsd g entity product customer --dry-run
fsd g widget navbar sidebar footer bottom-bar
fsd g page about consult
fsd g feature auth --auth-provider supabase
fsd g shared ui button input
fsd g shared api
fsd g feature cart --segments ui,api --root src/lib
fsd check --architecture
fsd upgrade --check