Special feature generator
Generate an auth feature scaffold
Naming a feature auth activates the dedicated generator. It creates auth UI and integration scaffolding and adapts the output to the stack saved in fsd.config.json.
In CLI 2.8.0, generated API endpoints are examples. Connect an application backend and verify session handling and authorization before deployment. The opt-in Supabase adapter (--auth-provider supabase) ships since CLI 2.7.0; its staging end-to-end acceptance is still pending. See the Supabase integration guide.
Feature status
- Auth generatorStable
- Forms, validation, state, and example API requests for all five frameworks. The endpoints are placeholders: connect your own backend and review session handling before production.
- Supabase adapterPreview
- Released in CLI 2.7.0 behind
--auth-provider supabase. Generated output builds in all five frameworks; end-to-end checks against a live Supabase project (sign-up confirmation, recovery mail, password reset, refresh and logout, RLS) are still pending. Browser only: SSR cookies and server authorization need your own integration.
Commands
npx create-fsd-architecture@latest --generate feature authnpx create-fsd-architecture@latest -g feature authnpx create-fsd-architecture@latest --generate feature auth --forceGenerated flow
Stack-aware output
Axios or Fetch
Creates API functions using the configured client.
TanStack Query
Adds React Query hooks, Vue Query composables, or Svelte Query accessors for the selected framework.
Framework-native stores
Creates Zustand, Redux Toolkit, Pinia, or Svelte store auth state and reusable helpers.
Redux Toolkit
Creates a reducer, actions, selectors, and registers the reducer.
Typed form validation
Uses React Hook Form, VeeValidate, or Superforms with Zod for every auth step.
Minimal stack
Keeps the generated feature UI-focused when optional tools are disabled.
SvelteKit output
In sveltekit projects, the command generates native Svelte 5 components for all five auth steps, TanStack Svelte Query v6 accessors, a Svelte auth store, and Superforms + Zod 4 validation. Forms use SvelteKit progressive enhancement while keeping their server-ready validation contract.
Vue output
In vue-vite and nuxt projects, the same command generates Vue single-file components for login, registration, password recovery, reset, and verification, plus Vue Query composables, a Pinia store, and VeeValidate + Zod forms when enabled. Nuxt uses its configured modules and SSR-aware Vue Query plugin.
Generated structure
src/features/auth/
├── api/
├── lib/
├── model/
├── ui/
└── index.tsExact files vary with the configured API, state, and forms choices. Existing auth files are protected unless you pass --force.
Nuxt writes the same feature under app/features/authbecause its framework adapter owns the app/ source root. SvelteKit writes it under src/features/auth.
Generated files
Output from --dry-run with the React defaults (React Query, Zustand, React Hook Form + Zod):
src/features/auth/
├── api/
│ ├── login.api.ts register.api.ts forgot-password.api.ts
│ ├── reset-password.api.ts verify-code.api.ts
│ └── auth.query.ts # React Query hooks
├── lib/
│ ├── auth.keys.ts # query keys
│ └── auth.helpers.ts
├── model/
│ ├── auth.types.ts auth.store.ts # Zustand store
│ ├── <flow>.types.ts # one per flow
│ └── <flow>.schema.ts # Zod schema per flow
├── ui/
│ ├── login-form.tsx register-form.tsx forgot-password-form.tsx
│ └── reset-password-form.tsx verify-code-form.tsx
└── index.tsThe five flows are login, register, forgot password, reset password, and verify code. Vue and SvelteKit produce the same API, store, query, and schema modules with LoginForm.vue or LoginForm.svelte components, and share one auth.types.ts instead of a types file per flow.
What your stack changes
- In React projects,
serverState: "none"skips the API modules,auth.query.ts, and the query keys; wire the forms to your own requests. clientState: "none"skipsauth.store.ts. Redux projects getauth.slice.tsandauth.selectors.tsinstead of a Zustand store.forms: "none"drops the Zod schemas; the components keep plain form handling.--auth-provider supabaseaddsapi/supabase.adapter.js, its type declarations,api/supabase.ts(exportingconfigureSupabaseAuth), andSUPABASE.md.
After generating
- Point the API modules at your backend, or configure the Supabase client once at app start.
- Render the forms from a page, for example
-g page login, importing them from@/features/auth. - Verify session handling, token storage, and authorization on the server before shipping. The generated code is a starting point, not a security review.