CLI
The pratya CLI provides commands for validating contracts, running tests with requirement tracing, and auditing coverage.
Installation
Commands
pratya validate
Parse and validate a CONTRACT.yaml file against the schema.
| Option | Default | Description |
|---|---|---|
--contract <path> |
./CONTRACT.yaml |
Path to the contract file |
pratya run
Run contract tests and generate a coverage report.
| Option | Default | Description |
|---|---|---|
--contract <path> |
./CONTRACT.yaml |
Path to the contract file |
--runner <type> |
vitest |
Test runner: vitest, playwright, or jest |
--output-dir <path> |
./pratya-report |
Output directory for reports |
--requirement <id> |
— | Run tests for a specific requirement only |
--coverage |
false |
Enable code coverage collection |
--coverage-summary <path> |
— | Path to Istanbul coverage-summary.json |
--fail-on-violations |
false |
Exit 1 if any ERROR-level violations |
--min-coverage <n> |
0 |
Minimum requirement coverage threshold (0–100) |
pratya audit
Run audit rules and report violations without executing tests.
| Option | Default | Description |
|---|---|---|
--contract <path> |
./CONTRACT.yaml |
Path to the contract file |
--report <path> |
— | Path to pratya-report.json for staleness checks |
pratya comment
Generate a Markdown summary suitable for a PR comment.
| Option | Default | Description |
|---|---|---|
--report <path> |
— | Path to pratya-report.json (required) |