Metadata-Version: 2.4
Name: nagi-cli
Version: 0.0.1
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Rust
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Requires-Dist: click>=8.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: mcp>=1.2.0 ; extra == 'mcp'
Provides-Extra: mcp
License-File: LICENSE
Summary: A reconciliation engine that declaratively defines the desired state of data and automatically converges toward that state
Keywords: reconciliation,desired-state,drift-detection,data-pipeline,data-quality
Author: The Nagi Contributors
License-Expression: Apache-2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://nagi-project.dev/
Project-URL: Homepage, https://nagi-project.dev/
Project-URL: Issues, https://github.com/nagi-project/nagi/issues
Project-URL: Repository, https://github.com/nagi-project/nagi

# Nagi

Nagi monitors your data, detects drift from the desired state, and automatically runs the operation you defined to fix it.

## Install

```bash
pip install nagi-cli
```

## How It Works

Define the desired state of each asset and the sync to run when drift is detected. Then compile, evaluate, and sync.

```yaml
# conditions: "clean_data.txt exists"
apiVersion: nagi.io/v1alpha1
kind: Conditions
metadata:
  name: clean-data-check
spec:
  - name: file-exists
    type: Command
    run: [test, -f, clean_data.txt]
---
# sync: "create the file"
apiVersion: nagi.io/v1alpha1
kind: Sync
metadata:
  name: build-clean-data
spec:
  run:
    type: Command
    args: [sh, -c, "echo '...' > clean_data.txt"]
---
# asset: "when drifted, run the sync"
apiVersion: nagi.io/v1alpha1
kind: Asset
metadata:
  name: clean-data
spec:
  onDrift:
    - conditions: clean-data-check
      sync: build-clean-data
```

```bash
nagi compile    # Validate and resolve resource definitions
nagi evaluate   # Evaluate conditions → reports "clean-data" as Drifted
nagi sync       # Run sync → creates clean_data.txt → re-evaluates as Ready
mv clean_data.txt dirty_data.txt
nagi evaluate   # Drifted again
nagi sync       # Restores clean_data.txt → Ready
```

`nagi serve` runs this evaluate-and-sync cycle continuously.

See the [Quickstart](https://nagi-project.dev/overview/quickstart/) for a full walkthrough, or browse the [Documentation](https://nagi-project.dev).

## License

Apache License 2.0. See [LICENSE](LICENSE) for details.

