CLI Reference
mortar validate
Validates that an OpenAPI specification can be parsed and normalized by the Mortar kernel.
mortar validate --spec <path>Flags:
--spec: Path to the OpenAPI YAML/JSON file.
mortar diff
Generates a structural drift report between two versions of a contract.
mortar diff --base <path> --head <path> --out <output-path>Flags:
--base: Path to the base (production) spec.--head: Path to the proposed (head) spec.--out: Path to write the JSON diff report.
mortar score
The primary command for CI/CD gates. Computes Insight, Foresight, and Authority for a change.
mortar score \
--base <path> \
--head <path> \
--policy <path> \
[--json]Flags:
--base: Path to the base spec.--head: Path to the proposed spec.--policy: Path to themortar.policy.yaml.--json: (Optional) Emit machine-readable JSON output.
mortar waive
Bypasses a blocked CI gate by recording an authorized waiver in the audit trail.
mortar waive --change-id <id> --reason <text>Flags:
--change-id: The ID of the change being waived (found inmortar scoreoutput).--reason: Required rationale for the waiver.
Exit codes
0: ALLOWED — Change meets policy requirements.1: BLOCKED — Change fails policy (breaking change or low score).2: ERROR — Usage error or system failure.