A repository packer that generates XML representations of codebases for use with LLMs and code analysis tools.
- Packs an entire repository into a single XML file
- Respects
.gitignorepatterns and common ignore rules - Skips binary files automatically
- Includes file metadata (size, tokens, line count)
- Token counting for LLM context estimation
pip install pakem# Pack the current directory
pakem
# Pack a specific directory
pakem --path /path/to/repo
# Specify output file
pakem --path /path/to/repo --out output.xml
# Add additional ignore patterns
pakem --ignore "*.tmp" "secret_*"You can also run it as a module:
python -m pakem --path /path/to/repo --out output.xmlfrom pakem import RepoPacker
packer = RepoPacker(
root_dir="/path/to/repo",
output_file="repo.xml",
ignores=["*.tmp"]
)
packer.pack()git clone https://github.com/YaronKoresh/pakem.git
cd pakem
pip install -e ".[dev]"pytestruff check .This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.