Wait for Command
Command API
Wait for Command
Block until a background command completes and return its result.
GET
Wait for Command
Blocks until the background process identified by
pid completes, then returns the
full CommandResult. The process is removed from the tracked list after this call
returns.
If the PID is not found in the tracked process list, the endpoint returns a
CommandResult with exit_code: 1 and a "process not found" message in stderr.
Path Parameters
The sandbox identifier. Format:
sbx-<8 chars>.Process ID of the background command to wait for.Example:
42Response
Full standard output produced by the command.
Full standard error output. Contains
"process not found" if the PID is
not tracked.Exit code returned by the process.
0 indicates success. 1 when the
process was not found.Example
Response
Error Responses
| Status | Cause |
|---|---|
400 | pid path parameter is not a valid integer |
401 | Missing or invalid API key |
503 | Sandbox has no VM |
502 | envd daemon inside the VM is unreachable |