Execution
boxlite.Execution
Represents a running command execution. Returned by box.exec().
Methods
Example
Streaming Output
You can stream stdout and stderr independently for real-time output processing.Streaming with stderr
Interactive Input
Killing a Process
TTY Resizing
For executions started withtty=True, you can dynamically resize the terminal.
ExecStdout / ExecStderr
boxlite.ExecStdout / boxlite.ExecStderr
Async iterators for streaming output line by line.
ExecStdin
boxlite.ExecStdin
Writer for sending input to a running process.
Methods
Example
ExecResult
boxlite.ExecResult
Result of a completed execution.
The low-level
Execution.wait() returns an ExecResult with exit_code only. The higher-level SimpleBox.exec() populates all four fields including stdout, stderr, and error_message.Example
Common Patterns
Run and Capture Output
The simplest pattern for running a command and capturing its output.Stream Large Output
For commands that produce large amounts of output, use streaming to avoid memory issues.Pipeline Pattern
Run multiple commands in sequence, passing output between them.Environment Variables per Execution
Pass environment variables to specific command executions.Timeout with Kill
Implement a timeout for long-running commands.See Also
- Python SDK Overview - Runtime management, BoxOptions
- Box Types - SimpleBox, CodeBox, and other box types
- Errors & Metrics - Exception handling for execution errors

