Metadata-Version: 2.4
Name: codetrellis
Version: 1.0.1
Summary: CodeTrellis - Project Self-Awareness System - AI context injection tool
Author-email: Keshav Chaudhary <keshav@nsbrain.ai>
License: MIT
Project-URL: Homepage, https://github.com/chaudhary-keshav/codetrellis-matrix
Project-URL: Repository, https://github.com/chaudhary-keshav/codetrellis-matrix
Project-URL: Changelog, https://github.com/chaudhary-keshav/codetrellis-matrix/blob/main/CHANGELOG.md
Project-URL: Documentation, https://github.com/chaudhary-keshav/codetrellis-matrix/blob/main/README.md
Project-URL: Bug Tracker, https://github.com/chaudhary-keshav/codetrellis-matrix/issues
Keywords: ai,context,code-analysis,project-scanner,prompt-engineering,copilot,developer-tools,mcp,model-context-protocol,code-context,github-copilot,claude,cursor,windsurf,ai-context,code-scanner,code-intelligence,ast-parser,framework-parser
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Documentation
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: watchdog>=3.0.0
Provides-Extra: ast
Requires-Dist: tree-sitter>=0.22.0; extra == "ast"
Requires-Dist: tree-sitter-java>=0.23.0; extra == "ast"
Requires-Dist: tree-sitter-python>=0.23.0; extra == "ast"
Requires-Dist: tree-sitter-typescript>=0.23.0; extra == "ast"
Provides-Extra: yaml
Requires-Dist: pyyaml>=6.0; extra == "yaml"
Provides-Extra: color
Requires-Dist: colorama>=0.4.6; extra == "color"
Provides-Extra: tokens
Requires-Dist: tiktoken>=0.5.0; extra == "tokens"
Provides-Extra: all
Requires-Dist: codetrellis[ast,color,tokens,yaml]; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: pytest-timeout>=2.3.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: pytest-mock>=3.11.0; extra == "dev"
Requires-Dist: black>=24.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.8.0; extra == "dev"
Requires-Dist: numpy>=2.0.0; extra == "dev"
Requires-Dist: faker>=19.0.0; extra == "dev"
Requires-Dist: hypothesis>=6.82.0; extra == "dev"
Requires-Dist: jsonpatch>=1.33; extra == "dev"
Requires-Dist: isort>=5.12.0; extra == "dev"
Requires-Dist: pyyaml>=6.0; extra == "dev"
Requires-Dist: types-PyYAML>=6.0.0; extra == "dev"
Dynamic: license-file

# CodeTrellis — Give AI Full Project Awareness

> Scan your codebase, compress to ~1K tokens, inject into every AI prompt.

[![PyPI](https://img.shields.io/pypi/v/codetrellis)](https://pypi.org/project/codetrellis/)
[![Python](https://img.shields.io/pypi/pyversions/codetrellis)](https://pypi.org/project/codetrellis/)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
[![Tests](https://img.shields.io/badge/tests-7264%20passing-brightgreen)]()

**Works with:** GitHub Copilot | Claude | Cursor | Windsurf | any MCP-compatible AI

---

## The Problem

- AI assistants read files one at a time — they never see your full project
- They don't know about existing components, schemas, or patterns
- You explain your project structure repeatedly in every conversation
- AI lacks business domain understanding — doesn't know _why_ code exists

## Quick Start

```bash
pip install codetrellis
codetrellis scan /path/to/project --optimal
codetrellis init . --ai   # sets up Copilot/Claude/Cursor integration
```

## How It Works

```
┌─────────────────────────────────────────────────────────────────┐
│                         CodeTrellis WORKFLOW                           │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│   1. SCAN              2. COMPRESS           3. INJECT          │
│   ─────────            ───────────           ────────           │
│                                                                 │
│   Read every     →    Convert to      →    Add to every        │
│   file in             minimal              AI prompt            │
│   project             tokens                                    │
│                                                                 │
│   187 lines      →    30 tokens       →    Full awareness      │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘
```

## Top Features

- **120+ language/framework parsers** — Python, TypeScript, Go, Rust, Java, C#, and more
- **MCP server** for real-time AI context injection (JSON-RPC 2.0)
- **JIT context engine** — delivers only relevant sections for the file you're editing
- **Incremental builds** — only re-extract changed files
- **Best Practices Library** — 4,500+ practices auto-selected for your stack
- **Output tiers** — from ~800 tokens (compact) to full code context (logic)
- **CI/CD mode** — deterministic, parallel builds for pipelines
- **AI integration** — auto-generates Copilot, Claude, Cursor, Windsurf configs

📋 [Full feature list](https://github.com/chaudhary-keshav/codetrellis-matrix/blob/main/docs/FEATURES.md)

## Installation

```bash
pip install codetrellis

# Optional extras
pip install codetrellis[all]     # AST parsing, YAML, color, token counting
pip install codetrellis[ast]     # Tree-sitter AST parsing only
```

## Output Tiers

| Tier      | Truncation | Tokens      | Use Case                                    |
| --------- | ---------- | ----------- | ------------------------------------------- |
| `compact` | Yes        | ~800-2000   | Quick overview                              |
| `prompt`  | **NO**     | ~8000-15000 | Default AI injection (includes code logic!) |
| `full`    | **NO**     | ~15000+     | Detailed analysis                           |
| `logic`   | **NO**     | ~30000+     | Full code context                           |
| `json`    | **NO**     | Variable    | Machine processing                          |

```bash
# Use tiers
codetrellis scan ./project --tier compact   # Minimal
codetrellis scan ./project --tier prompt    # Default (recommended)
codetrellis scan ./project --tier full      # Everything
codetrellis scan ./project --tier logic     # With function bodies
```

## CLI Commands

```bash
# Scanning
codetrellis scan [path]              # Scan project
codetrellis scan [path] --optimal    # Maximum quality (recommended)
codetrellis scan [path] --incremental  # Only changed files
codetrellis scan [path] --ci         # CI/CD mode (deterministic + parallel)
codetrellis scan --remote <url>      # Scan a remote git repo

# AI Integration
codetrellis init . --ai              # Generate Copilot/Claude/Cursor configs
codetrellis init . --update-ai       # Regenerate AI files (no re-scan)
codetrellis mcp --stdio              # Start MCP server
codetrellis context path/to/file.py  # JIT context for a file
codetrellis skills                   # Generate AI-executable skills

# View & Export
codetrellis show                     # Show full matrix
codetrellis prompt                   # Print prompt-ready matrix
codetrellis export --json            # Export as JSON

# Quality & Maintenance
codetrellis verify [path]            # Build quality gate
codetrellis validate [path]          # Validate extraction completeness
codetrellis coverage [path]          # Show extraction coverage
codetrellis watch                    # Auto-sync on file changes
codetrellis clean [path]             # Clean caches
```

## Contributing

See [CONTRIBUTING.md](https://github.com/chaudhary-keshav/codetrellis-matrix/blob/main/CONTRIBUTING.md) for development setup and guidelines.

## License

MIT License — Keshav Chaudhary 2026
