CLI · Gold and analytics
The gold layer works goal-first: declare a ReportingGoal from a business question, draft the models that answer it, and publish the semantic layer that BI tools consume.
kiri design
Draft a ReportingGoal from a freeform business question.
Usage: kiri design [OPTIONS]
| Flag | Description | Default |
|---|---|---|
--goal-file | Markdown file containing the business question (required) | |
--name | Override the AI-proposed name (filename stem) | |
--domain | Preferred business domain (e.g. customer) | |
--write / --no-write | Write to <project>/models/gold/<name>.yml | off |
--overwrite | Overwrite an existing goal file | off |
--allow-stub | Explicitly allow audited skeleton output when AI is unconfigured | off |
kiri suggest
AI-assisted draft generation for silver and gold models and tests. Every draft prints by default; --write saves it, --allow-stub permits audited template output when AI is unconfigured.
kiri suggest gold
Draft a gold dbt model for one fact or dimension of a ReportingGoal.
Usage: kiri suggest gold --goal <name> (--fact <f> | --dim <d>) [OPTIONS]
| Flag | Description | Default |
|---|---|---|
--fact / --dim | Fact or dimension name from the goal’s spec (one required) | |
--scd-type | For --dim: `type_1 | type_2 |
--surrogate-key-strategy | For --dim: `hash | sequence |
--fact-kind | For --fact: `transaction | periodic_snapshot |
--write | Save under models/gold/ as <goal>__<name>.sql | off |
kiri suggest silver / kiri suggest tests
kiri suggest silver --source <s> --table <t>— draft a silver dbt model from a bronze table;--goal/--entityscope the AI context to a reporting goal. (Details on the silver page.)kiri suggest tests --source <s> --table <t>— draft dbt-core data tests (not_null, uniqueness, …).--goalsharpens test choices with the goal’s KPIs;--sample-rows(default 5,0to disable) controls how many bronze rows the AI sees. Saves asmodels/silver/<source>__<table>.ymlwith--write.
kiri kpi
KPI lineage and freshness lookups.
kiri kpi list— every KPI name discoverable in the project.kiri kpi describe NAME— a KPI’s lineage, owner, freshness, and definition.--targetpicks the environment for the freshness lookup;--no-freshnessskips the manifest read (faster);--format text|json.
kiri kpi describe revenue
kiri kpi describe revenue --format json
kiri kpi describe customer_churn --no-freshness
kiri semantic
Semantic-layer emission, apply, and verification.
kiri semantic sync
Emit semantic-layer YAML from gold contracts.
Usage: kiri semantic sync --backend <name> [OPTIONS]
Supported backends: cube, metricflow, databricks-metric-views. Output defaults to stdout for piping into downstream deploy tooling; -o writes a file. --target is used by databricks-metric-views to read the runtime’s metric-views capability flag.
kiri semantic apply
Apply gold semantic models to Unity Catalog Metric Views.
Usage: kiri semantic apply --backend databricks-metric-views [OPTIONS]
Only databricks-metric-views is live-applyable today. Dry-run by default: --no-dry-run executes the CREATE OR REPLACE VIEW … WITH METRICS DDL against the live target, and requires KIRIMANA_SEMANTIC_VIEWS_LIVE=1 plus a Unity Catalog target — otherwise it downgrades to dry-run.
kiri semantic verify
Diff live Unity Catalog Metric Views against what the contracts declare.
Usage: kiri semantic verify --backend databricks-metric-views [OPTIONS]
--fail-on missing|stale|all (default all) controls the exit code; the JSON report goes to --output or stdout.
There is also a contract-level export path — kiri contract export semantic-layer — documented on the contracts page; it reads semantic_layer.target / semantic_layer.output_path from kiri.yml.
kiri graduate
Graduate Kiri-owned contracts (from auto/hybrid DPA mode) into the user-owned contract tree, putting them under normal review and governance.
kiri graduate --project .
Gold scaffolding at migration scale
For bulk gold/mart scaffolding from an upstream inventory, kiri scaffold emits contracts wholesale:
kiri scaffold all --plan minimal|pit-only|plan-a-1to1|plan-b-kimball|plan-b-layer --output <dir>— fan out a closed-menu plan. All plans exceptminimalrequire--inventory(upstream inventory JSON) and--entity-map;plan-b-kimballadditionally requires--mart-lineageand--routing-map.kiri scaffold mart --upstream-layer <l> --upstream-entity <e> --upstream-catalog <c> --output <yml>— emit a mart contract. Columns come from--column-list(authoritative) or are extracted from--view-sqlvia sqlglot;--parity-required exact|approximate|advisoryrecords the migration parity bar. A mart body SQL is required (--sql) unless--allow-placeholderis explicitly set — placeholder marts mask missing business logic and are refused by default.kiri scaffold silver --pattern scd2|type1|append-only|snapshotor--from-marts— emit silver contracts pattern-driven or inferred from mart contracts (--contracts+--routing-map).