Customise features
At every level after hello, fastkit can add features to the project: authentication, background tasks, caching, monitoring, logging, testing, migrations, utilities, developer tooling and deployment files. Each feature comes with its code, its settings and its tests. You choose them in the guided dialogue or with --feature options.
The customise step
After the level and the database, fastkit init asks Customise features?. Answer y and it asks one question per feature group, then the package manager and the project details. Press Enter to keep the default shown in brackets.
The session below selects the layered level, SQLite, JWT authentication, Alembic migrations and ruff. --dry-run shows the result without writing anything.
$ fastkit init --no-venv --dry-run
⚡ Create a FastAPI project
Project name: shop
...
Select a level [1]: 3
...
Select database [6]: 5
Customise features? [y/N]: y
🔐 Authentication Selection
Choose your authentication strategy
Authentication Options
┏━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Option ┃ Name ┃ Description ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 1 │ JWT │ OAuth2 password flow with JWT (recommended for │
│ │ │ APIs) │
│ 2 │ OAuth2 │ OAuth2 with authlib │
│ 3 │ FastAPI-Users │ Complete user management (JWT; SQL databases only) │
│ 4 │ Session-based │ Traditional session-based authentication │
│ 5 │ None │ No authentication │
└────────┴───────────────┴─────────────────────────────────────────────────────┘
Select authentication method [5]: 1
...
Select migration tool [2]: 1
...
Your choice (or press Enter to skip): 1
...
Create the project in a new folder 'shop'? [Y/n]:
Project summary
┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Setting ┃ Value ┃
┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ Project name │ shop │
...
│ Database │ SQLite │
│ Features │ Authentication: JWT; Testing: Coverage; Migrations: │
│ │ Alembic; Developer tooling: ruff │
...
Coverage is the default answer of the testing question, so it is part of every feature selection unless you choose another testing option. At the hello level the question reads Customise package manager and project details? instead, because hello takes no features.
The same with options
Every answer has an option. --feature AXIS=VALUE selects one feature and can be repeated; a group that takes several values separates them with commas (--feature tooling=ruff,pre-commit). When the options answer every question, init asks only for confirmation. This command makes the same selection as the session above. With --dry-run it also lists the files and packages it would add, here the authentication package, and writes nothing:
$ fastkit init --level layered --name shop --database SQLite --feature authentication=JWT --feature migrations=Alembic --feature tooling=ruff --dry-run
...
│ Database │ SQLite │
│ Features │ Authentication: JWT; Testing: Coverage; Migrations: │
│ │ Alembic; Developer tooling: ruff │
...
│ ├── auth/
...
Packages that would be installed (via uv):
...
├── pyjwt[crypto]
...
├── sqlalchemy[asyncio]
└── uvicorn[standard]>=0.52.4
╭───────────────────── Info ──────────────────────╮
│ ℹ Dry run complete — no files were written. │
╰─────────────────────────────────────────────────╯
Levels and features lists the axis names and their values. --extra-package adds a package of your own and can be repeated. --package-manager picks pip, uv, pdm or poetry; without it, fastkit uses uv when it is installed and pip otherwise. -y keeps the default of every question the options leave open:
$ fastkit init --level layered --name shop --database None --feature deployment=docker-compose --extra-package httpx --package-manager pdm --dry-run -y
...
│ Features │ Testing: Coverage; Deployment: Docker, docker-compose │
│ Extra packages │ httpx │
...
│ Package manager │ pdm │
...
Rules between features
Some features depend on others:
- Authentication
FastAPI-Usersneeds DatabasePostgreSQL,MySQLorSQLite. - Deployment
docker-composealso selects DeploymentDocker. - Database
PostgreSQLorMySQLaddsaiosqlite(dev). - Caching
Redisand Background tasksCeleryorDramatiq: Redis will be used for both caching and task queue (shared dependency).
fastkit checks the rules before it writes anything. A combination that breaks one is refused with exit status 1:
$ fastkit init --level layered --name shop --database MongoDB --feature authentication=FastAPI-Users --dry-run
╭───────────────────────────────── Error ──────────────────────────────────╮
│ ❌ Authentication 'FastAPI-Users' needs a SQL database (PostgreSQL, │
│ MySQL, SQLite), but database 'MongoDB' is selected. Choose one of those │
│ databases, or the 'JWT' option, which works with every database. │
╰──────────────────────────────────────────────────────────────────────────╯
List the features
fastkit list-features prints one table per feature group with the packages each option installs, extras included (pyjwt[crypto]), and ends with the features every project already has:
$ fastkit list-features
...
Container deployment files
┏━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Option ┃ Packages ┃
┡━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ Docker │ (No additional packages) │
│ docker-compose │ (No additional packages) │
└────────────────┴──────────────────────────┘
Built into every project: CORS, Pagination.
Each selected feature gets a section in the generated README.md that names its files and settings and links the FastAPI documentation.