Skip to main content

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

Or via uv:

uvx repo-distiller

Usage

repo-distiller <repo> -o <output> [options]

Arguments

Argument Description
repo Path to the repository root
-o, --output Output file path, or - for stdout
-i, --include Path to an include config YAML (optional)
-e, --exclude Paths to exclude, repeatable (e.g. -e a.txt -e b.txt)
--exclude-file Path to an exclude config YAML (optional)
--no-default-excludes Disable built-in exclusion rules
--dry-run / --list List files that would be included without writing output
-v, --verbose Show progress information on stderr

Basic example

repo-distiller ./my-project -o context.txt

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

Write to stdout

repo-distiller ./my-project -o - | pbcopy

Preview files without writing

repo-distiller ./my-project --dry-run

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 ./my-project -o context.txt -i include.yaml

Exclude specific paths

Exclude individual files or directories directly from the command line:

repo-distiller ./my-project -o context.txt -e tests/ -e docs/legacy/

Exclude config file

For more complex exclusion rules, use a YAML config file via --exclude-file:

# exclude.yaml
paths:
  - tests/
  - docs/
extensions:
  - .md
  - .txt
repo-distiller ./my-project -o context.txt --exclude-file exclude.yaml

When --exclude-file is provided, .gitignore is not loaded automatically — the exclude config takes full control.

Both flags can be combined — -e paths are merged with the YAML config:

repo-distiller ./my-project -o context.txt --exclude-file exclude.yaml -e extra_dir/

Combining include and exclude

repo-distiller ./my-project -o context.txt -i include.yaml -e tests/ -e docs/

Default exclusions

The following are excluded by default (disable with --no-default-excludes):

  • 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

Metadata

Release files for repo-distiller 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for repo-distiller 0.4.0
File Size Uploaded
repo_distiller-0.4.0.tar.gz 14.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for repo-distiller 0.4.0
File Interpreter ABI Platform
repo_distiller-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.6 kB

Release files / repo_distiller-0.4.0.tar.gz

Download URL repo_distiller-0.4.0.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e3aa092d8846f52cd1c2f3aa78e277b4a646121724d3994a9cda025e56bc213c
BLAKE2b-256 checksum
How to use checksums
702b413836cd85ef7d6ff2b14736fca154cbbf8f24f02085ef5a54d0d7121775
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 28, 2026.

Transparency log

Release files / repo_distiller-0.4.0-py3-none-any.whl

Download URL repo_distiller-0.4.0-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4060cd6443dfd0829e99d2d2e0add1d4752bfe74881c2d5d7715bf87f4101bc9
BLAKE2b-256 checksum
How to use checksums
13f6f0599637e6ad7d83381a39578a0c604b23a42dd4dd51647af288acf0ece9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page