Run it now. Reconnect when it finishes.

agent-exec turns unknown-duration commands into durable jobs. It watches the risky first seconds, returns one JSON response, and keeps the process available through a stable job_id.

Install agent-execRun your first job

Prebuilt for Linux x86_64 and macOS Apple Silicon. Windows binaries are not provided.

One command · one response · one durable job
$ agent-exec run -- cargo test --all
{
  "ok": true,
  "type": "run",
  "job_id": "a4f27c91…",
  "state": "running",
  "stdout": "Compiling agent-exec…"
}

Catch a bad start without another round trip.

run observes for up to 10 seconds by default. Fast failures arrive in the first response; longer work continues as a job. Use --no-wait only when immediate return matters more than startup feedback.

The same job, whenever you return.

Every operation is bounded, non-interactive, and machine-readable. Keep the job_id; choose what the agent needs next.

  1. status

    Read the current state without waiting.

  2. wait

    Observe until a bounded deadline and receive the exit code when terminal.

  3. tail

    Retrieve bounded stdout and stderr again, with byte ranges and retained log paths.

  4. kill

    Explicitly stop the process. An observation deadline never stops the job.

Detached shell, with a contract.

Durability is only useful when the next agent turn can discover what happened.

CapabilitySubprocessnohupagent-exec
Return before completionNoYesYes
Stable job identifierNoNoYes
Structured state and exit resultLimitedNoYes
Discoverable retained logsCaller-managedCaller-managedYes
Reconnect laterCaller-managedManualYes

Use one lifecycle from any agent surface.

The CLI contract also powers MCP and HTTP integrations. No separate job model to learn.

CLI

Response-producing commands emit exactly one JSON object on stdout. Diagnostics stay on stderr; raw output remains available even when inline compression is enabled.

Read the output contract

HTTP

Serve the lifecycle on loopback for local tools and controlled automation.

Review HTTP safety

Keep the command running. Keep the result findable.

Install agent-exec