Short answer: the sandscale CLI is built to be scripted. sandscale sandbox exec and sandscale sandbox run exit with the remote command's own exit code, so make , set -e and && chains work as if the command ran locally. For everything else, a fixed set of exit codes tells your script what kind of failure it hit, and --json gives machine-readable output. For CI and servers, use a personal API key with the SDK or the API rather than a CLI sign-in; Sandscale's authentication docs recommend that.
All commands and codes here are from the live CLI reference , which is generated from the CLI itself.
The exit codes
From the sandscale sandbox reference :
Code Meaning
0 Done (for exec and run : the command's own code)
1 Failed
2 Usage error
3 No session (run sandscale login )
4 Refused
5 Not found
6 Conflict
7 Rate limited
One thing to watch: for exec and run , the remote command's exit code passes through, so a test runner that exits 1 and a CLI failure that exits 1 look the same to your script.…