Registry / web-framework / fastapi-cli

fastapi-cli

JSON →
library0.0.32pypypi✓ verified 26d ago

FastAPI CLI (Command Line Interface) is a command-line program that simplifies running and managing FastAPI applications. It provides commands to serve apps in development and production modes, manage projects, and more. It is usually installed as part of `fastapi[standard]` and receives frequent updates, typically involving dependency bumps and occasional breaking changes related to Python version support or internal dependencies.

pip install "fastapi[standard]"
INSTALL
IMPORT
SIG · FASTAPI-CLI
F
fastapi-cli
web-frameworkpythonv0.0.32
Install
6.7s avg
Import
Disk
86MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.32 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 82.6MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 6.7s · import 0.000s · 85MB
86MB installed
● package 86MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

fastapi
This is a command-line utility, not a Python library meant for direct import into Python code. You invoke it from your terminal.
The primary interaction is via the 'fastapi' command in the shell, e.g., 'fastapi dev'.

Create a `main.py` file with a basic FastAPI application instance named `app`. Then, run the application using `fastapi dev main.py` for development with auto-reload. For more explicit project setup, configure the `entrypoint` in `pyproject.toml` and then simply run `fastapi dev`.

# main.py from fastapi import FastAPI app = FastAPI() @app.get("/") async def read_root(): return {"message": "Hello FastAPI CLI!"} # Terminal commands # Run in development mode (with auto-reload): # fastapi dev main.py # Or, for explicit configuration (recommended for larger projects): # 1. Add to pyproject.toml: # [tool.fastapi] # entrypoint = "main:app" # 2. Then run: # fastapi dev
fastapi --version
Debug
Known issues
breakingDropped support for Python 3.9 in version 0.0.23, and Python 3.8 in version 0.0.19. Ensure your project's Python version meets the minimum requirement (>=3.10).
fix
Upgrade your Python environment to 3.10 or newer.
affects: 0.0.19, 0.0.23 and later
breakingDropped support for Pydantic v1 in version 0.0.17. This may cause issues if your project relies on Pydantic v1. Note that version 0.0.16 had temporarily fixed Pydantic v1 support, but it was subsequently dropped again.
fix
Upgrade Pydantic to v2 and migrate your models if necessary, or pin `fastapi-cli` to an older version (e.g., <=0.0.16) if Pydantic v1 compatibility is critical.
affects: 0.0.17 and later (after 0.0.16)
deprecatedThe `fastapi-cli-slim` package was deprecated in version 0.0.21. Projects should now directly use `fastapi-cli`.
fix
Migrate from `fastapi-cli-slim` to `fastapi-cli` if you were using the slim version.
affects: 0.0.21 and later
gotchaAlways use `fastapi dev` for local development and `fastapi run` for production-like environments. `fastapi dev` enables auto-reload and binds to `127.0.0.1` (localhost), while `fastapi run` disables auto-reload and binds to `0.0.0.0` (accessible externally), which is suitable for containers or behind a reverse proxy. Using `fastapi dev` in production is resource-intensive and less stable.
fix
Use `fastapi run` for deploying your application. For robust production deployments, consider using a process manager like Gunicorn with Uvicorn, and a reverse proxy like Nginx.
affects: All versions
gotchaFor complex project structures or when other tools need to find your app, it's highly recommended to configure the `entrypoint` in your `pyproject.toml` file rather than always passing the file path to `fastapi dev` or `fastapi run`.
fix
Add a `[tool.fastapi]` section to your `pyproject.toml` with `entrypoint = "your_module:your_app_instance"` (e.g., `entrypoint = "main:app"`).
affects: All versions
Upgrade
Version history
0.0.32latest on PyPI · released Jul 16, 2026
Audit
Dependencies
fastapirequiredCore framework the CLI manages.
typerrequiredUsed for building the command-line interface.
uvicornrequiredHigh-performance ASGI server used internally by the CLI to run applications.
fastapi-cloud-clioptionalIncluded with `fastapi[standard]` for FastAPI Cloud deployments; can be excluded via `fastapi[standard-no-fastapi-cloud-cli]`.
Agent activity
15 hits · last 30 days
node
14
Resources
fastapi-cli — pip install fastapi-cli · libregistry