CLI
Command-line tool for validating, linting, and working with INHERIT estate documents. Validate against v3 schemas, check referential integrity, diff documents, and scaffold new files.
Installation#
go install github.com/openinherit/inherit-cli@latestOr build from source:
git clone https://github.com/openinherit/standard.git
cd standard/packages/cli
go build -o inherit .Requires Go 1.21 or later.
Quick start#
# Validate a document
inherit validate estate.json
# Validate with JSON output
inherit validate estate.json --json
# Check referential integrity (Level 2)
inherit validate estate.json --level 2
# Scaffold a new estate document
inherit initCommands#
inherit validate <file>#
Validates an INHERIT document against the bundled v3 JSON Schema.
Flags:
| Flag | Description |
|---|---|
--json |
Output results as JSON |
--quiet |
No output — exit code only |
--mode <estate|catalogue> |
Force schema mode (default: auto-detect from $schema) |
--level <1|2> |
Conformance level: 1 = schema only, 2 = schema + referential integrity |
Exit codes:
| Code | Meaning |
|---|---|
| 0 | Document is valid |
| 1 | Document is invalid (schema errors found) |
| 2 | Runtime error (file not found, invalid JSON, etc.) |
Example output (human-readable):
File: estate.json
Mode: estate
Level: 1
Result: VALID
Note: Validation results are informational only. They verify schema conformance
and data structure, not legal accuracy, completeness, or suitability for any
purpose. Always consult a qualified legal or financial professional.Example output (JSON):
{
"valid": true,
"schemaMode": "estate",
"conformanceLevel": 1,
"file": "estate.json",
"errors": [],
"errorCount": 0,
"disclaimer": "Validation results are informational only..."
}inherit init#
Creates a new skeleton INHERIT estate document in the current directory.
inherit lint <file>#
Checks a document for best-practice issues beyond schema compliance.
inherit diff <file1> <file2>#
Compares two INHERIT documents and reports differences.
inherit refs <file>#
Checks referential integrity — verifies that all UUID cross-references in the document resolve to actual entities.
inherit version#
Prints version and schema information:
inherit-cli v6.0.0
schema: INHERIT v3 (Draft 2020-12)Examples#
CI/CD pipeline validation#
#!/bin/bash
set -e
for file in documents/*.json; do
inherit validate "$file" --quiet --level 2
echo " $file — valid"
doneValidate all files with JSON output#
inherit validate estate.json --json | jq '.valid'Pre-commit hook#
#!/bin/bash
# .git/hooks/pre-commit
for file in $(git diff --cached --name-only --diff-filter=ACM -- '*.json'); do
if inherit validate "$file" --quiet 2>/dev/null; then
true # valid or not an INHERIT doc
else
echo "INHERIT validation failed: $file"
exit 1
fi
done