A high-performance code merging utility for consolidating source files from multiple languages into a single output file. Built for efficiency and scalability.
VibeMerge is designed to aggregate codebases efficiently. It supports over 40 programming languages, provides optional compression, and scales with parallel processing capabilities.
- Multi-language support for 40+ file types
- Parallel processing with multi-core utilization
- Optional whitespace compression
- Intelligent text file detection
- Pattern-based file filtering
- Memory-mapped I/O for large files
- Progress tracking and detailed statistics
Clone the repository and ensure Python 3.7+ is installed:
git clone https://github.com/naseridev/vibemerge.gitcd vibemergechmod +x vmrg.py./vmrg.py [OPTIONS] PATH [PATH ...]Merge all files in a directory:
./vmrg.py /path/to/projectMerge specific files:
./vmrg.py file1.py file2.py file3.pyMerge with custom output:
./vmrg.py /path/to/project -o output.txtEnable compression and parallel processing:
./vmrg.py /path/to/project -cp -o output.txtUse ignore patterns:
./vmrg.py /path/to/project -i .gitignore -o output.txtCombine multiple options:
./vmrg.py /path/to/project -cdpo output.txt -i .gitignore| Option | Description |
|---|---|
-o, --output |
Specify output file path (default: vibemerged.txt) |
-i, --ignore |
Path to ignore patterns file |
-c, --compress |
Enable whitespace compression |
-d, --dont-comment |
Add AI directive to prevent code commenting |
-p, --parallel |
Enable parallel processing for faster merging |
-q, --quiet |
Suppress progress output |
-v, --version |
Display version information |
Python, JavaScript, TypeScript, Java, C, C++, C#, Go, Rust, PHP, Ruby, Swift, Kotlin, Scala, Lua, Perl, R, Objective-C, SQL, Shell, Bash, Vim, Dart, Elixir, Erlang, Clojure, Lisp, Haskell, OCaml, F#, Nim, Crystal, V, Zig
Create a file with patterns to exclude specific files or directories:
node_modules
*.log
build/
dist/
.git
__pycache__
- Parallel processing activates automatically for 4+ files on multi-core systems
- Maximum file size: 10 MB per file
- Maximum total size: 1 GB
- Memory-mapped I/O used for files larger than 256 KB
Each merged file includes a header with the relative path:
--------------------------------------------------------------------------------
FILE: src/main.py
--------------------------------------------------------------------------------
[file content]
When compression is enabled, the output includes a directive for AI systems:
================================================================================
SYSTEM INSTRUCTION FOR AI
This code has been compressed to reduce token usage.
When generating responses or code:
- Write code in normal, readable format with proper spacing
- Use standard indentation and line breaks
- Follow conventional formatting practices
- DO NOT compress or minify your output
================================================================================
- 0: Success
- 1: Fatal error
- 130: User interruption
- Python 3.7 or higher
- No external dependencies required
Contributions are welcome. Submit pull requests with clear descriptions and test coverage.
For issues or questions, open an issue on the GitHub repository.