Metadata-Version: 2.4
Name: context-engine-raja
Version: 1.0.0
Summary: Bundle any codebase into a single LLM-ready context file.
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# Context Engine Raja

Bundle any codebase into a single LLM-ready context file.

## Features

- **LLM-ready output** with directory tree and clearly separated file sections
- **Fast directory traversal** with `os.scandir`
- **Concurrent file reading** with `ThreadPoolExecutor`
- **Memory-safe streaming** — writes directly to disk
- **`.gitignore` and `.contextignore` support**
- **Precompiled ignore rules** for fast repeated matching
- **Token estimation** using 1 token ≈ 4 characters
- **Token budget control** with `--max-tokens`
- **Colored terminal output** with scan feedback and summary
- **Default exclusions** for binaries, caches, and build artifacts

## Installation

```bash
pip install context-engine-raja
```

After installation, the `context-engine` command is available globally:

```bash
context-engine --help
```

## Usage

Basic usage:

```bash
context-engine ./my-project
```

Custom output file:

```bash
context-engine ./my-project -o context.txt
```

Ignore extra extensions:

```bash
context-engine ./my-project -i .csv,.sqlite,.bak
```

Limit token budget:

```bash
context-engine ./my-project --max-tokens 100000
```

Combine options:

```bash
context-engine ./my-project -o llm_context.txt -i .png,.jpg --max-tokens 100000
```

## Output Format

```
CODEBASE CONTEXT
================================================================================
Generated by Context Engine Raja v1.0.0
================================================================================
Directory Tree
================================================================================
my-project
|-- main.py
`-- utils/
    `-- helpers.py

================================================================================
File: main.py
================================================================================
[file content here]
```

## Ignore Rules

Context Engine Raja reads ignore patterns from:
- Built-in defaults (binaries, caches, build artifacts)
- `.gitignore`
- `.contextignore` (for LLM-specific exclusions)
- `--ignore` flag

Use `.contextignore` for LLM-specific exclusions without changing Git behavior.

## CLI Reference

```
context-engine TARGET_DIR [-o OUTPUT] [-i EXTENSIONS] [--max-tokens N]
```

- `TARGET_DIR` — directory to scan
- `-o`, `--output` — output file (default: `codebase_context.txt`)
- `-i`, `--ignore` — extra comma-separated extensions to skip
- `--max-tokens` — stop after estimated token count exceeds N

## Development

Install locally in editable mode:

```bash
pip install -e .
```

Run from source:

```bash
python -m codepack.main ./my-project
```

## Package Info

- Package: `context-engine-raja`
- Command: `context-engine`
- Python: `>=3.10`
- Dependencies: none
