The command line

The scriptcs command line takes the general form

scriptcs.exe -option1 value1 -option2 value2 -option3 value3

For a list of available options, type scriptcs -help.

The exceptions to the above rule are:

  • -ScriptName (-script): This is positional and must be first in the list of options (that is, if you want to run a script). This has the benefit that the name of the script can be specified by itself, e.g.

    scriptcs foo.csx.

  • -Install (-i): As well as accepting a single parameter, a package name, this option can also take two parameters, a package name and a version, e.g.

    scriptcs -Install ScriptCs.Adder 0.1.1

    which is shorthand for

    scriptcs -Install ScriptCs.Adder -PackageVersion 0.1.1.

  • All true/false switches: these can be specified without a parameter, e.g.

    scriptcs -Debug

    which is shorthand for

    scriptcs -Debug true

    If a true/false switch is not present, this is the same as passing false for the switch.

Examples

# running a script
scriptcs -script main.csx   # long form
scriptcs main.csx           # short form
# package installation
scriptcs -i           # installs all packages listed in scriptcs_packages.config
scriptcs -i Foo       # installs a package named Foo
scriptcs -i Foo 0.1.1 # installs version 0.1.1 of a package named Foo