Special feature generator

Auth feature generation

The `auth` feature has a dedicated flow. The CLI asks which modules you need, then adapts the generated files to the selected data or state preset.

Commands

bash
npx create-fsd-architecture --generate feature auth
bash
npx create-fsd-architecture -g feature auth
bash
npx create-fsd-architecture --generate feature auth --force

Auth as a feature example

Auth is generated through the normal `feature` type, then the CLI switches to the dedicated auth flow because the slice name is `auth`.

bash
npx create-fsd-architecture --generate feature auth
npx create-fsd-architecture -g feature auth
text
feature + auth
→ asks for auth modules
→ asks for data/state preset
→ generates src/features/auth/

Login

Optional module selected during generation.

Register

Optional module selected during generation.

Forgot Password Flow

Optional module selected during generation.

Selection examples

text
? Which auth modules do you need?
> Login
> Register

Creates login and register UI, typed payloads,
and exports the generated public API.
text
? Which auth modules do you need?
> Login
> Forgot Password Flow

Creates login, forgot password, reset password,
and verify email / verify code placeholders.

Forgot password flow

Forgot password
Reset password
Verify email / verify code placeholder

Supported presets

Axios + React Query
Zustand
Redux Toolkit
UI only

Dependency assumptions

The CLI does not install dependencies. Generated code assumes the selected libraries already exist in the target project.

ts
import { useMutation } from "@tanstack/react-query";
import { apiClient } from "@/shared/api";

Generated structure examples

text
src/features/auth/
├── api/
├── model/
├── ui/
└── index.ts
text
src/features/auth/
├── ui/login-form.tsx
├── ui/register-form.tsx
├── ui/forgot-password-form.tsx
├── ui/reset-password-form.tsx
├── ui/verify-code-form.tsx
└── index.ts