Clap slaps all your files into one!
A blazingly fast CLI tool that combines multiple files from a directory into a single, organized output file. Perfect for sharing codebases with LLMs, conducting code reviews, or creating comprehensive documentation snapshots.
- π Fast & Efficient - Recursively walks through directories at lightning speed
- π― Smart Filtering - Filter files by extension (supports multiple extensions)
- π Clear Formatting - Each file is clearly separated with headers showing the file path
- πͺ Flexible Output - Customize the output filename to your needs
- π Case-Insensitive - Extensions work with or without dots (
.goorgo) - π Progress Tracking - See which files are being processed with size information
- π³ Recursive Search - Automatically traverses nested directories
go install github.com/yourusername/clap@latestOr build from source:
git clone https://github.com/yourusername/clap.git
cd clap
go buildCombine all files in a directory:
clap /path/to/directoryCombine only specific file types:
# Single extension
clap /path/to/project .go
# Multiple extensions
clap /path/to/project .go .md .txt
# Extensions work without dots too!
clap /path/to/project go md txtSpecify a custom output filename:
clap -o combined.txt /path/to/directory .js .tsCombine all Go files in a project:
clap ./myproject .goCreate a codebase snapshot for AI:
clap -o context.txt ./src .js .jsx .ts .tsxGather all documentation:
clap -o all-docs.md ./docs .mdClap creates a well-organized output file with clear separators:
=== path/to/file1.go ===
[file content]
=== path/to/file2.go ===
[file content]
- AI Context Building - Feed entire codebases to Large Language Models
- Code Reviews - Share complete project snapshots
- Documentation - Combine multiple markdown files into one
- Backup - Create text-based snapshots of your projects
- Code Analysis - Prepare files for analysis tools
MIT License - feel free to use this in your projects!