To run the script from the command line without using Agisoft Metashape Professional GUI you need to use "-r" argument, like in the examples below (the path to the script should be either relative from the current dir or absolute, script arguments are optional):


On Windows:

metashape.exe -r <script.py> [script arguments]


On Linux:

./metashape.sh -r <script.py> [script arguments]


On macOS:

/MetashapePro.app/Contents/MacOS/MetashapePro -r <script.py> [script arguments]


If the script is run on the non-GUI system, it may be necessary to use "-platform offscreen" additional argument, for example on Linux:

./metashape.sh -r <script.py> -platform offscreen