Metadata-Version: 2.4
Name: openblame
Version: 0.1.5
Summary: Local-first AI investigation CLI for OpenMetadata data pipelines.
Project-URL: Homepage, https://github.com/manasdutta04/openblame
Project-URL: Repository, https://github.com/manasdutta04/openblame
Project-URL: Issues, https://github.com/manasdutta04/openblame/issues
Author: OpenBlame Contributors
License: MIT
License-File: LICENSE
Keywords: ai-agent,data-lineage,data-observability,mcp,ollama,openmetadata
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.11
Requires-Dist: httpx>=0.27.0
Requires-Dist: mcp>=1.0.0
Requires-Dist: ollama>=0.4.0
Requires-Dist: openmetadata-ingestion>=1.5.0
Requires-Dist: pydantic-settings>=2.4.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: rich>=13.9.0
Requires-Dist: typer>=0.12.0
Provides-Extra: dev
Requires-Dist: build>=1.2.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
Requires-Dist: pytest>=8.3.0; extra == 'dev'
Requires-Dist: respx>=0.21.0; extra == 'dev'
Requires-Dist: twine>=5.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# OpenBlame

```text
                         _     _                      
                        | |   | |                     
   ___  _ __   ___ _ __ | |__ | | __ _ _ __ ___   ___ 
  / _ \| '_ \ / _ \ '_ \| '_ \| |/ _` | '_ ` _ \ / _ \
 | (_) | |_) |  __/ | | | |_) | | (_| | | | | | |  __/
  \___/| .__/ \___|_| |_|_.__/|_|\__,_|_| |_| |_|\___|
       | |                                            
       |_|                                            
```

**OpenBlame** is a local-first AI investigation CLI for data pipelines running on **OpenMetadata**. Point it to a table, and it will trace lineage, inspect recent quality failures, parse schema-changes, surface governance gaps, and draft a root-cause narrative.

The reasoning layer runs entirely on your local **Ollama** models, ensuring your metadata stays inside your environment.

---

## ✨ Features

- 🕵️ **Autonomous Investigation**: ReAct-style agent loop that plans and executes metadata research.
- 🌳 **Lineage & Blast Radius**: Automatic upstream/downstream analysis to find affected entities.
- 📉 **Schema Drift**: Instant diffing of column changes, type updates, and renames.
- 🛡️ **Governance Aware**: Surfaces missing owners, tiers, and domain gaps as operational risks.
- 🦙 **Local-First AI**: Powered by Ollama (qwen2.5, llama3, etc.). No external API keys needed for reasoning.
- 🔌 **MCP Ready**: Built-in Model Context Protocol server to integrate with AI IDEs like Cursor and Claude Desktop.

---

## 🚀 Quick Start

### 1. Install
```bash
pip install openblame
```

### 2. Configure (CLI-only)
No need to manually edit files. Just run the interactive setup:
```bash
openblame configure
```
*It will help you set your OpenMetadata Host, Token, and even auto-detect your installed Ollama models.*

### 3. Investigate
```bash
openblame investigate "ecommerce.analytics.customer_churn"
```

---

## 🛠 CLI Commands

### `investigate`
The core command. Runs the full AI reasoning loop.
```bash
openblame investigate <table_fqn> [OPTIONS]

Options:
  --depth INTEGER     Lineage depth (default: 3)
  --days INTEGER      Lookback days for changes (default: 7)
  --output PATH       Save report to markdown file
  --model TEXT        Override default Ollama model
  --host TEXT         Override OpenMetadata host
  --token TEXT        Override OpenMetadata JWT token
```

### `configure`
Interactive setup for your environment. Sets up `.env` for you.
```bash
openblame configure
```

### `list-models`
Show all models available in your local Ollama instance and see which one is active.
```bash
openblame list-models
```

### `diff`
Check for schema changes in a table without running the full agent.
```bash
openblame diff <table_fqn> --days 7
```

### `lineage`
Visualize upstream and downstream lineage as a tree.
```bash
openblame lineage <table_fqn> --depth 3
```

### `mcp-server`
Start the MCP server for integration with Claude/Cursor.
```bash
openblame mcp-server
```

---

## 🔌 MCP Integration (Cursor / Claude)

Add OpenBlame to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "openblame": {
      "command": "openblame",
      "args": ["mcp-server"]
    }
  }
}
```

---

## 🏗 Development

```bash
# Clone and install
git clone https://github.com/manasdutta04/openblame
cd openblame
pip install -e ".[dev]"

# Run Tests (Windows)
.\test.ps1

# Run Tests (Linux/Mac)
make test
```

---

## 📄 License
OpenBlame is released under the **MIT License**. See [LICENSE](LICENSE) for details.

---

## 🤝 Contributing
We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
Check out our [Code of Conduct](CODE_OF_CONDUCT.md) and [Security Policy](SECURITY.md).
