porter sandbox contains commands for interacting with sandboxes on a Porter cluster.
Prerequisites
- You’ve logged in to the Porter CLI after running porter auth login
- You’re connected to the correct project by running porter config set-project
- You’re connected to the correct cluster by running porter config set-cluster
porter sandbox exec
Runs a single non-interactive command inside a sandbox and prints its stdout and stderr. Use this for scripting, CI/CD steps, and automated agents that need to run a command in a running sandbox and act on the result.
Usage:
There are two ways to pass a command:
- Positional, after
--— argv is sent verbatim with no shell involved. Use this when you want predictable argument handling. -c/--command "<string>"— the string is wrapped insh -cinside the sandbox, so shell features like pipes,&&, redirects, and globs work.
Exit codes
porter sandbox exec propagates the sandbox process’s exit code so CI/CD pipelines and agents can branch on the result:
Interactive (
-i) and TTY (-t) flags are reserved for a future release. Passing them today exits with code 2 and a “not yet supported” message.
