Skip to main content

fastapi-init-cli 🚀

An interactive, production-ready CLI tool to scaffold modern FastAPI backends in seconds.

PyPI version Python versions License: MIT


✨ 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

  1. Clone the repository:

    git clone https://github.com/your-username/fastapi-init-cli.git
    cd fastapi-init-cli
    
  2. Install in editable mode with development dependencies:

    pip install -e ".[dev]"
    
  3. 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

fastapi_init_cli-1.0.1.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_init_cli-1.0.1-py3-none-any.whl (36.1 kB view details)

Uploaded Python 3

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

Hashes for fastapi_init_cli-1.0.1.tar.gz
Algorithm Hash digest
SHA256 604ac820971d6499821e510d36c676fe9ff5048a114c3715c96d0cbf5a1da3af
MD5 1a103d17937da184102b2ac801b48efd
BLAKE2b-256 a4f1796736bd4586188f3fd79ed5cf25101d7b9db4451763eb78ea42fc65148e

See more details on using hashes here.

File details

Details for the file fastapi_init_cli-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_init_cli-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 48dd49cc05907a78ee6236f49a5f70d39cbda0aa1c97d8a28235431aa0f0a307
MD5 2a285daa0bf1e6d4caff80cd6e2fabb3
BLAKE2b-256 6f37ff39b49aa90ed9924879cb4df88d6edb44c080ad52383482798f3d35e601

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.3

2 files

1.0.2

2 files

This release

1.0.1 This release

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page