Skip to main content

Pack your codebase into a single file for AI analysis

Project description

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.
  • 🚫 Respects .gitignore – optionally disable with --no-gitignore.
  • 🌳 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

📋 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)
-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            51      7    86%
pilepack\collector.py      30      1    97%
pilepack\formatter.py      44      3    93%
pilepack\ignorer.py        21      3    86%
pilepack\reader.py         31     12    61%
-------------------------------------------
TOTAL                     180     29    84%

📄 License

MIT © 2026 Vasili S. Pribylov

🤝 Contributing

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

🙏 Acknowledgements

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pilepack-0.1.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pilepack-0.1.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file pilepack-0.1.0.tar.gz.

File metadata

  • Download URL: pilepack-0.1.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for pilepack-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9c2487ec9d05d43f51303d3e2595b0b93d4f15b8b14c57dc75e686b72f7335a1
MD5 36fa8c603653c6a97c2686e387e3e4b7
BLAKE2b-256 31c44da1b61b52f6ba0c8398ffa57c4169381487b143c5c3f3d238e70dd83c4a

See more details on using hashes here.

File details

Details for the file pilepack-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pilepack-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for pilepack-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 53cb903c4de2613c21c1348310ec3de5bb6a7631fc2a7d4330812b2b2356160b
MD5 8dfc498a9b5ceeaf64c23cc6068fb9f5
BLAKE2b-256 0e6e27680a77975ef53ca364025beb9f3b89f3e013f53cf334b514f1de07047f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page