Can a script be used?

I just did my first app, to cntrol ESP32 over bluetooth., Works nicely.
I wonder: is there a way to do the same block building by writing a script file, instead of dragging blocks graphically?
This way can be easier when the program gets larger, and also easier to maintain and store, for example in github, along with the ESP32 code, and the HW schematics…