{"id":14064799,"url":"https://github.com/fastapi/fastapi-cli","last_synced_at":"2025-05-14T05:10:35.987Z","repository":{"id":237756655,"uuid":"795186513","full_name":"fastapi/fastapi-cli","owner":"fastapi","description":"Run and manage FastAPI apps from the command line with FastAPI CLI. 🚀","archived":false,"fork":false,"pushed_at":"2025-05-05T17:27:54.000Z","size":135,"stargazers_count":442,"open_issues_count":21,"forks_count":54,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-05-08T00:13:30.989Z","etag":null,"topics":["cli","fastapi","typer","uvicorn"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fastapi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["tiangolo"]}},"created_at":"2024-05-02T18:48:32.000Z","updated_at":"2025-05-06T15:29:04.000Z","dependencies_parsed_at":"2024-05-06T07:27:43.182Z","dependency_job_id":"42591ce6-7579-4758-964f-5610f8050e87","html_url":"https://github.com/fastapi/fastapi-cli","commit_stats":{"total_commits":165,"total_committers":10,"mean_commits":16.5,"dds":0.5454545454545454,"last_synced_commit":"9a4741816dc288bbd931e693166117d98ee14dea"},"previous_names":["tiangolo/fastapi-cli","fastapi/fastapi-cli"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastapi%2Ffastapi-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastapi%2Ffastapi-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastapi%2Ffastapi-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastapi%2Ffastapi-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fastapi","download_url":"https://codeload.github.com/fastapi/fastapi-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254076849,"owners_count":22010611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","fastapi","typer","uvicorn"],"created_at":"2024-08-13T07:04:05.276Z","updated_at":"2025-05-14T05:10:35.946Z","avatar_url":"https://github.com/fastapi.png","language":"Python","readme":"# FastAPI CLI\n\n\u003ca href=\"https://github.com/fastapi/fastapi-cli/actions/workflows/test.yml\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://github.com/fastapi/fastapi-cli/actions/workflows/test.yml/badge.svg\" alt=\"Test\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/fastapi/fastapi-cli/actions/workflows/publish.yml\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://github.com/fastapi/fastapi-cli/actions/workflows/publish.yml/badge.svg\" alt=\"Publish\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://coverage-badge.samuelcolvin.workers.dev/redirect/fastapi/fastapi-cli\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://coverage-badge.samuelcolvin.workers.dev/fastapi/fastapi-cli.svg\" alt=\"Coverage\"\u003e\n\u003ca href=\"https://pypi.org/project/fastapi-cli\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/v/fastapi-cli?color=%2334D058\u0026label=pypi%20package\" alt=\"Package version\"\u003e\n\u003c/a\u003e\n\n---\n\n**Source Code**: \u003ca href=\"https://github.com/fastapi/fastapi-cli\" target=\"_blank\"\u003ehttps://github.com/fastapi/fastapi-cli\u003c/a\u003e\n\n---\n\nRun and manage FastAPI apps from the command line with FastAPI CLI. 🚀\n\n## Description\n\n**FastAPI CLI** is a command line program `fastapi` that you can use to serve your FastAPI app, manage your FastAPI project, and more.\n\nWhen you install FastAPI (e.g. with `pip install \"fastapi[standard]\"`), it includes a package called `fastapi-cli`, this package provides the `fastapi` command in the terminal.\n\nTo run your FastAPI app for development, you can use the `fastapi dev` command:\n\n\u003cdiv class=\"termy\"\u003e\n\n```console\n$ fastapi dev main.py\n\n   FastAPI   Starting development server 🚀\n\n             Searching for package file structure from directories with __init__.py files\n             Importing from /home/user/code/awesomeapp\n\n    module   🐍 main.py\n\n      code   Importing the FastAPI app object from the module with the following code:\n\n             from main import app\n\n       app   Using import string: main:app\n\n    server   Server started at http://127.0.0.1:8000\n    server   Documentation at http://127.0.0.1:8000/docs\n\n       tip   Running in development mode, for production use: fastapi run\n\n             Logs:\n\n      INFO   Will watch for changes in these directories: ['/home/user/code/awesomeapp']\n      INFO   Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)\n      INFO   Started reloader process [4106097] using WatchFiles\n      INFO   Started server process [4106120]\n      INFO   Waiting for application startup.\n      INFO   Application startup complete.\n```\n\n\u003c/div\u003e\n\nThat command line program called `fastapi` is **FastAPI CLI**.\n\nFastAPI CLI takes the path to your Python program and automatically detects the variable with the FastAPI (commonly named `app`) and how to import it, and then serves it.\n\nFor production you would use `fastapi run` instead. 🚀\n\nInternally, **FastAPI CLI** uses \u003ca href=\"https://www.uvicorn.org\" class=\"external-link\" target=\"_blank\"\u003eUvicorn\u003c/a\u003e, a high-performance, production-ready, ASGI server. 😎\n\n## `fastapi dev`\n\nWhen you run `fastapi dev`, it will run on development mode.\n\nBy default, it will have **auto-reload** enabled, so it will automatically reload the server when you make changes to your code. This is resource intensive and could be less stable than without it, you should only use it for development.\n\nBy default it will listen on the IP address `127.0.0.1`, which is the IP for your machine to communicate with itself alone (`localhost`).\n\n## `fastapi run`\n\nWhen you run `fastapi run`, it will run on production mode by default.\n\nIt will have **auto-reload disabled** by default.\n\nIt will listen on the IP address `0.0.0.0`, which means all the available IP addresses, this way it will be publicly accessible to anyone that can communicate with the machine. This is how you would normally run it in production, for example, in a container.\n\nIn most cases you would (and should) have a \"termination proxy\" handling HTTPS for you on top, this will depend on how you deploy your application, your provider might do this for you, or you might need to set it up yourself. You can learn more about it in the \u003ca href=\"https://fastapi.tiangolo.com/deployment/\" class=\"external-link\" target=\"_blank\"\u003eFastAPI Deployment documentation\u003c/a\u003e.\n\n## License\n\nThis project is licensed under the terms of the MIT license.\n","funding_links":["https://github.com/sponsors/tiangolo"],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastapi%2Ffastapi-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffastapi%2Ffastapi-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastapi%2Ffastapi-cli/lists"}