Fastman
The elegant CLI for FastAPI artisans.
Fastman is a Laravel-inspired command-line tool that brings structure, speed, and best practices to FastAPI development. Instead of manually wiring up project scaffolding, database configurations, migrations, and authentication โ Fastman handles it all from the terminal so you can focus on building your application logic.
30 seconds to your first APIโ
# 1. Install
pip install fastman
# 2. Create a project with PostgreSQL
fastman create my-api --database=postgresql
# 3. Navigate into the project and scaffold a feature
cd my-api
fastman make:feature users --crud
# 4. Create a migration, apply it, and start the server
fastman make:migration "create users table"
fastman database:migrate
fastman serve
Open http://localhost:8000/docs โ you now have a fully documented REST API with CRUD endpoints, Swagger UI, database migrations, and a clean project structure.
Why Fastman?โ
FastAPI gives you incredible performance and flexibility โ but every new project means repeating the same setup: choosing an architecture, configuring a database connection, setting up Alembic for migrations, adding authentication, and writing boilerplate for every new feature.
Fastman eliminates that repetitive work. With a single command you get opinionated defaults that follow production-tested best practices, while every generated file remains fully customizable. There's no lock-in โ it's your code from the start.
What you getโ
| Command | What it does |
|---|---|
fastman create | Production-ready project with configuration, database, migrations, and tests |
make:feature | Complete vertical slice โ model, schema, service, and router โ in one command |
make:model, make:service, ... | 15+ generators for every component type (controllers, middleware, repos, etc.) |
database:migrate | Alembic migrations without touching INI files or configuration |
install:auth --type=jwt | Full JWT auth with /register, /login, /me endpoints and password hashing |
install:cert | Build a merged CA bundle from project-local .pem / .crt files for private services |
serve | Development server with automatic hot reload |
tinker | Interactive Python shell with your database session pre-loaded |
route:list | View all registered API routes in a formatted table |
Supported databasesโ
SQLite ยท PostgreSQL ยท MySQL ยท Oracle ยท Firebase
Supported package managersโ
uv ยท poetry ยท pipenv ยท pip โ auto-detected from your project
Architecture patternsโ
- Feature โ vertical slices, each feature is self-contained (recommended)
- API โ resource-grouped with built-in API versioning
- Layer โ traditional MVC-style separation of concerns
What's New in v0.3.6 (Cheetah)โ
- Keycloak switched to
fastapi-keycloakwith dependency-based route protection GET /meendpoint automatically registered for Keycloak auth- Swagger Authorize button via
idp.add_swagger_config(app) - Lazy Keycloak initialization โ no network calls at import time, no SSL crashes on startup
- Non-destructive SSL support โ Fastman builds a merged CA bundle instead of modifying
certifi - Graceful startup fallback โ the app still boots if Keycloak is unreachable or admin token setup is incomplete
See the full changelog.
๐ Getting Started
New to Fastman? Start here โ install the CLI and create your first project in under 5 minutes.
Installation โ๐ฏ Commands Reference
Browse all 30+ commands with options, flags, and real-world examples.
View Commands โ