In-project generation
Generate FSD slices
Generate typed FSD slices directly inside an existing project. The CLI reads fsd.config.json, resolves the framework's source directory, and writes framework-aware files to the matching layer.
Syntax
npx create-fsd-architecture --generate <type> <name>npx create-fsd-architecture -g <type> <name>Command examples
npx create-fsd-architecture --generate feature auth
npx create-fsd-architecture -g feature checkout-flow
npx create-fsd-architecture --generate feature product-filters
npx create-fsd-architecture --generate entity product
npx create-fsd-architecture -g entity order
npx create-fsd-architecture --generate widget navbar
npx create-fsd-architecture -g widget dashboard-sidebar
npx create-fsd-architecture --generate page checkoutExamples by slice type
Feature example
featureUse this for user actions and business interactions such as auth, checkout, filters, search, or forms.
npx create-fsd-architecture --generate feature authsrc/features/auth/
├── ui/
├── model/
└── index.tsEntity example
entityUse this for business objects such as product, user, order, brand, category, or cart item.
npx create-fsd-architecture --generate entity productsrc/entities/product/
├── ui/
├── model/
└── index.tsWidget example
widgetUse this for composed UI blocks such as navbar, sidebar, header, product grid, or checkout summary.
npx create-fsd-architecture --generate widget navbarsrc/widgets/navbar/
├── ui/
└── index.tsPage example
pageUse this for route-level page compositions such as checkout, profile, catalog, or dashboard.
npx create-fsd-architecture --generate page checkoutsrc/pages/checkout/
├── ui/
└── index.tsOverwrite examples
The generator protects existing slices unless you explicitly pass `--force`.
npx create-fsd-architecture --generate feature auth --force
npx create-fsd-architecture -g widget navbar --forceSupported types
Overwrite behavior
Existing slices are protected by default. Pass `--force` when you intentionally want to overwrite a generated slice.
Generator behavior
Generated paths
Project with src/
src/features/auth/
src/entities/product/
src/widgets/navbar/
src/pages/checkout/Nuxt project
app/features/auth/
app/entities/product/
app/widgets/navbar/
app/pages/checkout/
app/app/routes/checkout.vueSvelteKit project
src/features/auth/
src/entities/product/
src/widgets/navbar/
src/pages/checkout/
src/routes/checkout/+page.svelteProject without src/
features/auth/
entities/product/
widgets/navbar/
pages/checkout/Feature presets
Generic features use the API, server-state, client-state, and forms choices already stored in fsd.config.json.
Feature preset examples
apiClient: axios
serverState: react-query
Creates API helpers, React Query hooks, typed request files, UI entry points,
and a public index.ts export.framework: vue-vite
serverState: vue-query
clientState: pinia
forms: vee-validate-zod
Creates Vue single-file components, composables, a Pinia store,
typed API helpers, validation schemas, and a public index.ts export.framework: sveltekit
apiClient: fetch
serverState: svelte-query
clientState: svelte-store
forms: sveltekit-superforms-zod
Creates Svelte 5 components, Svelte Query accessors, a Svelte store,
Superforms + Zod validation, and a public index.ts export. Page slices also
receive a src/routes/<name>/+page.svelte route wrapper.clientState: zustand
Creates a local store, typed actions/state, UI entry points,
and a public index.ts export.clientState: redux
Creates a slice, actions/selectors, UI entry points,
and a public index.ts export.apiClient: fetch
serverState: none
clientState: none
forms: none
Creates a typed framework-native component, styles-ready structure,
and a public index.ts export.