How to run SikuliX from Command Line

SikuliX can be used on command line to run a Sikuli script or open the IDE.

The usage on each platform:

Windows

PATH-TO-SIKULIX/runsikulix.cmd [options]

Mac OS X

PATH-TO-SIKULIX/runsikulix [options]

Linux

PATH-TO-SIKULIX/runsikulix [options]

runsikulix(.cmd) without any options simply starts SikuliX IDE.

PATH-TO-SIKULIX is the folder containing the Sikuli stuff after having run setup.

Command Line Options (special)

PATH-TO-SIKULIX/runsikulix(.cmd)

-h,--help

print a help message showing the available options and exit

-i,--interactive

open an interactive Jython session that is prepared for the usage of the SikuliX features

Command Line Options (intention: IDE should open)

PATH-TO-SIKULIX/runsikulix(.cmd)

-c,--console

all output goes to stdout

Command Line Options (intention: run a script without opening the IDE)

PATH-TO-SIKULIX/runsikulix(.cmd)

-r,--run <sikuli-folder/file> (one or more entries seperated by space)

run one or more .sikuli or .skl files one after the other

<sikuli-folder/file> can be
  • a relative or absolute path with or without dotted parts (e.g. ../some-script)
  • a pointer to a location in the HTTP net (for details look here). The contained script file is downloaded and run, while the image files are downloaded when used in the script at runtime.

Having more than one script to run, the folder containing the script folder is remembered and applied to a following entry, that has a preceding ./ - example

sikulix.com:scripts/test1 ./test2 ./test2 will reuse the location sikulix.com:scripts/ for test2 and test3

Having more than one script specified: a return code of -1 will stop the complete execution.

Having more than one script specified: the next script can get the return code of the script run before using ScriptingSupport.getLastReturnCode()

Command Line Options (intention: run the experimental scriptrun server)

PATH-TO-SIKULIX/runsikulix(.cmd)

-s,--server [<port>] (optional port not yet supported, 50001 is used as default)

start a scriptrun server (`more information<http://www.sikulix.com/support.html>`_)

Command Line Options (intention: provide user parameters for running scripts)

PATH-TO-SIKULIX/runsikulix(.cmd)

-- <arguments>

the space delimited and optionally quoted arguments (only apostrophes are supported) are passed to Jython’s sys.argv and hence are available in your script. A parameter containing intermediate blanks MUST be quoted to get it into one sys.argv entry.

This option must go after all the other options mentioned above.