Metadata-Version: 2.4
Name: kiri-cli
Version: 1.0.0b6
Summary: Kiri — Kirimana's CLI for data-contract-driven platform automation
Project-URL: Homepage, https://kirimana.io
Project-URL: Documentation, https://kirimana.io/docs
Project-URL: Support, https://kirimana.io/contact
Author: Kirimana contributors
License: FSL-1.1-ALv2
Keywords: data-contracts,data-platform,databricks,dbt,fabric,kiri,kirimana,odcs
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.12
Requires-Dist: anthropic>=0.68
Requires-Dist: certifi>=2024.2
Requires-Dist: dbt-core>=1.8
Requires-Dist: dbt-duckdb>=1.8
Requires-Dist: deltalake>=0.22
Requires-Dist: duckdb>=1.0
Requires-Dist: httpx>=0.27
Requires-Dist: jinja2>=3.1
Requires-Dist: mcp<2,>=1.28.1
Requires-Dist: pyarrow>=15.0
Requires-Dist: pydantic[email]>=2.7
Requires-Dist: pyjwt[crypto]>=2.8
Requires-Dist: python-dotenv>=1.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13.7
Requires-Dist: ruamel-yaml>=0.18
Requires-Dist: sqlalchemy>=2.0
Requires-Dist: sqlglot<28,>=27
Requires-Dist: typer>=0.12
Requires-Dist: xmltodict>=0.13
Provides-Extra: all
Requires-Dist: databricks-sdk>=0.30; extra == 'all'
Requires-Dist: databricks-sql-connector>=3.0; extra == 'all'
Requires-Dist: dbt-databricks>=1.8; extra == 'all'
Requires-Dist: dbt-trino>=1.8; extra == 'all'
Requires-Dist: pyiceberg[pyarrow]>=0.7; extra == 'all'
Requires-Dist: trino>=0.330; extra == 'all'
Provides-Extra: databricks
Requires-Dist: databricks-sdk>=0.30; extra == 'databricks'
Requires-Dist: databricks-sql-connector>=3.0; extra == 'databricks'
Requires-Dist: dbt-databricks>=1.8; extra == 'databricks'
Provides-Extra: iceberg
Requires-Dist: pyiceberg[pyarrow]>=0.7; extra == 'iceberg'
Provides-Extra: trino
Requires-Dist: dbt-trino>=1.8; extra == 'trino'
Requires-Dist: trino>=0.330; extra == 'trino'
Description-Content-Type: text/markdown

# kiri-cli

