Run Command
- POST
- /workspaces
- /:workspace
- /sandboxes
- /:sandbox_id
- /commands
Execute a command in a sandbox
Request example
curl -X POST "https://api.buddy.works/workspaces/:workspace/sandboxes/:sandbox_id/commands" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"command": "npm test",
"runtime": "BASH"
}'Response examples
command
EXAMPLE RESPONSE{ "url": "https://api.buddy.works/workspaces/my-workspace/sandboxes/sb-12345/commands/cmd-abc123def456", "html_url": null, "id": "cmd-abc123def456", "command": "npm test", "runtime": "BASH", "status": "SUCCESSFUL", "exit_code": 0, "logs_url": "https://api.buddy.works/workspaces/my-workspace/sandboxes/sb-12345/commands/cmd-abc123def456/logs" }
STATUS200 OK
fast
EXAMPLE RESPONSE{ "command": "npm test", "runtime": "BASH", "exit_code": 0, "stdout": "All tests passed\n", "stderr": "" }
STATUS200 OK