Skip to main content
POST
Execute bash
On Linux, runs Bash and returns combined stdout and stderr. Linux commands run with 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

string
required
Computer ID (UUID).

Query parameters

string
Which screen to run the command on. Optional. Omit it, or send 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.
For a screen other than 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

string
required
A non-empty command string. Bash on Linux; PowerShell on Windows.
integer
default:"200"
How long the command may run, in seconds. Optional, and clamped to 1-300 when you send it: a larger value silently becomes 300, and 0 or a non-numeric value becomes 10. Omitting it entirely allows the command 200 seconds.
Omitting 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

boolean
true whenever the command ran at all, regardless of what it exited with. Read exit_code to find out whether the command itself succeeded.
string
Always bash.
string
Echo of the command you sent. With ?screen=, the DISPLAY prefix Orgo adds is left out.
string
Combined stdout and stderr, in that order, joined by a newline when both are non-empty.
integer
The command’s exit status, or -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.
string | null
Always null on a 200. A command that fails is reported through exit_code and output, not here.
string | null
Always null on a 200.

Example

Response

For Python code execution, use Execute Python instead.

Errors

A command that merely exits non-zero is not an error status: it is a 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

Authorization
string
header
required

API key authentication. Get your key at orgo.ai/workspaces

Path Parameters

id
string
required

Computer ID

Query Parameters

screen
string

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

application/json
command
string
required

Bash command to execute

timeout
integer
default:200

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".

Required range: 1 <= x <= 300

Response

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.

success
boolean

true whenever the command ran at all, regardless of its exit status. Read exit_code.

action
enum<string>
Available options:
bash
command
string

Echo of the command you sent. With ?screen=, the DISPLAY prefix Orgo adds is left out.

output
string

Combined stdout and stderr, joined by a newline when both are non-empty.

exit_code
integer

The command's exit status, or -1 when it was killed by a signal, including by the timeout.

error
null

Always null on a 200.

error_type
null

Always null on a 200.