commands.run() method to run terminal commands inside the sandbox.
Basic usage
Callcommands.run() with a command string. The returned result contains the command output.
Read command output
Usestdout to read what the command printed.
Run in the background
Pass the background option to start a long-running process (such as a server) without blocking on it.Override environment variables per command
You can override or append environment variables for a single command with theenvs option. It applies only to that command.
Stream output
For long-running commands, passon_stdout / on_stderr (Python) or onStdout / onStderr (JavaScript) callbacks to receive output as it is produced, instead of waiting for the command to finish. The returned result still contains the final exit code.