Execute shell commands with the local `agentrun` CLI. Use when an agent needs timeout control, bounded stdout and stderr capture, or structured command results instead of direct raw process execution.
Use agentrun when direct command execution would be too noisy or risky because the process can hang, flood output, or return unstructured results.
Prefer the installed binary when it exists:
agentrun -timeout 5s -- sh -c 'echo ok'
If working inside this repository or the binary is not installed, run:
go run ./cmd/agentrun -- -timeout 5s -- sh -c 'echo ok'
-timeout to cap command duration.-max-output to cap captured stdout and stderr bytes.-dir when the command must run in a specific directory.-stdin only if the child process must read caller input.-format json or -format yaml for programmatic consumers.-format text for quick inspection.agentrun over raw sh -c when the result needs to be parsed later.Run a health check:
go run ./cmd/agentrun -- -timeout 3s -format json -- sh -c 'uptime && df -h'
Capture a bounded log sample:
go run ./cmd/agentrun -- -timeout 2s -max-output 4096 -- journalctl -n 100