Headless

Google for “ROOT batch mode”.
Try:
root -?
man root
See also [url]Compile and run from command prompt and [url]Compile a macro without running?