Project Commands
Commands for creating, initializing, and building Fastman projects.
new
The new command is the starting point for any Fastman application. It scaffolds a complete, production-ready directory structure configured with your preferred tools and architecture.
fastman new {name} [options]
Arguments
name(Required): The name of your project. This will create a directory with this name and set it as the project name inpyproject.toml.
Options
--pattern
Defines the architectural style of the generated project.
-
feature(Default): Vertical Slice Architecture.- Best for: Medium to large applications, domain-driven design.
- Structure: Code is organized by "features" (e.g.,
auth,billing,users), where each feature contains its own models, schemas, services, and routes. - Why use it? Keeps related code together, making it easier to scale and maintain as the team grows.
-
layer: Layered (MVC) Architecture.- Best for: Traditional web apps, teams familiar with Django/Laravel/Spring.
- Structure: Code is organized by technical layer (
controllers,models,services,repositories). - Why use it? Familiar separation of concerns. Good for smaller projects or strict technical separation.
-
api: Minimal API.- Best for: Microservices, simple endpoints, prototypes.
- Structure: Flat structure with a single
main.pyor simpleapifolder. - Why use it? Low overhead, maximum speed for simple tasks.
--database
Configures the database connection, drivers, and initial migration setup.
sqlite(Default):- Sets up
sqlite:///./sql_app.db. - Great for development and testing. No external server required.
- Sets up
postgresql:- Installs
psycopg2-binary. - Configures
.envfor Postgres connection. - Production standard.
- Installs
mysql:- Installs
mysqlclient. - Configures
.envfor MySQL/MariaDB.
- Installs
oracle:- Installs
cx_Oracle. - Enterprise grade setup.
- Installs
firebase:- Sets up Firebase Admin SDK.
- Good for NoSQL/Real-time apps.
--package
Selects the Python package manager to initialize the project with.
uv(Default):- The fastest option. Uses
uvfor lightning-fast installs and dependency resolution. - Highly Recommended.
- The fastest option. Uses
poetry:- Uses
poetryfor dependency management. - Robust, standard for many Python teams.
- Uses
pipenv:- Uses
Pipfileandpipenv.
- Uses
pip:- Standard
requirements.txtandvenv. - Simple, no extra tools required.
- Standard
--minimal
Skips the creation of optional directories and files (like tests, scripts, etc.) for a cleaner start.
Examples
Standard Project (Recommended)
fastman new my-app
Creates a Vertical Slice app with SQLite and uv.
Production Ready Stack
fastman new enterprise-app --pattern=feature --database=postgresql --package=poetry
Creates a robust feature-based app with Postgres and Poetry.
Microservice
fastman new payment-service --pattern=api --minimal
Creates a lightweight API service.
init
Initializes Fastman in an existing project directory.
fastman init
This command is useful if you have an existing FastAPI project and want to start using Fastman's CLI tools (like make:controller or migrate). It will:
- Create the
.fastmanconfiguration. - Scaffold necessary directories (
app/console,app/core). - Set up the base
Commandstructure.
build
Builds the project for production.
fastman build [--docker]
Options
-
--docker: Automatically generates aDockerfileand builds a Docker image for your application.- The generated Dockerfile is optimized for size and security (using
python:slim). - It includes build steps for your chosen package manager.
- The generated Dockerfile is optimized for size and security (using
-
Default (no flags):
-
--open: Automatically openshttps://fastman.dev/docsin your default browser.
version
Shows version information.
fastman version