Execute bash
Run a bash command on the computer and get its output.
HOME=/root, DISPLAY=:99, and PATH=/usr/local/bin:/usr/bin:/bin. :99 is the boot screen. To run on another screen, pass ?screen=, described in Query parameters.
On Windows, this endpoint runs PowerShell, despite its name. Use PowerShell syntax. The command runs from the user’s Desktop folder and honors timeout the same way. The response carries stdout, stderr, exit_code, and output (stdout followed directly by stderr) instead of the fields listed under Response, plus error when the command could not run. A command that runs out of time returns 200 with exit_code: 124, error: "timeout", and the output captured so far.
Path parameters
Query parameters
default, to run on the screen the computer booted with. For
any other screen, the command runs with DISPLAY set to that screen’s
display, so a window it opens appears on that screen. An unknown id returns
404 and nothing runs. Only a Linux computer has more than one screen: on any
other computer, every id except default returns 404.default, Orgo first checks that the screen exists,
then prefixes your command with export DISPLAY=:N; for that screen’s display:
:100 for screen-100. The rest of the command runs exactly as you sent it,
and the command echoed in the response is yours, without the prefix. The body
is checked before the screen, so an invalid command returns 400 even when
the screen does not exist.Body parameters
0 or a non-numeric
value becomes 10. Omitting it entirely allows the command 200 seconds.timeout allows 200 seconds. The API proxy waits 30 seconds longer than the command timeout. Send an explicit timeout up to 300 seconds for a longer command. This is synchronous execution; it does not return a background job ID.Response
true whenever the command ran at all, regardless of what it exited with.
Read exit_code to find out whether the command itself succeeded.bash.?screen=, the DISPLAY prefix Orgo adds
is left out.-1 when it was killed by a signal. A command
killed by timeout returns -1. There is no separate timeout flag: a -1
with truncated output is the only signal that the time ran out.null on a 200. A command that fails is reported through exit_code
and output, not here.null on a 200.Example
Response
Errors
200
with a non-zero exit_code. Every failure raised after the request leaves the
API layer carries a request_id. Quote it in support requests. When the
computer agent itself answered non-2xx, the body additionally carries
upstream_status.
Authorizations
API key authentication. Get your key at orgo.ai/workspaces
Path Parameters
Computer ID
Query Parameters
Which screen to run the command on. Omit it, or send default, for the boot screen. For any other screen the command runs with DISPLAY set to that screen's display. An unknown id returns 404 and nothing runs. Only Linux computers have more than one screen; on any other computer every id but default returns 404.
Body
Bash command to execute
How long the command may run, in seconds, on Linux and Windows alike. Omitted, 200. When sent it is clamped to 1-300: a larger value becomes 300, and 0 or a non-numeric value becomes 10. A Windows command that runs out of time returns 200 with exit_code 124 and error "timeout".
1 <= x <= 300Response
The command ran. A non-zero exit is still a 200; read exit_code. On Windows the body carries stdout, stderr, exit_code, and output instead, and a command that ran out of time is also a 200.
true whenever the command ran at all, regardless of its exit status. Read exit_code.
bash Echo of the command you sent. With ?screen=, the DISPLAY prefix Orgo adds is left out.
Combined stdout and stderr, joined by a newline when both are non-empty.
The command's exit status, or -1 when it was killed by a signal, including by the timeout.
Always null on a 200.
Always null on a 200.