Commands and terminals

Run command

Runs a shell command and returns its output and exit code. Commands that outlast timeout_seconds are stopped and return timed_out: true. Use a terminal session for interactive or long-running work. The replica must be active.

post/v1/replica/{id}/exec

Request

  • Base URL
    https://api.replicas.dev
  • URL
    https://api.replicas.dev/v1/replica/{id}/exec
  • Auth
    HTTP bearer

Path parameters

idstring uuid required

Replica ID

Headers

X-Replicas-Api-Version'2026-10-07'

API version. 2026-10-07 returns snake_case responses. See versioning.

Request body

commandstring required

Shell command, run in the workspace root

timeout_secondsinteger

Response

Success

outputstring required

Combined stdout and stderr, last 64 KB

exit_codeinteger nullable required

null when the command timed out

timed_outboolean required
truncatedboolean required

Changes

No recorded changes to this operation across all 1 revision of this API.