Run a program or agent
herdr_runStarts a program or coding agent in a persistent local or remote terminal, runs argv or a shell line, and sends an initial task to agents; returns the terminal address for follow-up control.
Instructions
Start a program in a new terminal that stays alive. argv runs as given; line runs in the shell; neither opens that machine's shell. If argv[0] names a template (see herdr_templates), its command starts and its body plus task are sent as the first message once the agent is ready. For a plain agent, task is typed as its first message once it is ready. Agents: always background=true, a name, and the whole task up front. Programs: background=false waits for exit (up to timeout) and returns its output in output and how it ended in wait. Returns the terminal (address is what you use afterwards) and, with a task, first_message.sent.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| on | No | Another machine (see herdr_machines); default: this one. | |
| rm | No | Remove the terminal right after it exits. | |
| cwd | No | Working directory. Default: the core's; on another machine, its home. | |
| env | No | Environment on top of the core's. | |
| argv | No | Program and arguments, or a template name. | |
| keep | No | Replace a lost program with a shell in place (never re-run). | |
| line | No | A shell line instead of argv (`cd app && npm test`). | |
| name | No | Unique among live terminals: 1-32 of a-z 0-9 - _ . | |
| task | No | The agent's first message (a template's task, or typed once an agent is ready). | |
| labels | No | Free-form labels. herdr.space=<id> shows it in the window. | |
| timeout | No | Seconds before the wait checks in, leaving it running (default 180). | |
| background | No | Return as soon as it runs (default true). False: wait like a shell and include its output. | |
| outlive_parent | No | Keep running when the caller's terminal ends. |