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.2.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.2-py3-none-any.whl (36.4 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_init_cli-1.0.2.tar.gz.

File metadata

  • Download URL: fastapi_init_cli-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 2866308bfbaf0ae1bea8b2c593f1fa11df586920770bd189ac4fc50f0730a7c9
MD5 88dcfc5742b340277c07255ce1444829
BLAKE2b-256 42f98f1af9aeee4c6476f36f20a6330abcc2b8efc63841be0289741179e5ab21

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastapi_init_cli-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 11782b8438d2ce2bbd75298c2b06d1f6ce6e63f0993b803c9daebba8017508de
MD5 887ee94c454f9efb288279a5cd0e3681
BLAKE2b-256 d9c71d27dfce8e285604ec93bbc246d461a4591a49e1c18902219a7bbf21799c

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.3

2 files

This release

1.0.2 This release

2 files

1.0.1

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