**Kiri** is the command-line interface for [Kirimana](https://kirimana.io) —
a source-available, AI-driven, platform-agnostic data-platform automation
tool. FSL-1.1-ALv2 (converts to Apache-2.0 after two years).

This package ships a single `kiri` binary that drives the full
data-contract lifecycle: scaffold a new data warehouse project,
declare sources + contracts, generate dbt models, apply against
**Databricks or DuckDB — the two supported runtimes today** —
govern with RBAC + audit + AI policy, ship to production with
multi-environment release manifests. The adapter architecture is
platform-agnostic by design; additional runtimes (Fabric, Trino,
Iceberg) are declared surface on the roadmap, not shipped yet.

The internal package mappers (`packages/cli/kiri_cli/`, `kiri_core`,
etc.) and ODCS customProperties (`kiri.classification`, etc.) are
named `kiri.*` — those are stable de-facto contracts. Kiri is the
user-facing surface; Kirimana is the implementation namespace. See
[the deployment docs](https://kirimana.io/docs/deploy/kubernetes)
for the full taxonomy.

## Install

```bash
pip install kiri-cli                   # base + DuckDB adapter (local)
pip install kiri-cli[databricks]       # + Databricks (the cloud runtime)
```

Databricks and DuckDB are the supported runtimes today. Other extras
you may spot in the package metadata install client libraries only —
those runtimes are not shipped yet.

Recommended: install via [`uv`](https://docs.astral.sh/uv/) so the
binary lands in `~/.local/bin/`:

```bash
uv tool install kiri-cli
```

Or via [`pipx`](https://pipx.pypa.io/):

```bash
pipx install kiri-cli
```

Both isolate the install in its own venv so it doesn't collide with
your project's Python environment.

## Quickstart

Build a real, populated warehouse table — no cloud account, no credentials,
nothing to author:

```bash
kiri --version
kiri init my_warehouse --with-sample-data --silver-technique flat
cd my_warehouse
kiri plan                           # preview what will be built
kiri apply                          # ingests the bundled sample into bronze
```

`--with-sample-data` drops a small CSV plus its data contract into the fresh
project, so `apply` has something real to ingest and you end up with a
queryable DuckDB table on the first run. Drop the flag when you point it at
your own sources.

Two things worth knowing:

- `--silver-technique` is required and has no default. It is an expensive
  choice to reverse, so the CLI makes you state it rather than guessing
  (`flat` is the right answer while you are exploring).
- If your machine has no git identity yet, `init` still creates and activates
  the project — it stages every file, skips the initial commit, and prints the
  `git config` commands to finish it.

Next: `kiri doctor` for a health punch-list, `kiri onboard` to brief your LLM
assistant on the whole product, and `kiri --help` for every command group
(`kiri <group> --help` drills in).

## Top-level command groups

Source of truth: `packages/cli/kiri_cli/main.py` and the per-group
modules. Listed in alphabetical order.

| Group | Purpose | ADR |
|---|---|---|
| `attr` | Attribute review-state machine — list, set, history | 0029 |
| `audit` | Read the apply-log + AI-call audit; join across systems | 0017 / 0049 |
| `azure` | Azure-specific helpers (storage credential, external location) | 0033 |
| `catalog` | Read/write the governance catalog; pull from external catalogs | 0009 / 0035 |
| `compliance` | Compliance reports (DORA / EU AI Act / GDPR) | 0032 |
| `contract` | Contract lifecycle: new / scaffold / lint / show / emit / promote / approval-count / codeowners | 0002 / 0004 / 0057 |
| `cost` | Cost estimation per contract / target | — |
| `databricks` | Databricks setup wizard + health probes | — |
| `dv` | Data Vault quality reports + zone migration | 0047 / 0048 |
| `flows` | List, run, and inspect compiled multi-task workflows | 0052 |
| `governance` | Governance maturity and policy commands | 0044 |
| `incident` | Incident lifecycle: list, create, dispatch, redact | 0038 |
| `incident-api` | Incidents REST surface helpers | 0038 |
| `ingest` | Run ingest stages, Airbyte connectors, list ingestion modes | 0027 / 0028 / 0057 |
| `kpi` | KPI workbench — plan, run, drift | 0036 |
| `lineage` | Column-level + cross-system lineage queries | 0045 |
| `maturity` | BI maturity assessment + recommendations | 0036 |
| `migrate` | Source-system migration: `analyze` / `sp` / `verify` | 0054 |
| `pack` | Federated pack library: install / publish / validate | — |
| `project` | Project lifecycle: status / validate / patch / probe / scaffold / commit / checksum | 0057 |
| `rbac` | Role-based access control: capability matrix, decide_access | 0030 |
| `reconcile` | Post-migration data validation (source vs target) | 0054 |
| `release` | Release manifest, status, promote | 0017 / 0041 |
| `schema` | Schema-drift detector + drift report | 0029 |
| `semantic` | Semantic-layer exports for BI tools | 0036 |
| `sla` | Data SLA definitions and breaches | 0036 |
| `source` | Source-YAML lifecycle: validate / commit / scaffold / patch / tables / table / group | 0057 |
| `vault` | Resolve `${vault:...}` references; rotate credentials | 0011 / 0050 |

Top-level commands without a group: `init`, `plan`, `apply`, `doctor`,
`onboard`, `use`, `targets`, `adapters`, `diff`, `lint`, `verify`, `explain`,
`eject`, `discover`, `fetch`, `optimize`, `vacuum`, `history`, `reload`,
`design`, `timetravel`, `map-source`, `graduate`, `upgrade`.

The table above is not exhaustive — run `kiri --help` for the authoritative
list of every group and command in the version you have installed.

Also installed by this package: `kiri-mcp` (the MCP server — see
[Use Kiri via MCP from your IDE](https://kirimana.io/docs/ai/mcp-ide))
and `kiri-job` (a scheduler-safe entry point used by compiled platform jobs).

## Conventions

- Commands resolve a target profile from `kiri.yml` via `--target / -t`
  and a project directory via `--project / -p`.
- Every long-running command writes a row to the apply-log — see
  `_start_apply_log` / `_finish_apply_log` in `kiri_cli.main`.
- Output defaults to JSON for machine consumers; pass
  `--format markdown` (or `--format text`) where supported for a
  human-readable rendering.
- AI calls go through `kiri_ai_gateway`; never directly to an SDK.
  Every call is audit-logged with prompt, response, model, cost, caller.

## Documentation

- **Command reference + guides:** <https://kirimana.io/docs>
- **CLI quickstart:** <https://kirimana.io/docs/getting-started/cli-quickstart>
- **Install + deploy:** <https://kirimana.io/docs/install/databricks>
- **Architecture principles:** <https://kirimana.io/why>

Offline, with no network and no browser — the CLI documents itself:

```bash
kiri --help                  # every command group
kiri <group> --help          # drill into one
kiri onboard                 # write llms.txt: brief any LLM on the whole CLI
kiri onboard --agent claude  # or a CLAUDE.md for Claude Code
kiri doctor                  # ranked, fix-hinted health punch-list
```

## License

FSL-1.1-ALv2 — source-available; each release converts to Apache-2.0 two years
after it ships. The full text ships inside this package (`kiri_cli/LICENSE`),
and the ODCS spec sliver stays Apache-2.0 forever (`kiri_odcs/LICENSE`).

## Support

Kirimana is in beta and the repository is invitation-gated. For help, bug
reports, or feature requests: <https://kirimana.io/contact>.
