fastapi-init-cli 🚀
An interactive, production-ready CLI tool to scaffold modern FastAPI backends in seconds.
✨ Features
- Async-First & Sync Support: Async SQLAlchemy 2.0 (
asyncpg,aiomysql,aiosqlite) or standard Sync. - Multiple Databases: PostgreSQL, MySQL, and SQLite.
- Modular Authentication:
- JWT (Access & Refresh tokens with Bearer auth)
- Google OAuth 2.0 integration
- OTP-based Email Verification
- OTP-based Forgot & Reset Password flow
- Secure bcrypt password hashing
- Clean Architecture:
app/core/(Pydantic v2 settings, database session dependency, security)app/models/(SQLAlchemy 2.0 models)app/schemas/(Pydantic v2 request/response schemas)app/services/(Clean business logic layer)app/routes/(Versioned FastAPI routers)
- Database Migrations: Automatic async/sync Alembic migration setup.
- Zero Runtime Lock-in: The scaffolded project is 100% standard FastAPI with no dependency on
fastapi-init-cli.
📦 Installation
pip install fastapi-init-cli
🚀 Quickstart
Run the interactive CLI:
fastapi-init
(or fastapi-init-cli)
Interactive Walkthrough:
╭─────────────────────────────────────────────────────────────╮
│ FastAPI Init │
│ Create a production-ready FastAPI backend in seconds. │
╰─────────────────────────────────────────────────────────────╯
? Project / Folder name: backend
? Select database engine: PostgreSQL
? Select execution architecture: Async
? Do you want authentication? Yes
? Select authentication method: JWT + Google OAuth
? Do you want email verification? (OTP-based) Yes
? Do you want forgot-password functionality? (OTP-based) Yes
? Do you want database migrations with Alembic? Yes
Then start your new backend:
cd backend
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reload
🛠️ Development & Contributing
-
Clone the repository:
git clone https://github.com/your-username/fastapi-init-cli.git cd fastapi-init-cli
-
Install in editable mode with development dependencies:
pip install -e ".[dev]"
-
Run tests:
pytest
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastapi_init_cli-1.0.1.tar.gz.
File metadata
- Download URL: fastapi_init_cli-1.0.1.tar.gz
- Upload date:
- Size: 21.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
604ac820971d6499821e510d36c676fe9ff5048a114c3715c96d0cbf5a1da3af
|
|
| MD5 |
1a103d17937da184102b2ac801b48efd
|
|
| BLAKE2b-256 |
a4f1796736bd4586188f3fd79ed5cf25101d7b9db4451763eb78ea42fc65148e
|
File details
Details for the file fastapi_init_cli-1.0.1-py3-none-any.whl.
File metadata
- Download URL: fastapi_init_cli-1.0.1-py3-none-any.whl
- Upload date:
- Size: 36.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48dd49cc05907a78ee6236f49a5f70d39cbda0aa1c97d8a28235431aa0f0a307
|
|
| MD5 |
2a285daa0bf1e6d4caff80cd6e2fabb3
|
|
| BLAKE2b-256 |
6f37ff39b49aa90ed9924879cb4df88d6edb44c080ad52383482798f3d35e601
|