Skip to main content

RepoHarvester

CI PyPI Python License: MIT

English | Русский

Clone a git repository (or point at a local folder) and get all of its text files in one file. Paste it into ChatGPT or Claude as LLM context, search it, review it, or read it offline. A command-line tool plus an optional GUI. No runtime dependencies.

uvx repoharvester https://github.com/psf/requests
Cloning https://github.com/psf/requests
Wrote 92 files to output/requests_all_files.txt, ~154.7k tokens (0 non-UTF-8 skipped)

Features

  • Works with SSH/HTTPS git URLs (shallow clone into a temp dir) or local folders.
  • Skips binary/noise by default: media, archives, executables, lock files, node_modules, virtualenvs, caches, .git, .github, and more.
  • Optional comment removal for common languages. String literals are kept, so "http://..." and "#fff" stay intact. Python uses the real tokenizer; other languages use regexes.
  • Size limit per file. Non-UTF-8 files are skipped and listed in skipped_files.txt.
  • Respects .gitignore: in a git repo only tracked and untracked-but-not-ignored files are harvested.
  • Logs a rough token estimate (~4 characters per token) so you know if it fits an LLM context.
  • Each file is headed by its path relative to the repo root. The output folder is never harvested into itself.
  • No runtime dependencies. The GUI is optional.

Install

Requires Python 3.12+ and git.

uv tool install repoharvester            # or: pipx install repoharvester
uv tool install "repoharvester[gui]"     # with the GUI

Usage

repoharvester <repo-url-or-folder> [options]
Option Description
-r, --remove Remove comments from code files
--no-skip GROUP[,GROUP] Include groups that are skipped by default (repeatable)
--max-size KB Skip files larger than this (default 1000). Files over 500 KB are logged
--exclude DIR[,DIR] Folder names to exclude, along with their contents (repeatable)
-o, --output-dir Output directory (default output)
--log FILE Also write the log to a file

Groups: archive, audio, cache_files, certificate, compiled_code, configuration, database, executables, font, log_files, media, node_modules, office, package_locks, system, temporary, video, virtual_env. See EXTENSION_GROUPS, FILENAME_GROUPS and FOLDER_GROUPS in repoharvester.py.

Example:

repoharvester git@github.com:username/repo.git -r --no-skip configuration --max-size 250 --exclude vendor,docs

GUI

repoharvester-gui                         # after installing with [gui]
uv run --extra gui repoharvester-gui      # from a clone
RepoHarvester window: repository URL and output folder fields, max file size, skip folders, a strip-comments checkbox, a grid of file groups to include, and a Harvest button above an empty log

Paste a git URL or choose a folder, tick anything extra to include, press Harvest (or Enter), then Open file. While a clone runs the button turns into Cancel. Settings are remembered in ~/.config/repoharvester/gui.json. On Linux the project prefers the system Python: uv's bundled builds ship Tk without font antialiasing.

Output format

## <repo-name>
### <relative/path/to/file.ext>
<file contents>
### end of file
...

Written to <output-dir>/<repo-name>_all_files.txt, with skipped_files.txt next to it.

Alternatives

  • repomix (Node.js): more output formats, exact token counts, many more options. Pick it if you have Node and want those.
  • gitingest (Python): also has a website where you swap hub for ingest in a GitHub URL.
  • files-to-prompt (Python): local files and folders, no cloning.

RepoHarvester is a single standard-library module: nothing to install besides Python and git, plus a small desktop GUI if you prefer clicking.

Development

See CONTRIBUTING.md.

uv run --group dev pytest
uvx ruff check .

License

MIT. See LICENSE.

Metadata

Release files for repoharvester 0.2.2

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

Source distribution (sdist)

Source distribution for repoharvester 0.2.2
File Size Uploaded Provenance Actions
repoharvester-0.2.2.tar.gz 173.6 kB With provenance Details for repoharvester-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for repoharvester 0.2.2
File Interpreter ABI Platform Actions
repoharvester-0.2.2-py3-none-any.whl Python 3 none any Details for repoharvester-0.2.2-py3-none-any.whl

Total release size: 187.6 kB

Release files / repoharvester-0.2.2.tar.gz

Download URL repoharvester-0.2.2.tar.gz
Size 173.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9d3cef7bbc60b0c563e0ae9355caed7bf57a07c2b020c61c9fbe5c5f0d85681c
BLAKE2b-256 checksum
How to use checksums
4c5f931967fe26b2dd6b9250c014ce48d26bd9fdd32598c111f95455099596f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 15, 2026.

Transparency log

Release files / repoharvester-0.2.2-py3-none-any.whl

Download URL repoharvester-0.2.2-py3-none-any.whl
Size 14.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb0aa804c6425619b5a2f08ef40e28fa4db5abcbe880e44fa7fa684d3e99ccee
BLAKE2b-256 checksum
How to use checksums
e147d480b68582a4d89de559adc2da4339473d8aa6d62278b4b4c27ab8009c26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 15, 2026.

Transparency log

Security for repoharvester 0.2.2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for repoharvester-0.2.2.tar.gz

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 Oct 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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