Skip to main content

Forge CLI

Forge is a command-line tool to scaffold and manage Flask projects with Clean Architecture and strict OOP boundaries. It removes boilerplate, enforces best practices, and provides generators for entities, repositories, services, and controllers — all wired with a minimal DI container.


✨ Features

  • 🏗️ Single canonical template: Clean Architecture (domain/app/infra/interfaces/shared)
  • 🔒 Strict OOP: no functional boilerplate, clear layering
  • 🧩 Generators: add bounded contexts, entities, repos, services, controllers, tests
  • 📦 Plugins: OpenAPI (Smorest), JWT auth, telemetry (planned)
  • ⚡ DX polish: Ruff + Black + pre-commit, problem+json error model, request IDs, structured logs
  • 🗄️ Database support: SQLAlchemy + Alembic migrations
  • ✅ Tests: scaffolded per layer (domain/app/infra/http)
  • 🔧 CLI utilities: lint, format, db, doctor, tasks (planned)

📦 Installation

From PyPI

pipx install flask-forge-cli
# or
pip install flask-forge-cli

From source (dev mode)

git clone https://github.com/<you>/flask-forge.git
cd flask-forge
pip install -e .

🚀 Quickstart

# create a new clean-architecture Flask project
forge new shop
cd shop

# install dev dependencies
pip install -e ".[dev]"
cp .env.example .env

# init DB
forge db init
forge db migrate -m "init"
forge db upgrade

# run dev server
forge run dev -p 8000

# open http://localhost:8000/health

🧩 Generators

# bounded context
forge generate bc catalog

# entity + repo interface
forge generate entity catalog Product

# repo implementation (SQLAlchemy)
forge generate repo catalog Product --impl=sqlalchemy

# service
forge generate service catalog ProductService

# controller (Flask blueprint)
forge generate controller catalog product

# full resource across layers (+ tests)
forge generate resource catalog Product

🔌 Plugins

forge plugin openapi   # add OpenAPI (Smorest + Marshmallow)
forge plugin jwt       # add JWT auth endpoints
forge plugin telemetry # (planned) observability hooks

🧑‍💻 Developer Workflow

# lint (Ruff)
forge lint

# format (Black)
forge format

# check (Ruff + Black)
forge check

# run tests
pytest -q

# check environment
forge doctor all

Enable pre-commit hooks:

pre-commit install

📂 Project Layout (generated app)

src/<pkg>/
  app/            # application layer (use cases / services)
  domain/         # entities, repositories, value objects
  infra/          # db, repo impls
  interfaces/     # http controllers, api, middleware
  shared/         # config, logging, DI
  main.py         # thin bootstrap
tests/            # per-layer tests

📜 License

MIT © Kevin Martinez

Release files for flask-forge-cli 1.1.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 flask-forge-cli 1.1.0
File Size Uploaded
flask_forge_cli-1.1.0.tar.gz 28.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flask-forge-cli 1.1.0
File Interpreter ABI Platform
flask_forge_cli-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 61.0 kB

Release files / flask_forge_cli-1.1.0.tar.gz

Download URL flask_forge_cli-1.1.0.tar.gz
Size 28.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9b34bad598e3550c53f3bdda5f53d732d7c6567079e46c4c702b58f571fde1d8
BLAKE2b-256 checksum
How to use checksums
225c55d1984de098a8eb00abfcc2592b05d0220e2de6de1f48fa78cd13af20ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2025.

Transparency log

Release files / flask_forge_cli-1.1.0-py3-none-any.whl

Download URL flask_forge_cli-1.1.0-py3-none-any.whl
Size 33.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ee0e49b87561c15421ec1ab6f83c6bd18cca56d9200dc8784391dcd84a78182
BLAKE2b-256 checksum
How to use checksums
892249b2056b832c55abd46961674cde6e6492aa72c31b2b5b0f35e8fa56e319
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.1

2 release files

1.0.0

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