Skip to main content

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

Project description

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

pip install repo-distiller

Usage

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

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

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:

# include.yaml
paths:
  - src/
extensions:
  - .py
  - .ts
limits:
  max_file_size_kb: 256
repo-distiller distill ./my-project -o context.txt -i include.yaml

Exclude config

Suppress additional paths or extensions beyond the defaults:

# exclude.yaml
paths:
  - tests/
  - docs/
extensions:
  - .md
  - .txt
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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repo_distiller-0.2.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

repo_distiller-0.2.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file repo_distiller-0.2.0.tar.gz.

File metadata

  • Download URL: repo_distiller-0.2.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.0

File hashes

Hashes for repo_distiller-0.2.0.tar.gz
Algorithm Hash digest
SHA256 77425dd29b0575c28c8a113a6b297221f3fb7614a883aa67ca8f68087d1d2f0d
MD5 83bd0a42c18daef8dfaff7e773a2f867
BLAKE2b-256 4bc8767817d466081140ab001d956eb7fa9c17ed60b950b3bf577c5d1a5c5eb7

See more details on using hashes here.

File details

Details for the file repo_distiller-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for repo_distiller-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 883eb41d595b63eadb85e8eff5f2baf8a6305d63056eb9dcf39a481ff15ff337
MD5 7ca55c4e2b5de7239df667433d8721b9
BLAKE2b-256 b61161e748e0147587828cfd34d6a3fea59bad3cb8060fb5a71c45e6e6edc53b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page