RepoPacker.jl
RepoPacker.jl is a Julia package that packs a local directory or Git repository into a single file in a format compatible with Repomix, a tool designed to feed entire codebases into AI systems for analysis. This format is optimized for consumption by large language models and other AI systems that require complete repository context.
Relationship to Repomix
RepoPacker.jl is specifically designed to generate output in the format inspired by that used by Repomix, an open-source tool created by yamadashy. While Repomix itself is implemented in other languages, RepoPacker.jl provides a native Julia implementation that:
- Generates files with close structure to Repomix output
- Follows the same file inclusion/exclusion patterns
- Maintains the same directory structure representation
- Includes the same metadata sections required by AI analysis tools
- Provides token count metrics to help with LLM context window limitations
This compatibility ensures that files generated by RepoPacker.jl can be used interchangeably with those produced by the original Repomix tool.
Features
- Pack local directories into Repomix-compatible format
- Clone and pack Git repositories directly
- Support for multiple output formats:
- XML (default)
- JSON
- Markdown
- Path exclusion patterns
- Detailed metrics:
- Total files
- Total characters
- Estimated token count (using char/4 heuristic)
- Detailed logging with verbosity control
- Robust error handling
- Comprehensive test suite
Why Use RepoPacker?
RepoPacker solves the problem of providing complete repository context to AI systems. When working with large language models for code analysis, it's often necessary to provide the entire codebase context in a single, structured format. RepoPacker generates this format automatically, handling:
- File filtering (only text files)
- Directory structure representation
- Content encoding in a safe format
- Exclusion of sensitive or irrelevant files
- Metrics to help with LLM context window limitations
Unlike general-purpose archive tools, RepoPacker specifically targets the needs of AI-assisted development workflows by producing output that's optimized for LLM consumption.
Quick Start
using RepoPacker
# Pack current directory as XML (default)
RepoPacker.pack_directory(".", "repo.xml")
# Pack as JSON
RepoPacker.pack_directory(".", "repo.json", output_style=:json)
# Pack as Markdown
RepoPacker.pack_directory(".", "repo.md", output_style=:markdown)
# Clone and pack a GitHub repository
RepoPacker.clone_and_pack("https://github.com/JuliaLang/julia.git", "julia.xml")