Concatenate files into formats optimized for Large Language Models while preserving metadata
curl -fsSL https://raw.githubusercontent.com/drgsn/filefusion/main/install.sh | bash
wget -qO- https://raw.githubusercontent.com/drgsn/filefusion/main/install.sh | bash
curl -fsSL https://raw.githubusercontent.com/drgsn/filefusion/main/install.sh > install.sh
chmod +x install.sh
./install.sh
go install github.com/drgsn/filefusion/cmd/filefusion@latest
Export your concatenated files in XML, JSON, or YAML formats with preserved metadata and structure
Use powerful glob patterns to include or exclude files with precise control over your codebase
Process files in parallel for maximum performance, with built-in safety limits and error handling
Set limits for individual files and total output size, with detailed size reporting and optimization
Remove comments, logging, and optimize whitespace while preserving essential documentation
Atomic writes and thorough error checking ensure your files are always handled safely
filefusion --pattern "*.go" --output result.xml .
filefusion --pattern "*.go,*.json" --exclude "vendor/**,*.test.go" --output api.json ./api
filefusion --max-file-size 5MB --max-output-size 20MB --output docs.yaml ./docs
filefusion --pattern "*.{go,js,ts}" --clean --clean-preserve-doc-comments --clean-remove-logging --output clean.xml ./src
filefusion --pattern "*.{go,js,py}" --exclude "**/test/**" --dry-run ./project
filefusion --pattern "*.{go,js,py}" --clean --clean-remove-comments --clean-remove-imports --clean-remove-logging --clean-optimize-whitespace --output minimal.xml ./src
filefusion --pattern "*.go" ./cmd ./internal ./pkg
filefusion --pattern "*.js,*.ts,*.jsx,*.tsx,*.css,*.html" --exclude "node_modules/**,dist/**,build/**" --output web-project.xml /path/to/web/project
filefusion --pattern "*.md,*.txt,*.rst" --exclude "node_modules/**,vendor/**" --max-file-size 1MB --output docs.yaml /path/to/docs
filefusion --pattern "*.{go,js,ts,py,java}" --exclude "**/{test,tests,vendor}/**" --clean --clean-remove-comments --clean-preserve-doc-comments --clean-optimize-whitespace --output multi-lang.xml /path/to/project
filefusion --pattern "*.{go,js,py,java}" --clean --clean-remove-comments --clean-optimize-whitespace --max-file-size 20MB --max-output-size 100MB --output monitored-clean.xml /path/to/project
filefusion --pattern "*.{go,js,ts,py,java,cpp,h}" --exclude "**/{test,build,dist,vendor}/**" --clean --clean-remove-comments --clean-optimize-whitespace --max-file-size 50MB --max-output-size 500MB --output large-project.xml /path/to/large/project