Skip to main content
The exec command runs a single command inside a running sandbox and streams its output back to the terminal. It fits one-off commands, scripts and automation. For an interactive shell session, use the remote shell command, connect.
Install the CLI and set the PPIO_API_KEY and PPIO_DOMAIN environment variables before running these commands. See Install and authenticate.

Usage

The command has the alias ex. Everything after the sandbox ID is treated as the command to execute.

Arguments

string
required
ID of the running sandbox to run the command in.
string
required
The command to execute. Multiple parts are quoted and joined into a single shell command.

Options

boolean
Runs the command in the background and returns immediately, after printing the process ID.
string
Working directory to run the command in.
string
Runs the command as the specified user.
string
Sets an environment variable for the command, in KEY=VALUE form. Repeat the option to set several variables.

Foreground execution

By default, the command runs in the foreground. Its standard output and standard error stream to the terminal in real time.

Background execution

Pass --background to start the command and return immediately without waiting for it to finish. The CLI prints the process ID and returns.

Pipe data into a command

Data piped into the command goes through standard input. The CLI streams it to the remote process and signals end-of-file when the input is exhausted, so tools such as cat, wc and grep terminate correctly.
Piped stdin requires a recent sandbox version. If the sandbox does not support it, the CLI prints a warning and ignores the piped input. Rebuild the template to pick up the latest sandbox version.

Interrupt a command

Pressing Ctrl+C, or sending a termination signal, kills the remote process before the CLI exits.
Last modified on November 19, 2026