Shell
Container-based command execution with filesystem access and artifact capture.
Create a shell session
curl -X POST https://api.browsr.dev/shell/sessions \
-H "x-api-key: $BROWSR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"language": "python",
"timeout_secs": 300
}'
| Parameter | Type | Description |
|---|---|---|
image | string | Container image |
language | string | Runtime language such as python or javascript |
timeout_secs | number | Session timeout |
image | string | Override the default container image |
Execute a command
curl -X POST https://api.browsr.dev/shell/exec \
-H "x-api-key: $BROWSR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"session_id": "shell-abc123",
"command": "ls -la /workspace",
"timeout_secs": 30
}'
{
"stdout": "total 8\ndrwxr-xr-x 2 root root 4096 ...",
"stderr": "",
"exit_code": 0,
"duration_ms": 45,
"timed_out": false
}
Streaming execution
curl -X POST https://api.browsr.dev/shell/exec/stream \
-H "x-api-key: $BROWSR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"session_id": "shell-abc123", "command": "pip install pandas && python script.py"}'
Filesystem operations
| Method | Endpoint | Description |
|---|---|---|
POST | /shell/fs/read | Read a file |
POST | /shell/fs/write | Write a file |
POST | /shell/fs/list | List directory |
POST | /shell/fs/tree | Directory tree |
POST | /shell/fs/search | Search files |
POST | /shell/fs/info | File info |
POST | /shell/fs/delete | Delete file/dir |
POST | /shell/fs/copy | Copy file/dir |
POST | /shell/fs/move | Move file/dir |
POST | /shell/fs/mkdir | Create directory |
Artifacts
Output mounts are automatically captured as artifacts after execution.
# List artifacts for a session
curl https://api.browsr.dev/shell/artifacts/by-session/shell-abc123 \
-H "x-api-key: $BROWSR_API_KEY"
# Download an artifact file
curl https://api.browsr.dev/shell/artifacts/ARTIFACT_ID/files/output.csv \
-H "x-api-key: $BROWSR_API_KEY"
List / delete sessions
# List
curl https://api.browsr.dev/shell/sessions \
-H "x-api-key: $BROWSR_API_KEY"
# Delete
curl -X DELETE https://api.browsr.dev/shell/sessions/shell-abc123 \
-H "x-api-key: $BROWSR_API_KEY"