Durable command jobs for AI agents

Run long commands as jobs. Reconnect by job_id.

agent-exec starts unknown-duration commands as managed jobs and returns a stable job_id. Check status, reread logs with tail, block with wait, or kill — each as one structured JSON object.

Install agent-execQuick start

Prebuilt binaries: Linux x86_64 · macOS Apple Silicon · Latest release on GitHub

Start once. Reconnect with the job_id.

# 1. Start — returns a job_id immediately
JOB=$(agent-exec run --no-wait -- sh -c 'sleep 2; echo done' \
  | sed -n 's/.*"job_id":"\([^"]*\)".*/\1/p')

# 2. Reconnect later — completion state, exit code, and bounded output
agent-exec wait "$JOB"
# {"schema_version":"0.1","ok":true,"type":"wait","job_id":"…","state":"exited","exit_code":0,"stdout":"done\n","stderr":"","encoding":"utf-8-lossy","stdout_range":[0,5],"stderr_range":[0,0],"stdout_total_bytes":5,"stderr_total_bytes":0,"updated_at":"2026-07-20T00:00:00Z"}

wait returns the completion state, exit code, and bounded output. Use tail to reread logs later.

More than a detached shell

CapabilitySubprocessnohupagent-exec
Returns earlyNoYesYes
Stable job IDNoNoYes
Structured status and logsLimitedNoYes
Reconnect laterNoManualYes

Release platforms

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

Installation details

Agent integrations

Use the same lifecycle through the CLI, MCP stdio server, or HTTP server.

Connect an agent

Predictable output

Response-producing CLI commands emit one JSON object on stdout. Diagnostics stay on stderr.

Output contracts

Keep long-running work observable.

Install agent-exec Latest release