Scripts can be used to create command line tools that leverage QCAD functionality. Such a script might for example generate a drawing based on parameters, convert a drawing or analyse a drawing.
The basic structure of a command line tool script can look for example as shown below. This is also a fully functional example script that can be used as command line tool to add a line from 0,0 to 100,100 to a given drawing and export that drawing under a new file name:
If the script is run as part of a web service, be sure to also pass the switches -no-gui and -allow-multiple-instances to tell QCAD that no GUI is available and multiple instances can be run in parallel: