sandbox exec command runs a single command inside an already-running sandbox and streams its output back to your terminal. Use it for one-off commands, scripts, and automation; for an interactive shell session, use the remote shell (connect) command instead.
Prerequisites
Set theNOVITA_API_KEY environment variable before running the command. You also need the ID of a running sandbox.
Usage
CLI
ex. Everything after the sandbox ID is treated as the command to execute.
CLI
Arguments
Options
Foreground execution
By default, the command runs in the foreground. Itsstdout and stderr stream to your terminal in real time, and the CLI exits with the same exit code as the remote command.
CLI
Background execution
Pass-b / --background to start the command and return immediately without waiting for it to finish. The CLI prints the process ID and exits with code 0.
CLI
Piping stdin
You can pipe data into the command through standard input; the CLI streams it to the remote process and signals end-of-file when the input is exhausted, so tools likecat, wc, and grep terminate correctly.
CLI
Exit codes and interruption
- In the foreground, the CLI exits with the remote commandβs exit code, so it composes naturally with shell scripts and CI.
- If the command cannot be started or another error occurs, the CLI prints the error and exits with code
1. - Pressing
Ctrl+C(or sending a termination signal) kills the remote process before the CLI exits.