Run a shell command
Runs cmd inside the sandbox via a shell, so pipes, &&, redirects, and installed CLI tools all work. Sandbox must be in status ready.
Pass stream: true to receive stdout / stderr as they arrive. The response then uses Content-Type: text/event-stream with one JSON object per data: line; the final event is { "type": "done", ... }. See ExecStreamFrame for the event shape.
Path parameters
24-char hex id of the sandbox.
Request body
Example request
{
"env": {
"NODE_ENV": "production",
"DATABASE_URL": "postgres://..."
}
}Response
Command completed.
When the request body has stream: true, the response is text/event-stream, one ExecStreamFrame per data: event, the last being a done event.
Example response
{
"message": "Exec completed"
}Changes
Changed in 2 of the 5 revisions of this API.12
- ▲
removed the media type
application/x-ndjsonfor the response with the status200response-media-type-removed
- ○
added the media type
text/event-streamfor the response with the status200response-media-type-added
- ▲
- ○
added the new optional request property
envnew-optional-request-property
This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○