]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
📝 Document `--entrypoint` CLI option (#15464)
authorYurii Motov <109919500+YuriiMotov@users.noreply.github.com>
Sat, 23 May 2026 16:35:54 +0000 (18:35 +0200)
committerGitHub <noreply@github.com>
Sat, 23 May 2026 16:35:54 +0000 (18:35 +0200)
docs/en/docs/fastapi-cli.md
docs/en/docs/tutorial/first-steps.md

index 17898888f1550c4845b46d014e3ac37ace99d3fb..9d8f415d9babf0a42f2e0ae0eb824ff44d62bd0e 100644 (file)
@@ -95,7 +95,7 @@ which would be equivalent to:
 from backend.main import app
 ```
 
-### `fastapi dev` with path { #fastapi-dev-with-path }
+### `fastapi dev` with path or with `--entrypoint` CLI option { #fastapi-dev-with-path-or-with-entrypoint-cli-option }
 
 You can also pass the file path to the `fastapi dev` command, and it will guess the FastAPI app object to use:
 
@@ -103,7 +103,13 @@ You can also pass the file path to the `fastapi dev` command, and it will guess
 $ fastapi dev main.py
 ```
 
-But you would have to remember to pass the correct path every time you call the `fastapi` command.
+Or, you can also pass the `--entrypoint` option to the `fastapi dev` command:
+
+```console
+$ fastapi dev --entrypoint main:app
+```
+
+But you would have to remember to pass the correct path\entrypoint every time you call the `fastapi` command.
 
 Additionally, other tools might not be able to find it, for example the [VS Code Extension](editor-support.md) or [FastAPI Cloud](https://fastapicloud.com), so it is recommended to use the `entrypoint` in `pyproject.toml`.
 
index 96aaa7463b106af548631612937afdbe13f6c53e..ae43e401bab07a49ca46ca67ebc4e9284affe9bb 100644 (file)
@@ -180,7 +180,7 @@ which would be equivalent to:
 from backend.main import app
 ```
 
-### `fastapi dev` with path { #fastapi-dev-with-path }
+### `fastapi dev` with path or with `--entrypoint` CLI option { #fastapi-dev-with-path-or-with-entrypoint-cli-option }
 
 You can also pass the file path to the `fastapi dev` command, and it will guess the FastAPI app object to use:
 
@@ -188,7 +188,13 @@ You can also pass the file path to the `fastapi dev` command, and it will guess
 $ fastapi dev main.py
 ```
 
-But you would have to remember to pass the correct path every time you call the `fastapi` command.
+Or, you can also pass the `--entrypoint` option to the `fastapi dev` command:
+
+```console
+$ fastapi dev --entrypoint main:app
+```
+
+But you would have to remember to pass the correct path\entrypoint every time you call the `fastapi` command.
 
 Additionally, other tools might not be able to find it, for example the [VS Code Extension](../editor-support.md) or [FastAPI Cloud](https://fastapicloud.com), so it is recommended to use the `entrypoint` in `pyproject.toml`.