Skip to main content
POST
/
context
/
runtime
/
execute
Execute in runtime sandbox
curl --request POST \
  --url https://api.getcargo.io/v1/context/runtime/execute \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "command": "<string>",
  "args": [
    "<string>"
  ],
  "commitMessage": "<string>"
}
'
{
  "exitCode": 123,
  "stdout": "<string>",
  "stderr": "<string>",
  "commit": {
    "sha": "<string>",
    "message": "<string>"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.getcargo.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Run a shell command in the workspace runtime sandbox. Tracked working-tree changes are auto-committed and pushed to the workspace's default branch; gitignored paths are skipped.

command
string
required

Shell command to run inside the runtime sandbox.

Minimum string length: 1
args
string[]

Optional arguments passed to the command.

commitMessage
string

Optional override for the auto-commit message. When the command leaves uncommitted changes (additions, edits, deletions, renames) in the working tree, those changes are always pushed to the workspace repo's default branch as a single commit; this field only customizes the commit subject. Defaults to context(runtime): execute <command>.

Minimum string length: 1

Response

Successful response

exitCode
number
required
stdout
string
required
stderr
string
required
commit
Commit · object

Present iff the command left the working tree dirty AND the resulting auto-push landed on the default branch. Absent when the command produced no tracked changes or when the push didn't land — the server logs capture the reason in the latter case.