osmates trajectory run
Run one task on several throwaway clones and write a trajectory entry for each.
osmates trajectory run [<options>] <machine> --task <task> [-- <agent> ...]The agent's program runs on the Mac, in the current folder, once a clone's guest agent answers. It drives the clone with osmates agent or MCP. Allow it on the source machine first, and each clone allows it the same.
OSMATES_MACHINE names the clone, OSMATES_TASK and OSMATES_TASK_ID the task, and OSMATES_TRAJECTORY_FOLDER the clone's entry. Each clone records at the trajectory level.
Exits 0 when every clone gave an entry and was deleted, whatever the task's outcome, 1 otherwise, and 130 after Control-C.
Entries and their format: https://osmates.com/docs/trajectories
Examples
osmates trajectory run dev --task 'Install nginx' --count 4 -- python3 agent.py
osmates trajectory run dev --task 'Fix the build' --check check.sh -- ./agentArguments
<machine>RequiredThe machine or template to clone.
--task <task>RequiredWhat the agent is asked to do.
--task-id <task-id>A name for the task in the entries.
Default:
task--count <count>How many clones run the task.
Default:
1--check <file>A script that runs in each clone after the agent; its exit 0 passes the task.
It runs as the clone's administrator, with /bin/sh on Linux and macOS and Windows PowerShell on Windows. Without it, the agent's exit passes or fails the task.
--parallel <parallel>Run at most this many clones at once. Default: as many as the Mac allows.
--timeout <timeout>Seconds the agent's program takes at most on each clone.
Default:
1800--to <folder>A new or empty folder for the entries and run.json. Default: ./trajectories-<date>-<time>.
--jsonPrint machine-readable JSON.
<agent>RepeatableThe agent's program on the Mac and its arguments, after --.
JSON output
With --json, it prints an object with these fields.
JSON Schema: /schemas/0/cli/trajectory/run.json
clonesarray of objectsRequiredclones[].agentobjectclones[].checkobjectclones[].clonestringRequiredclones[].deletedbooleanRequiredclones[].elapsedintegerRequiredclones[].entriesarray of stringsRequiredclones[].failureobjectclones[].indexintegerRequiredclones[].outcomeobjectRequiredclones[].problemsarray of stringsRequiredcollectedintegerRequiredconcurrentintegerRequiredelapsedintegerRequiredfailedintegerRequiredfolderstringRequiredpassedintegerRequiredsourcestringRequiredstartedstring (date-time)RequiredtaskobjectRequiredtask.idstringRequiredtask.instructionstringRequiredtask.machinestring
Fields nested deeper are in the schema.
Exit statuses
Its exit status is one of these.
| Status | Meaning |
|---|---|
| 0 | The command did what it was asked. |
| 1 | The command failed; with --json, standard error's last line is the error object. |
| 64 | The command line is wrong, as ArgumentParser found before the command ran. |
| 65 | What was given is wrong, found while the command ran; the same command fails until it changes. |
| 75 | The same command can work later with nothing changed, as while an update finishes. |
| 130 | Control-C cancelled what the command started. |
| 1 | The command printed its result, whose check failed. |