Skip to content

Applies to CLI v2.8.0

Project source of truth

Configure once, generate consistently

Every project created by the wizard receives an fsd.config.json file. Generators read it automatically, so developers do not repeat the same stack decisions for every feature.

Example

json
{
  "$schema": "https://raw.githubusercontent.com/FSD-CLI/cli/main/schema/fsd.config.schema.json",
  "schemaVersion": 1,
  "packageManager": "npm",
  "apiClient": "axios",
  "serverState": "react-query",
  "clientState": "zustand",
  "forms": "react-hook-form-zod",
  "ui": "shared-ui",
  "framework": "react-vite"
}

Nuxt example

json
{
  "$schema": "https://raw.githubusercontent.com/FSD-CLI/cli/main/schema/fsd.config.schema.json",
  "schemaVersion": 1,
  "framework": "nuxt",
  "packageManager": "npm",
  "apiClient": "fetch",
  "serverState": "vue-query",
  "clientState": "pinia",
  "forms": "vee-validate-zod",
  "ui": "shared-ui"
}

Nuxt defaults to its native $fetch client. Pinia and VeeValidate are registered as Nuxt modules, while Vue Query uses an SSR-aware plugin.

Vue + Vite example

json
{
  "$schema": "https://raw.githubusercontent.com/FSD-CLI/cli/main/schema/fsd.config.schema.json",
  "schemaVersion": 1,
  "framework": "vue-vite",
  "packageManager": "npm",
  "apiClient": "axios",
  "serverState": "vue-query",
  "clientState": "pinia",
  "forms": "vee-validate-zod",
  "ui": "shared-ui"
}

SvelteKit example

json
{
  "$schema": "https://raw.githubusercontent.com/FSD-CLI/cli/main/schema/fsd.config.schema.json",
  "schemaVersion": 1,
  "framework": "sveltekit",
  "packageManager": "npm",
  "apiClient": "fetch",
  "serverState": "svelte-query",
  "clientState": "svelte-store",
  "forms": "sveltekit-superforms-zod",
  "ui": "shared-ui"
}

These defaults generate Svelte 5 components, TanStack Svelte Query accessors, framework-native stores, and progressively enhanced Superforms backed by Zod 4.

Supported fields

FieldValuesPurpose
frameworkreact-vite | nextjs | vue-vite | nuxt | sveltekitControls framework-native components, providers, and generators.
packageManagernpm | pnpm | yarn | bunKeeps setup commands and lockfiles consistent.
apiClientaxios | fetchChooses generated request helpers.
serverStatereact-query | vue-query | svelte-query | noneControls the framework-compatible TanStack Query output.
clientStatezustand | redux | pinia | svelte-store | noneControls client-state files and provider wiring.
formsreact-hook-form-zod | vee-validate-zod | sveltekit-superforms-zod | noneControls typed forms and validation schemas.
uishared-uiTargets the starter's shared UI primitives.

When the file exists

The CLI validates schemaVersion and generates files from the saved choices without asking the stack questions again.

Existing projects

If the file is missing, the generator infers a compatible setup from dependencies in package.json. Adding the config later makes that behavior explicit and repeatable.

Framework compatibility is validated

The capability matrix rejects mixed stacks such as Pinia in a React project, Zustand in a Vue project, or Pinia in a SvelteKit project. Defaults are selected from the chosen framework before--yes is applied.

Defaults by framework

FrameworkapiClientserverStateclientStateforms
react-viteaxiosreact-queryzustand | reduxreact-hook-form-zod
nextjsaxiosreact-queryzustand | reduxreact-hook-form-zod
vue-viteaxiosvue-querypiniavee-validate-zod
nuxtfetchvue-querypiniavee-validate-zod
sveltekitfetchsvelte-querysvelte-storesveltekit-superforms-zod

The first value is the default that --yes picks. Every framework also accepts axios or fetch for the API client, and none for server state, client state, and forms. React and Next.js additionally accept redux for client state.

Override at creation

bash
npx create-fsd-architecture@latest my-app --framework nextjs --yes \
  --api-client fetch --client-state redux --package-manager pnpm

Any option you pass skips its wizard question; the rest use the framework defaults above. The CLI rejects combinations the framework cannot use before writing anything.

Change it later

Edit fsd.config.json and install the matching packages yourself; the next generator run follows the new values. Slices that already exist are not rewritten, so a project can briefly mix styles while you migrate. Run npx create-fsd-architecture@latest config to print the resolved configuration.

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

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