Skip to main content

PilePack

Python Version License PyPI version Tests Coverage CLI

Pack your codebase into a single file for AI analysis
Combine all your project files into one text file — perfect for sending to LLMs (ChatGPT, Claude, Copilot, Deepseek, etc.).


✨ Features

  • 📁 Recursive scanning – walks through all files in a directory.
  • 💾 Streaming output – minimal memory usage even on huge codebases.
  • 🚫 Respects .gitignore – optionally disable with --no-gitignore.
  • 🔗 Skips symlinks by default – opt in with --follow-symlinks.
  • 🌳 Tree structure – displays project hierarchy.
  • 📄 Embedded content – each file is shown with its path header.
  • 🔐 Secrets masking – hides passwords, tokens, keys (--mask-secrets).
  • 🖨️ Two output formats – plain text (txt) or Markdown (md).
  • 💾 Save to file – use -o output.txt.

📦 Installation

pip install pilepack

From source:

git clone https://github.com/dartmew/pilepack.git
cd pilepack
pip install -e .

🚀 Usage

Basic command – pass a path to your project:

pilepack /path/to/your/project

Redirect output to a file:

pilepack . > report.txt

Example output (txt)

myproject
├── main.py
├── utils/
│   ├── helpers.py
│   └── __init__.py
└── README.md

================================================================================

--- FILE: main.py ---
import utils.helpers

def main():
    print("Hello")

--- FILE: utils/helpers.py ---
def greet(name):
    return f"Hi {name}"

Markdown format

pilepack . -f md -o report.md

Produces a Markdown file with syntax highlighting.

Show only structure (no file contents)

pilepack . --no-content

Mask secrets

pilepack . --mask-secrets

Replaces values of password=, api_key=, token=, and long strings (base64/hex) with ***.

Disable .gitignore

pilepack . --no-gitignore

Follow symbolic links explicitly

pilepack . --follow-symlinks

📋 CLI Options

Option Description
root Directory to scan (default: current directory)
--no-content Show tree structure only, skip file contents
--mask-secrets Mask passwords, tokens, API keys
-o, --output Write report to a file instead of stdout
--no-gitignore Do not respect .gitignore (include all files)
--follow-symlinks Follow symbolic links during scanning
-f, --format Output format: txt (default) or md

🧪 Testing

Install test dependencies and run:

pip install -e .[test]
pytest

With coverage:

pytest --cov=pilepack

Current coverage: 84% (20 tests, all passing).

Name                    Stmts   Miss  Cover
-------------------------------------------
pilepack\__init__.py        0      0   100%
pilepack\__main__.py        3      3     0%
pilepack\cli.py            53      5    91%
pilepack\collector.py      32      2    94%
pilepack\formatter.py      39      2    95%
pilepack\ignorer.py        21      3    86%
pilepack\reader.py         31     12    61%
-------------------------------------------
TOTAL                     179     27    85%

📄 License

MIT © 2026 Vasili S. Pribylov

🤝 Contributing

Issues and pull requests are welcome! For major changes, please open an issue first to discuss.

💬 Support

Feel free to open an issue for bugs, questions, or suggestions. I'll try to respond within a few days.

This project is actively maintained (as of 2026).

🙏 Acknowledgements

Inspired by the need to easily feed code into large language models.

Metadata

Release files for pilepack 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 pilepack 0.2.2
File Size Uploaded
pilepack-0.2.2.tar.gz 11.1 kB Details

Built distribution (wheel)

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

Total release size: 20.0 kB

Release files / pilepack-0.2.2.tar.gz

Download URL pilepack-0.2.2.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b84459b826d598e6cfcc2cbaee6b51192ad3dec5d260efdd4f90772685bf1fdd
BLAKE2b-256 checksum
How to use checksums
7136ccc50f226e794345c8cdbe31420c3bd7d6ce085f8d52923a624775093f04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 14, 2026.

Transparency log

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

Download URL pilepack-0.2.2-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c9c729e900a4bc535e92c6b4b8cc740972a32b5494027cf8dcabbeda5d0c0ae5
BLAKE2b-256 checksum
How to use checksums
357d627c597dd31544c7160c219366fbc7b6562e5f3e67f6d94402e4493cdd62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

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