For anything heavy or slow, do not script it at all: bake it into a template sandbox so it is already installed when the sandbox starts.
Repository setup scripts
Attached to a repository in Dashboard > Environment. Runs once when the sandbox starts, inside that repository’s folder, with your environment’s variables and secret files already in place.Talking back to the sandbox
Setup scripts can steer the agent running in the Sandbox:
That turns a failing step into an instruction rather than a dead end:
Per-Sandbox setup file
When the work differs from Boat to Boat, pass a local script at create time. Up to 64KB, UTF-8.ready. Watch it with boat info:
Driving setup from your code
Configure secrets in the environment first, then run whatever you need. The script reads normal environment variables and the secret files at their configured paths, so nothing sensitive passes through the command line.ready first; earlier calls are refused with a retryable boat_starting. Synchronous commands cap at 600 seconds, so anything longer should detach and be polled. See Long-Running Tasks.
To pipe a script that is not on the sandbox yet, use SSH instead. It streams stdin, stdout and stderr, so nothing has to be copied to a temporary path first:
On Windows, run this from Node, Python, WSL, Git Bash, or
cmd.exe. Native PowerShell pipelines can keep stdin open for native executables, which hangs the command.