repocat
repocat captures the current repository into prompt-friendly text. It walks the
current working directory, selects UTF-8 files with deterministic ignore rules,
and renders Claude XML-style output by default.
repocat is inspired by
files-to-prompt, but it is not a
fork. It works toward the same broad goal of turning project files into useful
LLM prompt context with a different CLI UX, including ordered include/exclude
rules, explicit interactive-stdout handling, and CXML output by default.
Install
Install as a standalone tool (recommended):
uv tool install repocat
# or
pipx install repocat
Or install into your current environment:
uv add repocat
# or
pip install repocat
To develop locally:
uv sync
uv run repocat --list-files
Usage
By default, repocat writes prompt output to stdout when stdout is redirected
or piped:
repocat > prompt.xml
repocat | pbcopy
When stdout is an interactive terminal, bare repocat prints guidance instead
of dumping file contents. To print directly to the terminal anyway:
repocat --stdout
For the full command reference, rule-order details, examples, and project link:
repocat -h
Render Markdown fenced code blocks instead:
repocat --markdown > prompt.md
Write output to a UTF-8 file. The output file is excluded from capture:
repocat --output prompt.xml
List the files that would be captured without rendering contents:
repocat --list-files
The list ends with a summary line such as Total files: 12.
Add source-only line and byte totals:
repocat --list-files --stats
Stats describe selected source contents, not CXML or Markdown wrapper overhead.
Exact byte totals are always printed. When the total is at least 1 KiB, repocat
also prints a human-readable binary size such as Total source size: 1.42 MiB.
Print only the summary totals without listing file paths:
repocat --stats-only
Check why specific files would or would not be captured:
repocat check README.md src/main.py
Copy selected files into a marked clone directory under a parent directory:
repocat clone --into ..
repocat clone --into .. --dry-run
repocat clone --into .. --name repocat-context
repocat clone --into .. --force
By default, clone creates <cwd-name>.repocat-clone under the parent. A
non-empty clone root is replaced only with --force and only when it contains a
valid .repocat-clone.json marker. Clone prints a source summary after copying.
Dry-run validates the destination and prints the same summary without writing
files.
Disable .gitignore handling:
repocat --ignore-gitignore
Use repocat-specific include and exclude rules:
repocat --include "tmp/keep.txt"
repocat --include "tmp\keep.txt"
repocat --include ".\tmp\keep.txt"
repocat --include "./tmp/keep.txt"
repocat --exclude "secrets.env"
repocat --include "*" --exclude "secrets.env"
repocat --exclude "*" --include "tests/**" --gitignore-filter --list-files
--include, --exclude, and --gitignore-filter are repeatable and
order-sensitive. Later repocat rules override earlier repocat rules.
--include and --exclude accept gitignore-style patterns. For command-line
convenience, repocat normalizes common path-like inputs before compiling them:
backslashes become /, a leading ./ or .\ is removed, and redundant .
path segments are removed. Leading gitignore escapes such as \#file and
\!important.txt are preserved. The normalized value is still interpreted as a
gitignore-style pattern, not as an absolute filesystem path. .repocatignore
files are read exactly as written.
Rule Precedence
By default, repocat respects .gitignore, but .repocatignore and command-line
rules are evaluated in a higher-precedence repocat layer.
Most repocat rules decide directly:
--exclude PATTERNexcludes matching files.--include PATTERNforce-includes matching files, even if.gitignorewould otherwise ignore them.
--gitignore-filter is the exception: it applies .gitignore as an
exclusion-only filter at that point in the ordered CLI rule sequence. It can
remove ignored files from a previous include, but it never includes files by
itself.
If the ordered repocat layer makes no decision for a file, normal .gitignore
handling is applied. If .gitignore also makes no decision, the file is
included.
Precedence:
- Hard exclusions always win.
- Root
.repocatignoreand ordered CLI rules decide next, including explicit--gitignore-filtersteps. - Outside explicit
--gitignore-filtersteps,.gitignoredecides only when the ordered repocat layer makes no decision. - Files are included by default.
When --ignore-gitignore is set, --gitignore-filter has no effect because no
.gitignore files are loaded.
Hard exclusions are:
- Any
.git/directory and all descendants. - The
--outputfile when it is inside the invocation root. - The active clone root when it is inside the invocation root.
- Marked repocat clone directories containing
.repocat-clone.json. - Any file named
.repocat-clone.json.
Nested .repocatignore files are ignored. Nested .gitignore files are honored
by default and scoped to their own directories.
Text, Symlinks, and Warnings
All configuration files, captured files, and output files use UTF-8. Selected files that cannot be read as UTF-8, or cannot be read due to an I/O error, are skipped with warnings on stderr. Warnings are never mixed into stdout prompt output.
Directory symlinks are not followed. File symlinks are captured only when their targets resolve to regular files inside the invocation root; the rendered source path remains the symlink path. Broken file symlinks and external symlink targets are skipped with stderr warnings.
Metadata
Release files for repocat 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| repocat-1.0.1.tar.gz | 18.3 kB | Without provenance | Details for repocat-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| repocat-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for repocat-1.0.1-py3-none-any.whl |
Total release size: 42.2 kB
Release files / repocat-1.0.1.tar.gz
| Download URL | repocat-1.0.1.tar.gz |
|---|---|
| Size | 18.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d7c8bf958cd0612e65b7a550714006054614a7919fbe21ee580738cad3c034c6
|
|
BLAKE2b-256 checksum How to use checksums |
04788d00bc2ca9fe5821c2b73007bc3997f425560f79552174f119ec64ea09fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / repocat-1.0.1-py3-none-any.whl
| Download URL | repocat-1.0.1-py3-none-any.whl |
|---|---|
| Size | 23.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c9c779f030a499392a21cae4935675eeb8752d911e291eec2a46b945a70e8474
|
|
BLAKE2b-256 checksum How to use checksums |
150eb212f1ac0c787b38e67a3b4aaca83a33dd69746820ec5169117deeb59c48
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for repocat 1.0.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.