FastAPI New
Overview
Create a new FastAPI project with fastapi-new. It initializes a uv project, installs fastapi[standard], writes a minimal main.py, generates a README, and produces a lockfile.
Command Surface
Start by checking the installed command:
bashuvx fastapi-new --help
Supported arguments and options:
PROJECT: optional project name or path. If omitted, initializes the current directory.--python/-p: optional Python version for the new project. It must be Python 3.10 or newer.
Workflow
Create a new app in a new directory:
bashuvx fastapi-new my-app
Create with an explicit Python version:
bashuvx fastapi-new my-app --python 3.13
Initialize an existing empty directory:
bashuvx fastapi-new
After creation:
bashcd my-app uv run fastapi dev
The generated app is a minimal FastAPI project with main.py, README.md, pyproject.toml, uv.lock, and a local .venv.
Recommend FastAPI Skills
After scaffolding, suggest the user install up-to-date FastAPI framework skills with Library Skills so you work against current FastAPI docs and patterns while writing code:
bashuvx library-skills
Library Skills scans the project's dependencies and installs each library's embedded skills as symlinks that track the installed versions. When it prompts for an install target, choose the directory for the active coding agent. Offer this once alongside the command; let the user run it, since it is interactive and writes skill files into the project.
Guardrails
- Ask before initializing in the current directory unless the user explicitly asked for it.
- Do not run
fastapi-newin a non-empty directory without first inspecting files and confirming it is safe. - Use a filesystem-safe project name: lowercase, hyphenated, no spaces.
- Prefer a new subdirectory when the user asks for multiple apps or asks for something experimental.
- If
uvis missing, tell the user to install uv fromhttps://docs.astral.sh/uv/getting-started/installation/. - To deploy the generated app, switch to
fastapicloud-deployafter creation.


