Skip to content

Applies to CLI v2.7.1Last updated

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

NameValuesDescription
create [project-name]default actionScaffold a new FSD project.
generate <type> <name...>alias g, -g, --generateGenerate one or more slices in the current project.
check--architectureInspect config and layers. With --architecture, run the project's installed Steiger.
doctor--architectureRun check plus toolchain diagnostics (Node.js, Git, package manager).
configPrint the resolved fsd.config.json.
upgradesee upgrade optionsSafely migrate CLI-owned project tooling.
--list-templatesShow stable and planned framework templates.

Generator types

NameValuesDescription
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.
sharedui [components...] | apiShared primitives (button, input, label, card) or an apiClient.
shared, app--segments onlyStructure-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

NameValuesDescription
-f, --framework <id>react-vite | nextjs | vue-vite | nuxt | sveltekitSelect the framework without the template prompt.
-y, --yesAccept defaults. Requires a project name and --framework.
--package-manager <id>npm | pnpm | yarn | bunPackage manager and lockfile.
--api-client <id>axios | fetchGenerated request helpers.
--server-state <id>react-query | vue-query | svelte-query | noneOverride the framework server-state default.
--client-state <id>zustand | redux | pinia | svelte-store | noneOverride the framework client-state default.
--forms <id>react-hook-form-zod | vee-validate-zod | sveltekit-superforms-zod | noneOverride the framework forms default.
--no-installCreate the project without installing packages.
--no-startDo not start the development server.
--dry-runPreview every planned change without writing files.
--forceReplace 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

NameValuesDescription
--dry-runPrint planned files and route/store edits; write nothing.
--forceOverwrite an existing slice. Refused in batch mode.
--segments <names>comma-separated, e.g. ui,apiStructure-only mode: create missing segment folders and empty public APIs, keep existing files.
-r, --root <path>e.g. src/libSource root for structure-only mode. Requires --segments.
--auth-provider <id>supabaseOnly with feature auth: generate the opt-in Supabase browser adapter.

Upgrade options

NameValuesDescription
--dry-runShow the upgrade plan and make no changes.
--checkRead-only status for CI; see exit codes below.
-y, --yesApply only when the complete plan has no conflicts.
--no-installSkip installing dependencies after a dependency migration.
--allow-dirtyPermit apply in a dirty Git worktree after a warning.

Global options

NameValuesDescription
-h, --helpShow help.
-v, --versionShow the installed CLI version.

Exit codes

CodeMeaning
0Success. For upgrade --check: the project is current.
1The command failed (invalid arguments, failed check, write error).
2upgrade --check: an upgrade is available.
3upgrade --check: an upgrade is blocked by conflicts.
4upgrade --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

Support FSD CLI

If FSD CLI helps you build, consider supporting its development and documentation. Donations are optional.

GitHub Sponsors (opens in a new tab)Buy Me a Coffee (opens in a new tab)

InstaPay · Egypt

ashrafmo-1

للدعم من مصر عبر إنستا باي. تأكد من بيانات المستلم قبل تأكيد التحويل.