Skip to main content

fastgen

A nest cli-style module manager for FastAPI: it scaffolds a minimal, zero-config module skeleton (entity, service, router, shared session dependency) and keeps a module registry so AI agents and developers can see the project structure at a glance. Fill in the business logic yourself.

Install

pip install fastgen-cli
# or
uv add fastgen-cli

Usage

fastgen --help

# Scaffold a feature module and register it
fastgen make module user

# List registered modules and their boundaries
fastgen list

Both commands support --dir <root> (project root, defaults to cwd), --dry-run (preview without writing) and --force (overwrite existing skeleton files).

Running fastgen make module <feature> generates:

app/
├── core/                        # auto-created on first use
│   ├── config.py                # pydantic-settings Settings (DATABASE_URL in .env)
│   └── database.py              # Base (AsyncAttrs), async engine, get_session dependency
└── modules/
    ├── __init__.py              # module registry (auto-maintained, do not edit)
    └── user/
        ├── __init__.py          # re-exports router
        ├── schemas.py           # Pydantic entity skeleton: class User(BaseModel): pass
        ├── service.py           # business layer boundary: class UserService
        └── router.py            # APIRouter + SessionDep (Annotated[AsyncSession, Depends(get_session)])

Existing code is never overwritten: app/core/config.py / database.py are only generated when missing or empty.

Conventions (fixed)

  • Modules live in app/modules/<feature>/, one business unit per folder.
  • The router exposes prefix="/<plural>" and tags; the shared session dependency is imported from app.core.database.
  • app/modules/__init__.py is a fastgen-maintained registry (modules: dict[str, str]) mapping module name to import path; fastgen list reads it (and each module's docstring) to show the whole project.

Roadmap

  • Phase 1: make module (schemas + service skeleton) ✅
  • Phase 2: module registry + fastgen list ✅
  • Phase 3: make resource (full CRUD router), Alembic migration hints

Release files for fastgen-cli 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastgen-cli 0.4.0
File Size Uploaded
fastgen_cli-0.4.0.tar.gz 17.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fastgen-cli 0.4.0
File Interpreter ABI Platform
fastgen_cli-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.9 kB

Release files / fastgen_cli-0.4.0.tar.gz

Download URL fastgen_cli-0.4.0.tar.gz
Size 17.0 kB
Tags Source
SHA-256 checksum
How to use checksums
27498c87a6339476601c983e3e72c5117709b7b99293b80530f399cf3f51fae1
BLAKE2b-256 checksum
How to use checksums
ff4c1300cfad417211f093f5d5359a5d31a0750c28e52ce7b3caa89aae0ac6df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / fastgen_cli-0.4.0-py3-none-any.whl

Download URL fastgen_cli-0.4.0-py3-none-any.whl
Size 11.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1df3895f253e8a285fa1395eeedf9bf17ad85dec587b6362da127d273d06bfae
BLAKE2b-256 checksum
How to use checksums
d1c583779afe51b83a96c00ff83e78f095dbe9cccb60312c361187891c252ffc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.7.0

6 release files

This release

0.4.0 This release

2 release 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