Request an invite
Docs menu

osmates trajectory run

Run one task on several throwaway clones and write a trajectory entry for each.

Usage
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

sh
osmates trajectory run dev --task 'Install nginx' --count 4 -- python3 agent.py
osmates trajectory run dev --task 'Fix the build' --check check.sh -- ./agent

Arguments

<machine>Required

The machine or template to clone.

--task <task>Required

What 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>.

--json

Print machine-readable JSON.

<agent>Repeatable

The 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 objectsRequired
clones[].agentobject
clones[].checkobject
clones[].clonestringRequired
clones[].deletedbooleanRequired
clones[].elapsedintegerRequired
clones[].entriesarray of stringsRequired
clones[].failureobject
clones[].indexintegerRequired
clones[].outcomeobjectRequired
clones[].problemsarray of stringsRequired
collectedintegerRequired
concurrentintegerRequired
elapsedintegerRequired
failedintegerRequired
folderstringRequired
passedintegerRequired
sourcestringRequired
startedstring (date-time)Required
taskobjectRequired
task.idstringRequired
task.instructionstringRequired
task.machinestring

Fields nested deeper are in the schema.

Exit statuses

Its exit status is one of these.

StatusMeaning
0The command did what it was asked.
1The command failed; with --json, standard error's last line is the error object.
64The command line is wrong, as ArgumentParser found before the command ran.
65What was given is wrong, found while the command ran; the same command fails until it changes.
75The same command can work later with nothing changed, as while an update finishes.
130Control-C cancelled what the command started.
1The command printed its result, whose check failed.

Report a problem with this page