CLI command design
outjob
Run Altium project OutJob files from the command line through the public altium-monkey launcher.
Usage
altium-cruncher outjob run
acr outjob run project.PrjPcb
acr outjob run project.PrjPcb release.OutJob
acr outjob run release.OutJob --project project.PrjPcb
acr outjob run --ad-version AD26 --timeout 600Arguments
run is the initial OutJob action. With no target, the command requires exactly one .PrjPcb in the current directory and runs every existing .OutJob referenced by that project. A project target runs that project's referenced OutJobs unless additional OutJob names or paths are supplied. An OutJob target without --project requires exactly one local project. --ad-version or --series selects an Altium major version. --timeout, --default-generated-output-path, --bind-pcbdoc, --auto-bind-pcbdoc, --no-auto-bind-pcbdoc, --stage-outjob-copy, --no-normalize-generated-paths, --script-directory, --keep-script-artifacts, and --stop-on-error control the underlying runner.
Behavior
The command wraps altium_monkey.altium_outjob_runner.AltiumOutJobRunner and requires Windows with Altium Designer installed. By default it runs the project-registered OutJob path, not a staged copy, because Altium output batches are sensitive to project document registration. The command preserves the source .OutJob bytes, temporarily normalizes GeneratedFiles output paths unless disabled, and auto-binds a single project .PcbDoc into embedded DocumentPath= tokens unless disabled. --stage-outjob-copy restores the lower-level runner behavior for advanced cases where a temporary OutJob copy is intentional.
The runner writes a temporary Pascal unit plus .PrjScr script project, opens the project and OutJob in Altium Designer, calls the WorkSpaceManager:GenerateReport process, waits for a completion marker, and removes temporary artifacts unless requested for inspection.
Output
Normal output prints one status line per OutJob. --json emits schema altium_cruncher.outjob.run.a0 with the resolved project, aggregate success, and one result record per OutJob including success, launch code, timeout state, error count, marker/log paths, normalization state, and rebound document path count. The command returns nonzero when input resolution fails or any executed OutJob result is unsuccessful.
Tests
Unit tests mock AltiumOutJobRunner and verify no-argument project auto-detection, project-referenced OutJob ordering, explicit project and OutJob path resolution, AD version and runner option forwarding, source OutJob restoration, automatic single-PcbDoc binding, non-Windows failure behavior, JSON schema output, ambiguous project errors, and failure exit codes. L0/L99 command inventory tests verify parser, manifest, README, and design-doc registration.