Skip to content
Dashboard

Execute command (streaming)

POST/computers/{id}/exec

Execute a shell command with real-time streaming output as NDJSON. Each line is a JSON object with type (stdout/stderr/exit/error).

Path ParametersExpand Collapse
id: string
Body ParametersJSONExpand Collapse
command: optional string
cwd: optional string
env: optional map[string]
timeout_seconds: optional number
ReturnsExpand Collapse
code: optional number

for exit

data: optional string

for stdout/stderr

message: optional string

for error

type: optional string

"stdout", "stderr", "exit", "error"

Execute command (streaming)

curl https://api.tzafon.ai/computers/$ID/exec \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $TZAFON_API_KEY" \
    -d '{}'
Returns Examples