When you start V-REP via the command line, you have following command line options that are supported:
-h: runs V-REP in headless mode (i.e. without any GUI)
-sXXX: automatically start the simulation. XXX represents an optional simulation time in milliseconds after which simulation should stop again.
-q: automatically quits V-REP after the first simulation run ended.
-gXXX: XXX represents an optional argument that can be queried within V-REP with the sim_stringparam_app_arg parameter. The argument can be used for various custom purposes. The argument can also be used to request a continuous remote API server service to be started at V-REP start-up. For that to happen, use following formatting:
PORT is the port number
DEBUG is the debug mode (set to TRUE or FALSE)
PREENABLESYNC allows to preenable the synchronous mode (set to TRUE or FALSE)
-aXXX: loads and runs an additional add-on script specified via its filename (XXX). The add-on will be loaded and run only for the first scene.
-bXXX: loads and runs an additional add-on script specified via its filename (XXX). The add-on will be loaded and run for all the scenes that will be opened.
XXX.ttt: loads a V-REP scene.
XXX.ttm: loads a V-REP model.
XXX.ttb: loads a V-REP custom UI file.
For example, to start V-REP in headless mode, load the scene myScene.ttt, run the simulation for 5 seconds, then stop the simulation and automatically leave V-REP again, type from within the V-REP main folder:
Windows: vrep.exe -h -s5000 -q myScene.ttt
Mac: ./vrep.app/Contents/MacOS/vrep -h -s5000 -q ../../../myScene.ttt
Linux: ./vrep.sh -h -s5000 -q myScene.ttt