CLI Usage

All invocation forms, flags, and exit codes — one page.

Invocation Forms

All Sandy flags must come before -x. Everything after -x <exe> is forwarded to the child as-is.

# Run from a TOML file
sandy.exe -c <config.toml> [-l <log>] [-L] [-q] -x <exe> [args...]

# Run from an inline TOML string
sandy.exe -s "<toml>"       [-l <log>] [-L] [-q] -x <exe> [args...]

# Run from a saved profile
sandy.exe -p <profile>      [-l <log>] [-q]       -x <exe> [args...]
💡 Config sources are mutually exclusive

-c, -s, and -p cannot be combined. If more than one is present, Sandy exits with code 128.

Working Directory

workdir is either set explicitly in config as an absolute directory path or inherited from Sandy's own current working directory. The target executable path does not change the default working directory.

Command-line Flags

Short and long forms are synonymous.

FlagDescription
Config input
-c <path>, --configPath to TOML config file
-s <toml>, --stringInline TOML config string — alternative to -c
-p <name>, --profileRun with a persistent saved profile — mutually exclusive with -c / -s
Execution
-x <path>, --execExecutable to run sandboxed — consumes all remaining arguments and forwards them to the child
Logging & output
-l <path>, --logSession log — captures operational events, config, and exit code
-L, --log-stampPrepend YYYYMMDD_HHMMSS_uid_ to log filenames to prevent collisions on repeated runs
-q, --quietSuppress the config banner printed to stderr on launch
Profiles
--create-profile <name>Create a persistent sandbox profile — saves SID, ACLs, and config derived from -c
--delete-profile <name>Delete a saved profile and revoke its persistent ACLs
--profile-info <name>Print profile details: type, SID, config, and grants
Inspection & tooling
--dry-run, --checkValidate config and show planned ACL changes — no system modifications made
--print-configPrint resolved config to stdout with all defaults filled in — requires -c or -s
--print-container-tomlPrint the default AppContainer TOML template to stdout
--print-restricted-tomlPrint the default Restricted Token TOML template to stdout
--status [--json]Show instances, retry containers, cleanup tasks, saved profiles, and summary counts — optionally as JSON
--cleanupRestore stale state left by a crashed run — removes orphaned ACLs, loopback exemptions, scheduled tasks, and transient AppContainer profiles
--explain <code>Decode a numeric exit code — distinguishes Sandy codes (125–131), NTSTATUS, and Win32 error codes
Info
-v, --versionPrint version and exit
-h, --helpPrint full help text with config reference

Exit Codes

Sandy follows the POSIX high-code convention used by bash, env, timeout, and git bisect. Child exit codes 0–124 pass through unchanged with zero ambiguity.

CodeOriginMeaning
0Child / SandySuccess — child exited cleanly, or info command succeeded
1–124ChildChild's own exit code, passed through unchanged
125SandyInternal / general error
126SandyCannot execute — CreateProcess failed (permission denied, bad format)
127SandyCommand not found — executable does not exist on disk
128SandyConfiguration error — invalid TOML, wrong-mode key, config file not found
129SandySandbox setup failed — token / SID creation, ACL grants, or stdin setup
130SandyTimeout — child killed by Sandy's watchdog
131SandyChild crashed — NTSTATUS crash code detected (e.g. 0xC0000005 access violation)
💡 Automation tip

In scripts, check exit code >= 125 to detect Sandy-level failures. Codes 130 and 131 mean the child ran but terminated abnormally — use sandy.exe --explain <code> to decode any code, including raw NTSTATUS and Win32 error values.