---
title: "Execute in runtime sandbox"
method: POST
path: "/context/runtime/execute"
tags: ["Context - Runtime"]
---

# Execute in runtime sandbox

`POST /context/runtime/execute`

Run a shell command in the workspace runtime sandbox. Tracked working-tree changes the command produced (additions, edits, deletions, renames) are auto-committed and pushed to the workspace's default branch as a single commit. Pass `commitMessage` to customize the commit subject; gitignored paths are skipped. The response's `commit` field is present iff a commit landed.

## Request body

- object — 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.
  - `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>`.

## Response `200`

Successful response

- object
  - `exitCode` number, required
  - `stdout` string, required
  - `stderr` string, required
  - `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.
    - `sha` string, required
    - `message` string, required

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — Not found
- `500` — Internal server error

---

[API](https://skmtc.net/getcargo/apis/cargo-api.md) · [All operations](https://skmtc.net/getcargo/apis/cargo-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getcargo/cargo-api/revisions/1d5a19e01d83/schema)
