Metadata-Version: 2.4
Name: repo-distiller
Version: 0.2.0
Summary: Convert a code repository into a single text file for LLM prompting.
Author: Sergei Sergienko
License: MIT License
        
        Copyright (c) 2026 Sergei Sergienko
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/Divelix/repo-distiller
Project-URL: Repository, https://github.com/Divelix/repo-distiller
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
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.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer>=0.9
Requires-Dist: PyYAML>=6.0
Requires-Dist: pathspec>=0.11
Dynamic: license-file

# repo-distiller

Convert a code repository into a single text file for LLM prompting.

When working with an LLM on a codebase, you often need to share the full context of a project. `repo-distiller` walks a repository, renders a directory tree, and concatenates all relevant source files into one clean text file you can paste into a prompt or attach to a conversation.

## Installation

```bash
pip install repo-distiller
```

## Usage

```bash
repo-distiller distill <repo> -o <output> [options]
```

### Arguments

| Argument | Description |
| --- | --- |
| `repo` | Path to the repository root |
| `-o`, `--output` | Output file path |
| `-i`, `--include` | Path to an include config YAML (optional) |
| `-e`, `--exclude` | Path to an exclude config YAML (optional) |

### Basic example

```bash
repo-distiller distill ./my-project -o context.txt
```

This writes a directory tree followed by the contents of every file, respecting `.gitignore` and skipping common noise (lock files, `__pycache__`, `.venv`, `node_modules`, etc.).

### Output format

```text
my-project/
├── src/
│   ├── main.py
│   └── utils.py
└── pyproject.toml

==============================
FILE: src/main.py
==============================
<file contents>

==============================
FILE: src/utils.py
==============================
<file contents>
```

### Include config

Limit the output to specific paths, extensions, or file sizes:

```yaml
# include.yaml
paths:
  - src/
extensions:
  - .py
  - .ts
limits:
  max_file_size_kb: 256
```

```bash
repo-distiller distill ./my-project -o context.txt -i include.yaml
```

### Exclude config

Suppress additional paths or extensions beyond the defaults:

```yaml
# exclude.yaml
paths:
  - tests/
  - docs/
extensions:
  - .md
  - .txt
```

```bash
repo-distiller distill ./my-project -o context.txt -e exclude.yaml
```

> When `-e` is provided, `.gitignore` is **not** loaded automatically — the exclude config takes full control.

### Combining both

```bash
repo-distiller distill ./my-project -o context.txt -i include.yaml -e exclude.yaml
```

## Default exclusions

The following are always excluded regardless of config:

- Directories: `.git`, `__pycache__`, `.venv`, `venv`, `node_modules`, `.mypy_cache`, `.pytest_cache`, `.ruff_cache`, `dist`, `build`, `.eggs`
- Suffixes: `.egg-info`
- Files: common lock files (e.g. `uv.lock`, `package-lock.json`), `.gitignore`, `LICENSE`

## License

MIT
