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
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-fileis provided,.gitignoreis 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file repo_distiller-0.4.0.tar.gz.
File metadata
- Download URL: repo_distiller-0.4.0.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3aa092d8846f52cd1c2f3aa78e277b4a646121724d3994a9cda025e56bc213c
|
|
| MD5 |
fcf65085c13d86e3ad9f159292e38082
|
|
| BLAKE2b-256 |
702b413836cd85ef7d6ff2b14736fca154cbbf8f24f02085ef5a54d0d7121775
|
Provenance
The following attestation bundles were made for repo_distiller-0.4.0.tar.gz:
Publisher:
python-publish.yml on Divelix/repo-distiller
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
repo_distiller-0.4.0.tar.gz -
Subject digest:
e3aa092d8846f52cd1c2f3aa78e277b4a646121724d3994a9cda025e56bc213c - Sigstore transparency entry: 1191401845
- Sigstore integration time:
-
Permalink:
Divelix/repo-distiller@cd946c21cfaa304372179d0793fb0a2a67247471 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/Divelix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@cd946c21cfaa304372179d0793fb0a2a67247471 -
Trigger Event:
push
-
Statement type:
File details
Details for the file repo_distiller-0.4.0-py3-none-any.whl.
File metadata
- Download URL: repo_distiller-0.4.0-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4060cd6443dfd0829e99d2d2e0add1d4752bfe74881c2d5d7715bf87f4101bc9
|
|
| MD5 |
2cc4a27e1f87cc18d185e2f6bb48ea24
|
|
| BLAKE2b-256 |
13f6f0599637e6ad7d83381a39578a0c604b23a42dd4dd51647af288acf0ece9
|
Provenance
The following attestation bundles were made for repo_distiller-0.4.0-py3-none-any.whl:
Publisher:
python-publish.yml on Divelix/repo-distiller
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
repo_distiller-0.4.0-py3-none-any.whl -
Subject digest:
4060cd6443dfd0829e99d2d2e0add1d4752bfe74881c2d5d7715bf87f4101bc9 - Sigstore transparency entry: 1191401849
- Sigstore integration time:
-
Permalink:
Divelix/repo-distiller@cd946c21cfaa304372179d0793fb0a2a67247471 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/Divelix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@cd946c21cfaa304372179d0793fb0a2a67247471 -
Trigger Event:
push
-
Statement type: