fastapi new my-app
#170
Unanswered
thiagomendonca-eu
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
Description:
Currently, when initializing a new FastAPI project using tools like
uv
, we have to manually editmain.py
file and add the basic boilerplate code (e.g., initializingFastAPI
, adding a sample route, etc.) before we can runfastapi dev main.py
.This is a repetitive step that could be automated and would significantly improve developer experience.
Suggested Behavior:
Creates:
With
main.py
already set up like this:This would align FastAPI CLI with other popular web frameworks like:
npx create-next-app@latest
django-admin startproject
flask --app app new
Optional Flags (future enhancement ideas):
--venv
: automatically create and activate a virtual environment--install
: install FastAPI and Uvicorn dependencies--package-name
: customize the inner package name (default:app
)Let me know if this makes sense — happy to help contribute with an initial implementation as well!
Operating System
Linux
Operating System Details
Ubuntu 24.04 LTS
Python Version
latest
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions