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.

Go v6.0.02 min read
Package: inherit-cli

Installation#

bash
go install github.com/openinherit/inherit-cli@latest

Or build from source:

bash
git clone https://github.com/openinherit/standard.git
cd standard/packages/cli
go build -o inherit .

Requires Go 1.21 or later.

Quick start#

bash
# 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 init

Commands#

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):

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#

bash
#!/bin/bash
set -e

for file in documents/*.json; do
  inherit validate "$file" --quiet --level 2
  echo "  $file — valid"
done

Validate all files with JSON output#

bash
inherit validate estate.json --json | jq '.valid'

Pre-commit hook#

bash
#!/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

Get in touch

Have a question about INHERIT, or interested in becoming a partner? We'd love to hear from you.

By submitting this form, you agree to our Privacy Policy. Your data is processed by Formspark (EU) and retained until your enquiry is resolved.

or email hello@openinherit.org