Harthelm Docs
REST APIWorkspaces

Run a command in the IDE pod

`bash -c <command>` in `/data/app` in the IDE pod with the workspace env vars and the caller's Git identity (`GIT_AUTHOR_*`, `GIT_COMMITTER_*`, as in a terminal: the name, and the email only when the identity provider verified it; an env var of the same name wins); `hart exec` uses it. 5 s unless `timeout_seconds` asks for up to 300 (since 0.8.1), and 1 MiB of output per stream; on timeout the process group is killed and `timed_out` is set. Needs `workspace.exec`; 409 when the IDE does not run, or when its agent predates 0.8.1 and allows at most 5 s (a restart of the workspace updates it).

Generated from openapi/harthelm.yaml at v1.5.0
POST
/workspaces/{ws}/exec

Authorization

cookie__Host-harthelm_session<token>

Browser session of the UI (12 h idle, 7 days absolute). State-changing requests also need the header Harthelm-CSRF: 1 and a matching Origin.

Path Parameters

ws*integer

Numeric resource id.

Formatint64
Range1 <= value

Request Body

application/json
  1. body
command*string

Run with bash -c in /data/app.

Length1 <= length <= 8192
timeout_seconds?integer
Range1 <= value <= 300
Default5

Response Body

The command ended (whatever its exit code).

application/json
  1. response
exit_code*integer

-1 when the process was killed.

stdout*string

UTF-8; invalid bytes are replaced.

stderr*string
truncated*boolean

An output stream hit 1 MiB.

timed_out*boolean
duration_ms*integer
curl -X POST 'https://console.example.com/api/v1/workspaces/1/exec' \  -H 'Content-Type: application/json' \  -d '{  "command": "string"}'
{  "exit_code": 0,  "stdout": "string",  "stderr": "string",  "truncated": true,  "timed_out": true,  "duration_ms": 0}