fastapi - Man Page
fastapi – FastAPI CLI – The fastapi command line app.
Examples (TL;DR)
- Run a FastAPI app with automatic reload (for development):
fastapi run path/to/file.py --reload
- Serve your app in both development mode:
fastapi dev path/to/file.py
- Specify the host and port to run on:
fastapi run path/to/file.py --host host_address --port port
- Set the app variable name (if not
app
) or specify a custom app directory:fastapi run path/to/file.py --app-dir path/to/app --app custom_app_name
- Display help:
fastapi --help
- Display help for a subcommand:
fastapi subcommand --help
Synopsis
fastapi [Options] COMMAND [ARGS]...
Description
Manage your FastAPI projects, run your FastAPI apps, and more.
Options
- --version
Show the version and exit.
- --install-completion
Install completion for the current shell.
- --show-completion
Show completion for the current shell, to copy it or customize the installation.
- --help
Show a help message and exit.
Commands
- dev
Run a FastAPI app in development mode.
- run
Run a FastAPI app in production mode.
See Also
Referenced By
fastapi-dev(1), fastapi-run(1).
May 2024