Fastman
The elegant CLI for FastAPI developers.
Fastman is an opinionated, batteries-included 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.4.2 (Dolphin)โ
route:list --jsonโ machine-readable route export, ready to pipe intojqor feed into CI scripts that verify expected routes.db:freshโ one-shot "wipe + migrate + (optional) seed" for the common dev-reset loop. Refuses to run whenENVIRONMENT=productionas a safety net.model:show <name>โ SQLAlchemy model introspection that walks every model module, finds the named class (snake/Pascal-case tolerant), and renders columns / relationships / indexes as Rich tables. Replaces theinspectcommand dropped in v0.4.0.
What's New in v0.4.1 (Dolphin)โ
fastman updateโ re-scaffold drifted project files against current templates. Diff each fastman-owned file (database.py, config.py, alembic/env.py, mail/, auth/) against what fastman would generate today; pick keep/update per file. Closes the mid-project lifecycle gap: pull in SQLAlchemy 2.0, Pydantic v2, dropped.env.production, etc. without recreating your project. Supports--checkfor CI and--allfor unattended runs.- AST-aware code injection โ
install:auth --type=keycloakandinstall:mailno longer rely on fragilestr.replace()on hardcoded anchor strings. Both now parseapp/main.pyandapp/core/config.pywithastto locate the target class structurally, wrap injected blocks in# fastman:<tag>:start/:endmarkers for idempotent re-runs, andast.parse()the result to guarantee the file still compiles. No more silent no-ops when you've customized a comment.
What's New in v0.4.0 (Dolphin)โ
- Lean command surface โ 6 low-leverage commands removed (
package:list,config:cache/clear,inspect,migrate:reset,package:importโpackage:install). Use the underlying tool directly or the renamed equivalent. - Mail scaffolding โ new
install:mail(SMTP/SendGrid/Mailgun/SES) andmake:mailcommands with HTML or Markdown templates and FastAPI BackgroundTasks integration. - Modern codegen โ generated models use SQLAlchemy 2.0
DeclarativeBase+ typedMapped[]columns; schemas use Pydantic v2ConfigDict. - Smart pluralization โ
address โ addresses,category โ categories,analysis โ analyses,person โ people. No moreaddresssin your tablenames. - Pattern-aware
make:*โ.fastmanrcrecords the project pattern; runningmake:controllerin a feature-pattern project now gives an actionable error. - Keyword + builtin guard โ
fastman make:feature classis rejected before any code is generated. - Dynamic shell completions โ bash / zsh / fish / powershell auto-include every registered command, with zero static lists to keep in sync.
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 โ