/bin/sh -c and return stdout, stderr, and exit code.
Endpoint
Request
Headers
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
command | string | Yes | Shell command to execute |
timeout | integer | No | Command timeout in seconds (default: 30) |
working_dir | string | No | Working directory (default: /workspace) |
env | object | No | Environment variables for this command only |
Example Request
Run a simple command:Response
Success (200 OK)
Response Fields
| Field | Type | Description |
|---|---|---|
stdout | string | Standard output |
stderr | string | Standard error |
exit_code | integer | Exit code (0 = success) |
Status Codes
| Code | Description |
|---|---|
| 200 | Command completed |
| 400 | Invalid request (missing command) |
| 401 | Unauthorized |
| 408 | Command timeout |
| 500 | Command failed |
Errors
Command Failed (500)
stderr field for error details and verify the command.
Use Cases
Install Packages
Check System Information
File Operations
Git Operations
Build and Test
Pipeline Multiple Commands
Related
- SDK: sandbox.commands.run() - Python SDK method
- CLI Commands - Shell commands from CLI
Next Steps
- Run Command in Background - Run long-running commands
- Execute Code - Execute code directly
- File Operations - Read and write files

