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)
--include GLOB[,GLOB] Only harvest files matching these globs, e.g. *.py,*.md (repeatable)
--exclude-glob GLOB[,GLOB] Skip files matching these globs, e.g. tests/* (repeatable)
-o, --output-dir Output directory (default output), or - to print to stdout
--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

# only Python and Markdown, no tests, straight to the clipboard
repoharvester . --include '*.py,*.md' --exclude-glob 'tests/*' -o - | xclip -selection clipboard   # macOS: | pbcopy

Globs match the path relative to the repo root or the bare file name; * also crosses /, so write test_*.py or docs/* (not **/test_*.py or docs/). Output to stdout is always UTF-8. They apply on top of the groups and .gitignore.

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, only-files and skip-files globs, 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>
### Files: <count>, ~<tokens> tokens
<relative/path/one.ext>  ~<tokens>
<relative/path/two.ext>  ~<tokens>

### <relative/path/one.ext>
<file contents>
### end of file
...

The file list up front shows the model the repository's shape and shows you which files eat the context. Token counts are estimates (~4 characters per token).

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.3.1

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.3.1
File Size Uploaded Provenance Actions
repoharvester-0.3.1.tar.gz 178.7 kB With provenance Details for repoharvester-0.3.1.tar.gz

Built distribution (wheel)

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

Total release size: 194.0 kB

Release files / repoharvester-0.3.1.tar.gz

Download URL repoharvester-0.3.1.tar.gz
Size 178.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f09205031050588fedae4dc3ad820d1fdf369ff35df312f1937f75fe9cc41bc5
BLAKE2b-256 checksum
How to use checksums
966deee607a7a4e5e0473577368ae5c1e115c8e8f8a29bae1f2ad20b22eff4e3
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.3.1-py3-none-any.whl

Download URL repoharvester-0.3.1-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
95cf15b1f0cf5050855bf3e4b5d304b0dd062446c718abdeff76a6cb21f55d5f
BLAKE2b-256 checksum
How to use checksums
80b6223fb0cf58644a7f2f3fc34bc88ccf868dafad9ff5219a1e9bdbf5c836c8
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.3.1

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.3.1.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