API
Run a shell command
A shell command resolves when the command finishes and gives you back the result and status.Run a code snippet
You can execute code inside of a box:Check exit status
If the command fails, the run status will be"failed" and its result contains the stderr output.
Chain commands
Pass a full shell expression. Pipes, redirects, and chained commands all work as expected.Cancel a long-running command
You can cancel a run to abort it. The status becomes"cancelled".
Retrieve logs
After a command finishes, calllogs() to get the full timestamped output for debugging or auditing.
Examples
Install dependencies before a run
Set up the environment withbox.exec.command(), then hand off to the agent.