I think one could do this but it would be a detailed "recipe", which in the simplest case would use a batch file (no IDE) to compile, link, and load to an STLINK debugger, and using a specific ST dev board. But it would be a dead-end.
Or one could do a detailed "recipe" using Cube IDE, a frozen version (in my case 1.14.1) to do the same thing. I am actually doing this right now so others can continue with my project. This is better because for all its faults Cube IDE is a very capable tool and effectively conceals the huge complexity of any actually usable setup. Just doing an LED blinking example will get the user to rapidly get an LED to blink but then he hits a brick wall when he wants to implement some printf to output text (via SWV (which needs Cube IDE running), a UART, or whatever). Cube is ST copyright so ultimately it will not be possible to do this "quite legally" because older versions disappear from the ST website after a few months, but I am sure ST could not care less if somebody knocks up a website hosting say 1.14.1 Cube IDE installer (1GB). This way would enable someone to get going with a more complex functionality and for hardware they can do what almost everybody does: start with an ST dev board and use the schematics as the basis for the custom product. The other problem with this - far more useful - approach is that you cannot generate the code anywhere near wholly using MX, due to the number of bugs which need fixing to make stuff like USB VCP actually work properly. And nobody involved in a commercial product will want to give away the fixed source code. Look at the mess with the ETH - LWIP integration, with "piranha" on the ST forum posting snippets which I am sure work (within some specific code, which never gets posted) but which few people can use. Most people doing embedded for real and who have fixed code are doing it commercially.
The ST Cube MX + dev board approach gets people going quickly with blinking an LED, and then the ST forum fills up with 10000 people asking desperate questions about how to do the next thing... and nobody is helping them, because nobody can help somebody, at that level of competence.