Skip to content

✨ Add implementation of fastapi-new CLI, and base for fastapi new command#5

Merged
tiangolo merged 10 commits into
fastapi:mainfrom
savannahostrowski:add-new-command
Nov 10, 2025
Merged

✨ Add implementation of fastapi-new CLI, and base for fastapi new command#5
tiangolo merged 10 commits into
fastapi:mainfrom
savannahostrowski:add-new-command

Conversation

@savannahostrowski
Copy link
Copy Markdown
Member

@savannahostrowski savannahostrowski commented Oct 27, 2025

This PR adds the initial version of fastapi new, which initializes your project, installs dependencies, and downloads boilerplate code to simplify the fastapi getting started experience.

The goal is to support two core workflows:

# One-off project creation (no install):
uvx fastapi-new my-project

# If they want it integrated:
pip install "fastapi[standard,new]"
fastapi new my-project

The commands above create identical projects with main.py, README.md, and project configuration with a pyproject.toml.

Once this is merged, I will follow up with a PR to fastapi-cli to register this command
and update our docs to reflect this simpler path to getting started. Later, I'd like to extend this to allow users to pass --template or a similar option to customize the boilerplate downloaded.

image

@savannahostrowski savannahostrowski added feature New feature or request and removed feature New feature or request labels Oct 27, 2025
Copy link
Copy Markdown

@patrick91 patrick91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't wait to have this!

I've left some comments, hopefully I'm not too annoying :D

Comment thread src/fastapi_new/cli.py Outdated
Comment thread src/fastapi_new/new.py Outdated
Comment thread src/fastapi_new/new.py Outdated
Comment thread src/fastapi_new/new.py
Comment thread tests/test_new.py Outdated
Comment thread tests/test_new.py Outdated
Copy link
Copy Markdown
Member

@tiangolo tiangolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great! 🤩

I tried it locally to see how it feels and how it looks in the terminal, so polished! I like it. ✨

I just have a few minor comments.

Comment thread src/fastapi_new/new.py Outdated
Comment thread src/fastapi_new/new.py Outdated
Comment thread src/fastapi_new/new.py Outdated
Comment thread src/fastapi_new/new.py
),
] = None,
python: Annotated[
str | None,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm realizing we can require Python 3.10+ for running fastapi-new, so we can finally use the new union vertical bar [tears of joy 🥹].

Comment thread src/fastapi_new/new.py Outdated
Comment thread .gitignore Outdated
Comment thread tests/test_new.py Outdated
Copy link
Copy Markdown
Member

@tiangolo tiangolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! This looks great! 🚀 ✨ 🎉

@tiangolo tiangolo changed the title fastapi new command ✨ Add implementation of fastapi-new CLI, and base for fastapi new command Nov 10, 2025
@tiangolo tiangolo merged commit 031b857 into fastapi:main Nov 10, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants