A set of command line tools that help you scaffold out your flask application quickly.
Project description
Flask-Commands
Flask-Commands is a local-first CLI that scaffolds Flask projects and automates the wiring between views, routes, controllers, and models so you ship faster with consistent structure.
Getting Started
Flask-Commands bundles opinionated, productivity-focused generators:
flask newboots a ready-to-run Flask project with virtualenv, dotenv, Tailwind wiring, and SQLite + migrations by default. Use--no-dbto skip DB setup.flask make:viewgenerates template files and can optionally wire controllers, routes/blueprints, and SQLAlchemy models.flask make:controllerscaffolds a controller class and can optionally add RESTful actions, routes, templates, and model generation (--modelor-m, with--flat/--nestfor inferred model choices).flask make:modelscaffolds a SQLAlchemy model and can optionally wire RESTful controllers, routes, and templates (--crud, with--flat/--nestfor model structure selection).
All generated code is plain Flask with no hidden runtime layers; every file is created on disk. The goal is to remove repetitive setup work while keeping everything local and transparent.
Installation
Flask-Commands is designed to be installed globally so you can create new Flask apps anywhere on your machine.
Recommended:
pipx install Flask-Commands --include-deps
Alternative:
pip install Flask-Commands
You will also want npm available because generated Flask projects include Tailwind CSS tooling. If npm is not installed, install Node.js first.
Quick Start
flask new myproject # includes a SQLite DB scaffolding by default
cd myproject
To create a project without database support, use:
flask new myproject --no-db
Recommended (macOS):
./run.sh
Manual startup:
source venv/bin/activate
flask run --debug
run.sh opens a Flask shell, starts the dev server, rebuilds tailwind.css and tailwind.min.css, opens VS Code and Chrome, and hot-reloads changes in templates/, controllers/, forms/, models/, and routes/.
Browser reloading uses fswatch, so install it first if it is not already available:
brew install fswatch
Docs quick links
- Full guide: https://flask-commands.readthedocs.io/en/latest/docs.html
- Install and first run: https://flask-commands.readthedocs.io/en/latest/install_and_first_run.html
- Starting a project: https://flask-commands.readthedocs.io/en/latest/starting_a_project.html
- Core ideas: https://flask-commands.readthedocs.io/en/latest/commands/core_ideas.html
- Cheat sheet: https://flask-commands.readthedocs.io/en/latest/commands/cheat_sheet.html
- Changelog: https://flask-commands.readthedocs.io/en/latest/changelog.html
Cheat sheet
flask new myproject— New Flask project with DB scaffolding (default).flask new myproject --no-db— New Flask project without DB setup.flask make:view about— Template only (app/templates/about.html).flask make:view recipes.index -rcm— Start a recipe resource with a list page, route, controller, and model.flask make:view recipes.show -rc— Add a detail page to the existing recipe resource.flask make:view recipes.create -rcm— Add aGETaction that renders a recipe form template.flask make:view recipes.store -rcm— Add aPOSTaction that wires behavior without creating a template.flask make:view recipes.comments.index -rcm— Create a nested comments resource under recipes.flask make:controller RecipeController --crud— Generate RESTful controller methods, routes, and templates for recipes.flask make:controller RecipeController --crud -m— Generate the RESTful recipe resource and matching model in one controller-first command.flask make:controller ShoppingListController --crud --model ShoppingList— Keep a multi-word model name together while generating RESTful scaffolding.flask make:controller RecipeIngredientController --crud -m --nest— Force the nested model interpretation for a controller-first--crudflow.flask make:model Recipe— Create and register a single model scaffold.flask make:model Recipe --crud— Model + RESTful controller/routes/templates.flask make:model ShoppingList --crud --flat— Force a flat model interpretation and RESTful structure.flask make:model RecipeIngredient --crud --nest— Force a nested model interpretation and RESTful structure.
Examples
Here are a few commands and what they do so you can see the speed, consistency gains, and how commands combine in practice.
1) Create a recipe index page with full wiring
flask make:view recipes.index -rcm
This scaffolds:
- the template at
app/templates/recipes/index.html - a controller with an
indexmethod - a RESTful route for
/recipes - a
Recipemodel plus registration inapp/models/__init__.py
2) Add a recipe detail page to the same resource
flask make:view recipes.show -rc
Because Recipe is already registered, route inference generates the RESTful show route:
/recipes/<int:recipe_id>- the controller method signature includes
recipe_id
3) Generate a full RESTful resource from the controller first
flask make:controller RecipeController --crud -m
This scaffolds the seven RESTful actions across:
- controller methods
- routes in
app/routes/recipes/ - templates for the
GETactions (index,show,create, andedit) - a
Recipemodel plus registration
4) Handle nested recipe/ingredient model shape intentionally
flask make:model RecipeIngredient --crud
If nested candidates are detected, you will get a prompt to choose flat vs nested. To skip the prompt explicitly:
flask make:model RecipeIngredient --crud --flat
flask make:model RecipeIngredient --crud --nest
Contributing
I’m keeping development closed for now, but feedback is welcome. Please open an issue for bugs or ideas. License: MIT.
Project details
Release history Release notifications | RSS feed
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 flask_commands-0.3.4.tar.gz.
File metadata
- Download URL: flask_commands-0.3.4.tar.gz
- Upload date:
- Size: 55.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
424e5e64da1b708d93f1539baab1c5dc8b5b05fce8d533aca46b3df91ff59eb9
|
|
| MD5 |
9403b2f35c95c7b8c0c51dd021fb7941
|
|
| BLAKE2b-256 |
50996e204fabccdc45a1457efac2e2f237fc37ffdfbc3492d6d05ee6bb7c9232
|
Provenance
The following attestation bundles were made for flask_commands-0.3.4.tar.gz:
Publisher:
publish-to-pypi-on-version-change.yml on drewbutcher/flask-commands
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flask_commands-0.3.4.tar.gz -
Subject digest:
424e5e64da1b708d93f1539baab1c5dc8b5b05fce8d533aca46b3df91ff59eb9 - Sigstore transparency entry: 1738259907
- Sigstore integration time:
-
Permalink:
drewbutcher/flask-commands@cb25665dd1bc0a5ab33bd89dcd746d5cc73a2311 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/drewbutcher
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi-on-version-change.yml@cb25665dd1bc0a5ab33bd89dcd746d5cc73a2311 -
Trigger Event:
push
-
Statement type:
File details
Details for the file flask_commands-0.3.4-py3-none-any.whl.
File metadata
- Download URL: flask_commands-0.3.4-py3-none-any.whl
- Upload date:
- Size: 69.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32dfcdf365e1ecf71ef97d034647bbd35d86ebdea3f6e481e07845e2415ef89b
|
|
| MD5 |
761b4b187a0d6f93e770d9874ccd30e6
|
|
| BLAKE2b-256 |
6c7e60ce3b6eb1ca470129da978d51e02bd28dfea684ff1d4960d3d8db572370
|
Provenance
The following attestation bundles were made for flask_commands-0.3.4-py3-none-any.whl:
Publisher:
publish-to-pypi-on-version-change.yml on drewbutcher/flask-commands
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flask_commands-0.3.4-py3-none-any.whl -
Subject digest:
32dfcdf365e1ecf71ef97d034647bbd35d86ebdea3f6e481e07845e2415ef89b - Sigstore transparency entry: 1738259971
- Sigstore integration time:
-
Permalink:
drewbutcher/flask-commands@cb25665dd1bc0a5ab33bd89dcd746d5cc73a2311 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/drewbutcher
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi-on-version-change.yml@cb25665dd1bc0a5ab33bd89dcd746d5cc73a2311 -
Trigger Event:
push
-
Statement type: