FASTAPI-DEV(1)
π FASTAPI-DEV(1) π
okay bestie, listen up β this is the manual page for fastapi-dev, a lil command in the User Commands family, and it's literally the glow-up version of running your FastAPI app while you're still building it. it's the dev-mode era. no cap. π§ͺβ¨
πΈ NAME πΈ
fastapi dev β run a FastAPI app in development mode. π§ͺ
π SYNOPSIS π
fastapi dev [OPTIONS] [PATH]
β¨ DESCRIPTION β¨
so basically? this is the exact same energy as fastapi-run(1), but with two key differences, and they're kind of the whole point:
- reload is enabled (your server refreshes when code changes, obsessed)
- it listens on the
127.0.0.1address (localhost only, cozy and private)
it's also lowkey a genius at figuring out what you meant. it automatically detects the Python module or package that needs to be imported, based on the file or directory path you hand it. π΅οΈβοΈ
and if you pass it no path at all? it just starts guessing, trying these in order:
main.pyapp.pyapi.pyapp/main.pyapp/app.pyapp/api.py
it also sniffs out the directory that needs to be added to your PYTHONPATH so the app is actually importable, and adds it for you. no manual export nonsense, we love that for us. π
then it goes looking for the FastAPI app object to use. by default it checks the module or package for an object named:
appapi
and if neither of those exists? it just grabs the first FastAPI app it finds in the imported module or package. main character energy honestly. π
π₯ OPTIONS π₯
--host TEXTβ the host to serve on. for local development on localhost, use127.0.0.1. if you want public access (say, inside a container), use all the available IP addresses with0.0.0.0. [default:127.0.0.1]--port INTEGERβ the port to serve on. normally you'd have a termination proxy on top (another program) handling HTTPS on port 443 and HTTP on port 80, and it passes the communication through to your app. [env var:PORT] [default:8000]--reload,--no-reloadβ turn auto-reload of the server on when (code) files change. heads up bestie, this is resource intensive, so only use it during development, fr fr. [default:reload]--reload-dir PATHβ set the reload directories explicitly instead of just using the current working directory.--root-path TEXTβ the root path. this tells your app that it's being served to the outside world with some path prefix set up in a termination proxy or similar.--app TEXTβ the name of the variable that holds the FastAPI app inside the imported module or package. if you don't give it one, it gets detected automatically. [default:None]--entrypoint,-e TEXTβ the FastAPI app import string, in the formatsome.importable_module:app_name.--proxy-headers,--no-proxy-headersβ enable/disableX-Forwarded-Proto,X-Forwarded-For, andX-Forwarded-Portto populate remote address info. [default:proxy-headers]--forwarded-allow-ips TEXTβ a comma separated list of IP Addresses to trust with proxy headers. the literal*means trust everything (yes, everything, be careful bb).--verbose,-vβ show detailed startup output and debug logs: how the FastAPI app was discovered, imported, and configured. perfect if you're nosy like me. π--helpβ show a help message and exit. the classic.
π¦ ARGUMENTS π¦
PATHβ a path to a Python file or package directory (with__init__.pyfiles) containing a FastAPI app. if you don't provide one, a default set of paths will be tried. [default:None]
π ENVIRONMENT π
PORTβ the port to serve on; same as the--portoption.
π SEE ALSO π
fastapi-run(1), fastapi-deploy(1), fastapi-login(1), fastapi-cloud(1), fastapi-new(1)
okay that's the whole page, you're fully caught up bestie πβ¨ this was the FASTAPI-DEV(1) page, dated July 2026, and yeah the version tag is literally just FASTAPI-DEV(1) again β iconic of it tbh. now go run your dev server and slay. ππ«Άπ
π¦ where this page comes from
- fedora 44: python3-fastapi 0.136.3-6.fc44 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms