tiangolo / fastapi

FastAPI framework, high performance, easy to learn, fast to code, ready for production
https://fastapi.tiangolo.com/
MIT License
73.34k stars 6.18k forks source link

✨ Add FastAPI CLI, the new `fastapi` command #11522

Closed tiangolo closed 2 months ago

tiangolo commented 2 months ago

✨ Add FastAPI CLI, the new fastapi command

tiangolo commented 2 months ago

📝 Docs preview for commit c98c1513ec5cde506380890182f536ce544dcd15 at: https://a98e0cab.fastapitiangolo.pages.dev

rafalkrupinski commented 2 months ago

So now my servers will depend on some CLI packages? 🤔

Olegt0rr commented 2 months ago

Thanks for this great feature.

It also would be nice to support module's __main__.py as well as main.py

zoola969 commented 2 months ago

Why do we need it for production? Could you make it optional dependency?

JuanPerdomo00 commented 2 months ago

Thanks for this functionality, it really is great. fastapi fan. @tiangolo 🏆

metakot commented 2 months ago

Really, why, of all the things...

parfeniukink commented 1 month ago

So now my servers will depend on some CLI packages? 🤔

I think you still available to run pip install fastapi --no-deps if this is an issue for you. Probably, it depends on the package manager that you use, but anyway, I guess that piptools, poetry or pipenv allow you to achieve that, aren't they?

rafalkrupinski commented 1 month ago

@parfeniukink poetry doesn't, besides, I don't want to manage dependencies myself.

I'm migrating over to Litestar, it has more than one maintainer.

parfeniukink commented 1 month ago

@parfeniukink poetry doesn't, besides, I don't want to manage dependencies myself.

I'm migrating over to Litestar, it has more than one maintainer.

Good choice I guess :) I've heart that it is quite stable.

rafalkrupinski commented 1 month ago

Good choice I guess :) I've heart that it is quite stable.

We'll see ;)

limosin commented 3 days ago

@tiangolo I understand fastapi cli is running uvicorn under the hood. How can I modify the uvicorn configurations like --loop type and --http?

Jaza commented 2 days ago

@tiangolo a few comments:

However:

Personally I think it's a decent feature (and, on par with FastAPI's high standards, it appears to be thoroughly tested and clearly documented). It will probably help out FastAPI newcomers the most, with a friendlier getting-started experience. I don't need it urgently, not sure if I'll use it, I might give it a try. Anyway, what the feature is that you built, isn't the point here.

In future, could you at least leave a PR (for a non-critical new feature) open for a reasonable time, before merging it? I would suggest one week, to give people some time to review and comment.

And ideally, could you advise the community in advance, in a separate issue thread, and/or in the roadmap, of features that you plan to work on?

I'm not suggesting a radical overhaul of how the project is managed. I just think that a little bit more transparency, and a little bit more engagement, are not unreasonable expectations of the community, for a project that thousands of people now rely on. And I don't want to see people abandon FastAPI on account of these concerns (as some of the comments in this PR have suggested, and as I've seen suggested in a number of discussions elsewhere), I think it's a great project, and I'm saying all this in the hope that it helps rather than harms the project's future.