How to convert an Unreal Engine 5 Blueprint-only project to a C++ project using command line and compile it?

I mean I want to convert the blueprint-only project into a C++ project. In the editor, I can do this by adding a new C++ class using the toolbar, but now I want to achieve this via the command line instead of opening the editor. And then compile the project using command line after this.