run_command
Execute shell commands in an isolated Linux sandbox and capture stdout, stderr, and exit code. Use it to run code, install packages, clone repositories, or inspect the filesystem.
Instructions
Run a shell command inside a sandbox and wait for it to finish. Returns stdout, stderr and the exit code. The command runs as an unprivileged user in /workspace. A non-zero exit code is returned normally, not as an error. Use this to execute code, install packages, clone repositories or inspect the filesystem.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory. Default /workspace. | |
| env | No | Environment variables for this command. They are exported, so they survive chaining with && or ;. | |
| command | Yes | Shell command, e.g. `python3 script.py` or `pip install requests`. | |
| sandbox_id | Yes | The id returned by create_sandbox. | |
| timeout_ms | No | How long to wait before killing the command (default 60000, max 600000). |