Metadata-Version: 2.4
Name: codemind-okf
Version: 1.1.0
Summary: CodeMind OKF CLI — Generate AI-ready knowledge bundles for any codebase. Works with Cursor, Antigravity, GitHub Copilot, and any MCP-compatible AI IDE.
Author-email: Yash Gondaliya <yashGondaliya36@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/YashGondaliya36/CodeMind
Project-URL: Repository, https://github.com/YashGondaliya36/CodeMind.git
Project-URL: Issues, https://github.com/YashGondaliya36/CodeMind/issues
Keywords: ai,code-analysis,cursor,copilot,llm,ast,knowledge-graph
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: typer>=0.12.0
Requires-Dist: rich>=13.0.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: python-frontmatter>=1.1.0
Requires-Dist: tree-sitter>=0.21.0
Requires-Dist: tree-sitter-python>=0.21.0
Requires-Dist: tree-sitter-javascript>=0.21.0
Requires-Dist: tree-sitter-typescript>=0.21.0
Requires-Dist: gitpython>=3.1.0
Requires-Dist: google-genai>=0.8.0
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: ruff; extra == "dev"

# 🧠 CodeMind OKF CLI

> **Generate AI-ready knowledge bundles for any codebase.**  
> Works with **Cursor**, **Antigravity IDE**, **Claude Desktop**, **GitHub Copilot**, and any **MCP-compatible** AI IDE.

<p align="center">
  <a href="https://pypi.org/project/codemind-okf/"><img src="https://img.shields.io/pypi/v/codemind-okf.svg?color=blue&style=for-the-badge" alt="PyPI Version"></a>
  <a href="https://pypi.org/project/codemind-okf/"><img src="https://img.shields.io/pypi/pyversions/codemind-okf.svg?style=for-the-badge" alt="Python Versions"></a>
  <a href="https://modelcontextprotocol.io/"><img src="https://img.shields.io/badge/MCP-Compatible-green.svg?style=for-the-badge" alt="MCP Compatible"></a>
</p>

---

## 📦 Installation

```bash
pip install codemind-okf
```

---

## 🚀 Quick Usage

### 1. `codemind index` — Index Any Project
Crawls your project files using Tree-sitter & AST parsers to generate a `.okf/` knowledge bundle.

```bash
codemind index .                         # Index current directory
codemind index /path/to/project          # Index a specific directory
codemind index . --lang python           # Only index Python files
codemind index . --overwrite             # Force re-index from scratch
```

* **⚡ SHA-256 Incremental Indexing:** Remembers file hashes. Subsequent runs skip unchanged files in **0.05s**!

---

### 2. `codemind init` — Drop AI IDE Instructions
Creates instruction files so Cursor, Antigravity, and GitHub Copilot use `.okf/index.md` as primary context.

```bash
codemind init                            # Create all AI IDE config files
```

**Files created:**
| File | Compatible Tool |
|---|---|
| `.cursorrules` | Cursor AI IDE |
| `.agents/AGENTS.md` | Antigravity IDE & Open Agents |
| `.github/copilot-instructions.md` | GitHub Copilot |

---

### 3. `codemind audit` — Architecture & Health Audit
Performs an architectural health check evaluating line density, docstring coverage, and layer separation.

```bash
codemind audit                          # Health score (0-100 A+)
```

---

### 4. `codemind watch` — Real-Time Background File Watcher
Watches the project directory for file saves and incrementally updates `.okf/` in under 50ms.

```bash
codemind watch                          # Run watcher in background
```

---

### 5. `codemind mcp` — Model Context Protocol (MCP) Server
Launches the MCP server over STDIO. Connects CodeMind natively to **Cursor**, **Claude Desktop**, **Antigravity**, or **Zed**.

```bash
codemind mcp
```

**Add to Cursor / Claude Desktop / Antigravity (`mcp.json`):**

```json
{
  "mcpServers": {
    "codemind": {
      "command": "uvx",
      "args": [
        "--from",
        "codemind-okf",
        "codemind",
        "mcp"
      ]
    }
  }
}
```

### 6. `codemind memory` — Manage AI Persistent Memory Log (.okf/memory.md)
Inspect, view, clear, or manually log memory entries to `.okf/memory.md`.

```bash
codemind memory show                     # Print full memory log
codemind memory ls                       # Show entry summary by type
codemind memory add "..." --type decision# Manually append memory entry
codemind memory clear                    # Reset memory log
```

---

## 🔌 Exposed MCP Tools

| MCP Tool | Description |
|---|---|
| 🧠 `remember(content, type)` | **Persists AI decisions, tasks, context & bugs into `.okf/memory.md`** |
| 🔄 `recall(query)` | **Retrieves relevant past memories at session start to eliminate context loss** |
| 📚 `get_project_index` | Reads the master architecture map (`index.md`) |
| 🔍 `search_bundle(query)` | Sub-word & token search across all project modules |
| 📖 `read_module(slug)` | Reads specific module AST metadata & function signatures |
| 🔗 `trace_dependencies(slug)` | Traces import graphs between components |
| 📁 `list_bundles` | Discovers available `.okf/` knowledge bundles |

---

## 📄 License

MIT License. See repository for details.
