Computers

Run one command in a computer

Changed on

Give exactly one of command (run by /bin/sh -c) and argv. Output is text with stdout and stderr merged. With stream true (the default) the response is newline-delimited JSON events: start, output, keepalive, exit. With stream false the output is collected into one JSON result, cut at 8 MiB and marked truncated. timeoutSeconds bounds the run time (at most 3600) and is reported as timedOut with exit code -1. The command is killed when the client disconnects; start long-lived processes with setsid nohup.

post/v1/computers/{id}/exec

Request

  • Base URL
    https://api.steel.dev
  • URL
    https://api.steel.dev/v1/computers/{id}/exec
  • Auth
    • API key in header steel-api-key
    • or none

Path parameters

idstring required

Headers

steel-project-idstring

The project the computer belongs to. Required for an organization-scoped key, which binds to no project; ignored for a project-scoped key, which stays pinned to its own, and for an attach token, which carries the project of the computer it was minted for.

Request body

OR

Response

The command ran. The content type follows the stream flag.

exitCodeinteger required
outputstring required
timedOutboolean required
truncatedboolean required

Changes