Start and manage a run from the CLI
Start an agent on a task from your terminal and watch it work. Hand off a code review before a meeting, or call marshal run from a script and let its exit code tell you whether the agent succeeded. The command starts a headless run from a manifest and a task.
Before you start
- Role: you can use the manifest.
- The CLI is installed and you are signed in with
marshal login. See Install the CLI. - A manifest. See Create a manifest.
- Available when your administrator enables runs and deputies.
Steps
-
Start the run:
marshal run --manifest my-manifest --task "review the repo and list risks" --followFlag Meaning --manifestRequired. A manifest name or ID. --taskRequired. The prompt for the agent. --followStream the transcript until the run ends. --titleA short name shown in the Runs list. Default: made from the task. --timeoutThe time budget, for example 30m. Default: your org’s default time budget, or15mwhen the org has none.--output-modeWhere the run’s output comes from: file(the agent writes/workspace/output.json) ortranscript(the agent’s final message). Default isfile.--permission-modeautoapproves every permission request.denyrefuses every request and needs--driver-mode acp. Default isauto.--driver-modeHow the agent is driven: acp,printorexec. Default is the runtime’s preferred mode.--jsonPrint the run as one JSON object on stdout, and send everything else to stderr. --verboseWith --follow, also print the agent runtime’s diagnostic lines.--runtimeThe agent runtime. Default is claude-code.--compute-classA size name such as medium, or a compute class ID. Optional.--keep-on-failureIf the run fails, keep its space up for 24 hours so you can look inside. -
Without
--follow, the command prints the run ID and a hint:follow with: marshal runs logs <run-id>. Run that command to stream the transcript. -
See your runs with
marshal runs list. It prints the ID, status, runtime, and the run’s title. -
See one run with
marshal runs get <run-id>. It prints the status, runtime, space, task, and, when there are any, the stop reason, output and error. A run that ended on its time budget says so here too. -
Send a note to a run that is still working:
marshal deputies message <run-id> "check staging before you touch prod" -
Change the time budget of a live run with exactly one of these:
marshal runs timeout <run-id> --add 15m marshal runs timeout <run-id> --pause marshal runs timeout <run-id> --resume--addmust be at least1m.--pausestops the timer only. The agent keeps working. -
Cancel with
marshal runs cancel <run-id>. You can also pass the ID of a queued launch.
To pick a finished run up again, run marshal runs continue <run-id> --message "...", or use the web app. See Continue a finished run.
Read the result in a script
Add --json and a script gets one JSON object on stdout with the run’s id, status, stop_reason, output, error, timeout_secs, url and continues_run_id. The transcript and progress lines go to stderr, so stdout holds only the object.
marshal run --manifest my-manifest --task "summarize the open changes" \
--output-mode transcript --follow --json 2>/dev/null | jq '.status, .output'With --follow, the object describes the final run, and the exit code is non-zero unless that run succeeded. Without --follow, it describes the run as created. marshal runs get <run-id> --json prints the same object for any run, and marshal runs list --json prints an array. The CLI reference lists every field.
What you should see
- After
marshal run:run <run-id> started (space <space-id>), atitle:line when the run has a title, and atimeoutline with the time budget the run got, for exampletimeout 2h. - With
--json, those lines appear on stderr and stdout holds the JSON object. - If the time budget ends the run, the command says that the run timed out, shows the budget it had, and points to
--timeoutandmarshal runs timeout --add. - With
--follow: the agent’s output as it works. At the end, a line like── run <run-id>: succeeded, thenoutput:orerror:when there is one. - If the run parks to wait for an answer, a line says it is parked and the command keeps waiting. Once someone answers, the output carries on in the run that continues the work.
- The command exits with an error code when the final run ends in any status other than
succeeded. This makes it safe to use in scripts. - Add
--verboseto also see the agent runtime’s own diagnostic lines. - After
marshal deputies message:message queued for the agent's next turn. With--interrupt, a line that says the current turn is stopping so the agent reads it now. - After
marshal runs cancel:run <run-id> canceling.
Next
Start a run in the web and follow it: open the same run on its run page to see changes, ports and cost.