Back to Docs

CLI Runs, Logs & Artifacts

Wait for runs, resume log streams, stop work, and download videos or traces.

Test create/edit commands that start a run, and tests run, return a runId and workspace runUrl. Use that ID for run operations. Every run command requires --project PROJECT_ID.

Check and wait

mechasm runs status RUN_ID --project PROJECT_ID --json
mechasm runs get RUN_ID --project PROJECT_ID --json
mechasm runs wait RUN_ID --project PROJECT_ID --json

runs status and runs get report the run status and artifact availability. runs wait waits for the final result and retrieves the remaining log pages. A run that recovers successfully can finish as passed even if earlier failed steps remain in its logs.

Failed and stopped runs use exit code 5. A user-stopped run is reported as failed with the reason Stopped by user.

Follow or resume logs

mechasm runs logs RUN_ID --project PROJECT_ID --follow --json
mechasm runs logs RUN_ID --project PROJECT_ID --after CURSOR --follow --json

JSON follow mode writes each event and cursor checkpoint as a JSON line. Save the latest cursor and pass it with --after after a disconnect to resume. Keep the run ID and cursor in your workflow state.

Download evidence and read run variables

mechasm runs video RUN_ID --project PROJECT_ID --out run.webm
mechasm runs trace RUN_ID --project PROJECT_ID --out run-trace.zip
mechasm runs variables RUN_ID --project PROJECT_ID --json

Video and trace files are written to a new local path; existing files are not overwritten. They may become available after the run result. If an artifact is not ready, check runs status again and retry the download when it is available.

Stop an active run

mechasm runs stop RUN_ID --project PROJECT_ID

Stopping an active run releases its place in the run queue. The run ends as failed with the reason Stopped by user; runs wait exits with code 5.

Exit codes

CodeMeaning
0Command succeeded.
1API or internal error.
2Invalid command or arguments.
3Authentication required or invalid.
4Permission denied.
5Run failed or was stopped.
130Wait was interrupted.