Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

A. Command-Line Reference

airsl run    [OPTIONS] <script.lua> [args…]
airsl test   [OPTIONS] [<path>]
airsl check  [<path>]
airsl doctor [--policy <preset>] [GRANTS]
airsl lua setup  [--native [--lua 5.4|luajit]] [<DIR>]
airsl ext doctor <DIR>         [GRANTS] [LIMITS] [--event NAME] [--var NAME=VALUE]
airsl ext fire   <DIR> <EVENT> [GRANTS] [LIMITS] [--event NAME] [--var NAME=VALUE]

Commands

CommandDoes
runruns one script; everything after the script's path goes to arg
testruns every *_test.lua and test_*.lua under a folder; finding none is a failure
checkcompiles every .lua under a folder without running any; finding none is a failure
lua setupwrites a description of the built-in modules into a project and adds it to the language server's settings file, so your editor completes airsstack calls; see Editor Support. --native also installs the native module with LuaRocks, for running scripts in stock Lua; see Running Scripts in Stock Lua
doctorprints the policy a script would get from the preset and grant flags you give it
ext doctorprints what a host would grant, reduce and deny for an extension, without running it
ext fireloads an extension and fires one event; payload on stdin, result on stdout as JSON

Options for run, test and doctor

doctor takes --policy and the --allow-… flags. It takes no --memory-limit or --instruction-limit, and no --fail-open: it shows the preset's own limits.

OptionDoes
--policy <trusted|confined|pure>picks the preset; the default is confined
--allow-read DIRgrants reading under DIR; repeatable
--allow-write DIRgrants writing under DIR; repeatable; does not grant reading
--allow-env NAMEgrants reading and setting NAME; repeatable
--allow-exec PROGRAMgrants running PROGRAM, matched on the name as written; repeatable
--allow-access NAMEhost access the sandbox may use; repeatable. Only pure starts without them
--memory-limit <BYTES|none>replaces the preset's memory limit
--instruction-limit <COUNT|none>replaces the preset's instruction limit
--fail-openrun only: swallows any failure and exits 0

Under --policy trusted, the --allow-… flags are ignored, because nothing is restricted. Under --policy confined, --allow-access changes nothing, because confined already holds every kind of host access. Under --policy pure, it is the only way to give a script any.

The names are stdin, stdout, stderr, clock, cwd, require and zones. An unknown name is refused with that list, and the exit status is 2. Naming the same access twice is accepted and grants it once.

Options for ext doctor and ext fire

These take the same --allow-…, --memory-limit and --instruction-limit flags, which widen the host's ceiling. The ceiling always starts from confined. There is no --policy, because trusted cannot serve as a ceiling.

--allow-access is accepted here too, but it cannot change the ceiling: confined already holds every kind of host access.

OptionDoes
--event NAMEdeclares an event the host fires, beyond the one being fired; repeatable
--var NAME=VALUEsupplies a value for $NAME in the manifest; repeatable

Exit codes

Command01
runthe script finishedthe script failed or hit a limit; with --fail-open, always 0
testevery test passeda test failed, or no test files were found
checkevery file compileda file failed to compile, or no .lua files were found
lua setupboth files are set up or already wereany error, including a LuaRocks failure with --native; nothing is written when a check fails, and an install that fails leaves the type file and the settings entry written
ext doctorany decision, including denythe manifest or the ceiling is invalid
ext firethe event was fired and a result (or null) printedany error

Environment variables

VariableDoes
AIRSL_DEBUG=1prints errors that --fail-open would hide
AIRSL_CLI_NO_MODIFY_PATH=1read by the installer: leave PATH alone

A script that hits a memory or instruction limit is always reported on standard error, even under --fail-open.