Skip to main content
Private Preview·Early access by invitation.Request access →
Kirimana.
Docs · CLI reference

CLI · Contracts and schema

Data contracts (ODCS v3 with kiri.* extensions) are the project’s source of truth. These verbs create, validate, lint, diff, promote, and export them.

kiri contract

Authoring

  • kiri contract new — scaffold a new contract in MVP form with AI-assisted descriptions. Prompts for anything omitted: --source, --table, --name (snake_case), --description, --owner, --classification public|internal|confidential|restricted, --domain (defaults to the source’s domain). --yes skips the save confirmation for CI; --legacy-contracts is the escape hatch for writing under contracts/ when the project uses the layer-contract layout.
  • kiri contract scaffold — render contracts/<name>.yml non-interactively from a source table. Identify the table with --source-urn urn:kirimana:source:crm:customers or --source + --table; --semantic-entity sets kiri.semantic.entity (defaults to the source entity).

Validation and inspection

  • kiri contract validate PATH [--strict] — structural + semantic validation of one contract. --strict exits non-zero on semantic warnings (errors always fail).
  • kiri contract show PATH — print a canonical-model view of the contract.
  • kiri diff A B — semantic-aware diff of two ODCS contracts (top-level verb).
  • kiri contract schema-export [-o contracts.schema.json] — emit a JSON Schema document for the contract surface. --standard odcs strips kiri.* extensions, kiri-only emits only the extensions, odcs+kiri (default) is the full surface. --draft 2020-12|07.

Governance lint

Usage: kiri contract lint [OPTIONS]
FlagDescriptionDefault
--project, -pProject directory
--formattext | pr | jsontext
--domainRestrict findings to one information domain. Cross-contract rules still run project-wide so cross-domain-consumption findings still fire; results are filtered to the scoped domain’s files.
--suggest-zonesData Vault helper: walk silver-state DV contracts and suggest a kiri.medallion.silver_zone for each, inferred from its parent’s zone (satellites) or connected hubs (links). Emits a YAML-patch guide instead of regular lint findings.off

kiri lint [PROJECT] (top-level) is a narrower check: it reports the override count and per-override drift for generator-owned files.

Live-schema reconciliation

  • kiri contract verify-live --contract <yml> --catalog <c> --schema <s> — diff the live table’s schema (Unity Catalog) against the contract. --fail-on add|drop|type-mismatch|meta-mismatch|all (default type-mismatch) controls the exit code; the JSON report goes to --output (default verify-live.json).
  • kiri contract sync-from-live --contract <yml> --catalog <c> --schema <s> — propose contract patches that would bring the contract in line with the live table. --propose emits a YAML proposal for review (default ./sync-proposal.yml); --apply writes the patched contract back (refused when the project’s policy is fail-closed).

Lifecycle

Usage: kiri contract promote [OPTIONS] NAME

Promote a contract along the medallion states: --to draft|bronze|silver|gold|deprecated. --active / --inactive also flips kiri.medallion.active--inactive pauses runtime execution without demoting the state.

Export and emission

  • kiri contract emit CONTRACT_PATH --dbt-project <dir> — emit framework artefacts from a contract into the target dbt project’s models/_kiri_generated/. Semantic validation runs first by default (--no-validate to skip).
  • kiri contract export semantic-layer — export gold contracts as semantic-layer artefacts. --target metricflow | dbt-semantic | cube | databricks-metric-views overrides semantic_layer.target in kiri.yml; --output overrides semantic_layer.output_path; --contract <name> exports one contract.
kiri contract export semantic-layer
kiri contract export semantic-layer --contract orders
kiri contract export semantic-layer --target metricflow --output models/semantic/

CI helpers

  • kiri contract approval-count --changed-files-from <file> — print the required approver count for a change set (the workflow computes the file via git diff --name-only). --restricted-raises-from and --cross-domain-from list changed paths that introduced value: restricted or a new cross-domain consumer, both of which raise the bar.
  • kiri contract codeowners [-o .github/CODEOWNERS] [--check] — emit a CODEOWNERS file derived from contract ownership; --check exits 1 in CI when the on-disk file diverges from the synthesised body.
  • kiri contract merge-classification --contracts <dir> --proposals <dir> — stamp kiri.classification onto contracts from kiri inventory pre-classify proposals. --ai-results merges an AI-batch results JSONL on top; --operator-overrides win every precedence contest; --precedence caps the highest source allowed through (operator | ai_gateway | heuristic_high | heuristic_default); --dry-run reports without writing.

kiri layer

Per-(domain, layer) manifests under 01-config/<domain>/<layer>.yml — the consolidated alternative to per-table contract files.

  • kiri layer list — list every discovered (domain, layer) manifest.
  • kiri layer show DOMAIN LAYER [--target <t>] [--format text|json] — render the resolved view of one manifest (LAYER is bronze|silver|gold|pit).
  • kiri layer validate [--strict] — run the per-(domain, layer) project validation.
  • kiri layer diff --target <a> --vs <b> — per-(domain, layer) deltas between two targets.
  • kiri layer migrate-from-contracts --contracts <dir> [--out <dir>] [--dry-run] [--keep-archive] — atomically collapse per-table contracts into layer manifests under <out>/<domain>/<layer>.yml. --keep-archive archives the source directory instead of deleting it.

kiri intent

Propose-only Semantic Intent designer.

Usage: kiri intent propose [OPTIONS]

Proposes a technique-neutral Semantic Intent Model for the project. --source-shape flat|kimball|data_vault|mixed|unknown|greenfield tells Kiri what already exists so it calibrates confidence honestly; output goes to --output (default <project>/.kirimana/proposed-intent.json).

kiri schema

Schema-registry push.

Usage: kiri schema push [OPTIONS]

Push Avro-rendered contract schemas to an external schema registry. --backend confluent|glue selects the registry kind (--url for a Confluent-compatible registry; --registry-name and optional --region for AWS Glue). --contract <name> limits the push to one contract; --dry-run prints the Avro JSON that would be pushed without contacting the registry — safe for CI previews.

Updated 5 July 2026 · v1.0.0-beta.1