nats-fasterapi is a CLI tool that helps you scaffold and supercharge FastAPI projects.
It generates schemas, CRUD repositories, services, routes, and authentication utilities — so you can focus on building features instead of repetitive boilerplate. Think of it as a FastAPI project generator + productivity booster 🚀.
- 🏗️ Generate Pydantic schemas with a single command.
- 🗄️ Generate CRUD repositories backed by MongoDB (
motor), Redis, or custom logic. - 🔧 Generate service layers to connect repositories and routes.
- 🌐 Generate API routes with versioning support (
latest-modified/highest-number). - 🔑 Generate token-based authentication utilities (repository + dependencies).
- ⚡ Mount routes automatically into
main.py. - 🎯 Interactive prompts or automation-friendly
-y(yes) flag. - 📦 Designed for scalable microservices using FastAPI.
pip install nats-fasterapiUpgrade to the latest version anytime:
fasterapi updateRun fasterapi --help to see all available commands:
Usage: fasterapi [OPTIONS] COMMAND [ARGS]...
⚡ FasterAPI CLI — Scaffold and supercharge your FastAPI projects
Options:
-v, --version Show the FasterAPI version and exit
--help Show this message and exit
Commands:
make-crud Generate CRUD repository functions
make-schema Generate Pydantic schemas
make-service Generate service layer templates
make-route Generate route files (with versioning)
make-token-repo Generate token repository for roles
make-token-deps Generate token dependency utilities
mount Mount routes into main.py
run-d Run the dev server (uvicorn --reload)
update Upgrade FasterAPI CLI to latest
Generate a Pydantic schema.
fasterapi make-schema user✅ Good:
fasterapi make-schema product❌ Bad:
fasterapi make-schema User # Avoid uppercase
fasterapi make-schema # Missing nameGenerate CRUD repository functions for a schema.
fasterapi make-crud userGenerate a service layer for a schema.
fasterapi make-service userGenerate an API route with a versioning strategy.
fasterapi make-route user --version-mode latest-modified
fasterapi make-route product --version-mode highest-number
fasterapi make-route order # Will ask interactively
fasterapi make-route order -y # Skips prompt, defaults to highest-numberGenerate a token repository for authentication.
fasterapi make-token-repo admin user staffIf no roles are provided, it defaults to:
admin, user, staff, guest-editor
Generate token dependency utilities.
fasterapi make-token-depsMount all API routes into main.py.
fasterapi mountRun the development server with uvicorn.
fasterapi run-dEquivalent to:
uvicorn main:app --reloadUpgrade FasterAPI CLI to the latest version.
fasterapi updateClone the repository and install it in editable mode:
git clone https://github.com/yourusername/nats-fasterapi.git
cd nats-fasterapi
pip install -e .Run tests:
pytestHere’s what’s coming next for FasterAPI 🚀:
- SQLAlchemy (PostgreSQL / MySQL) repository generator
- SQLite lightweight repository scaffolding
- Cassandra & DynamoDB templates
- Neo4j graph database integration
- Central config file (
fasterapi.yaml) to scaffold schema, repo, service, and routes automatically - Environment-specific overrides for config-driven scaffolding
- Social logins (Google, GitHub, Facebook, Twitter) with OAuth2
- JWT refresh token rotation utilities
- API key and HMAC authentication scaffolding
-
fasterapi new myprojectto bootstrap a full FastAPI project - Opinionated folder structure with best practices baked in
- Global
--yesflag (applies to all commands for CI/CD) - Configurable templates for schema, CRUD, services, routes
- Built-in Dockerfile &
docker-composescaffolding - Built-in GitHub Actions CI/CD workflow generator
- CLI autocompletion for bash/zsh/fish
- Schema-first API generator (OpenAPI → code scaffolding)
- Hot reload template customization
This project is licensed under the MIT License. See the LICENSE file for details.
© 2025 Nathaniel Uriri