Skip to main content

RepoHarvester: any git repository as one text file, with a token estimate for each file. Shown: the start of the real output for psf/requests, 92 files and about 154.6k tokens.

CI PyPI Python License: MIT

English | Русский

Point it at a git URL or a local folder. You get all text files in one file, ready to paste into ChatGPT or Claude. A command-line tool with 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.6k tokens (0 non-UTF-8 skipped)

What you get

output/requests_all_files.txt starts with a list of every file and its size in tokens, then the files themselves:

## requests
### Files: 92, ~154.6k tokens
.coveragerc  ~16
HISTORY.md  ~16.1k
src/requests/models.py  ~10.4k
...

### src/requests/api.py
"""
requests.api
...
### end of file

The list shows the model the shape of the repository and shows you which files eat the context. Token counts are estimates (~4 characters per token). Files that are not UTF-8 are listed in skipped_files.txt next to the output.

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.
  • Respects .gitignore: in a git repo only tracked and untracked-but-not-ignored files are harvested.
  • Glob filters (--include '*.py', --exclude-glob 'tests/*'), a per-file size limit, and -o - to print straight to stdout.

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

File groups and glob rules: see docs/filters.md.

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

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.

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 one standard-library module. It needs only Python and git.

Development

See CONTRIBUTING.md.

uv run --group dev pytest
uvx ruff check .

License

MIT. See LICENSE.

Metadata

Release files for repoharvester 0.3.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.3.2
File Size Uploaded Provenance Actions
repoharvester-0.3.2.tar.gz 189.4 kB With provenance Details for repoharvester-0.3.2.tar.gz

Built distribution (wheel)

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

Total release size: 204.6 kB

Release files / repoharvester-0.3.2.tar.gz

Download URL repoharvester-0.3.2.tar.gz
Size 189.4 kB
Tags Source
SHA-256 checksum
How to use checksums
40ebbc1fcbf5c0f28e633038d660183663e6b009fee7298d28246495ca38e239
BLAKE2b-256 checksum
How to use checksums
ea7cfb3036b1c5743790e004d402f0af6eec3eddb975a0b05e8e955c18304cc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 5, 2026.

Transparency log

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

Download URL repoharvester-0.3.2-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c85b3621a8f2e8ce77097c580bed93cd170c6045924a5e3e9c350763e96d973d
BLAKE2b-256 checksum
How to use checksums
307273ef2d16cf9714d75a535cd66b12078ab6b947c191f20170695c80fe6250
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 5, 2026.

Transparency log

Security for repoharvester 0.3.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.3.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 Nov 5, 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