Skip to content

Running Nyx Scripts

Execute Nyx scripts (files ending with .nyx) from your command line:

Terminal window
nyx path/to/your_script.nyx

Pass arguments to your script after the script name. They are available in Nyx as a global list of strings named SCRIPT_ARGS.

Terminal window
nyx your_script.nyx arg1 "hello world" 123

Inside your_script.nyx:

my_script.nyx
output("First script arg: #{SCRIPT_ARGS[0]}");
output("Number of args: #{len(SCRIPT_ARGS)}");

The output:

// SCRIPT_ARGS is ["arg1", "hello world", "123"]