Skip to content
/ clap Public

A tool that combines multiple files from a directory into a single output file. Perfect for sharing codebases with LLMs.

Notifications You must be signed in to change notification settings

alvivar/clap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‘ Clap

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.

✨ Features

  • πŸš€ 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 (.go or go)
  • πŸ“Š Progress Tracking - See which files are being processed with size information
  • 🌳 Recursive Search - Automatically traverses nested directories

πŸš€ Installation

go install github.com/yourusername/clap@latest

Or build from source:

git clone https://github.com/yourusername/clap.git
cd clap
go build

πŸ“– Usage

Basic Usage

Combine all files in a directory:

clap /path/to/directory

Filter by Extensions

Combine 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 txt

Custom Output File

Specify a custom output filename:

clap -o combined.txt /path/to/directory .js .ts

πŸ“š Examples

Combine all Go files in a project:

clap ./myproject .go

Create a codebase snapshot for AI:

clap -o context.txt ./src .js .jsx .ts .tsx

Gather all documentation:

clap -o all-docs.md ./docs .md

πŸ“‹ Output Format

Clap creates a well-organized output file with clear separators:

=== path/to/file1.go ===
[file content]

=== path/to/file2.go ===
[file content]

🎯 Use Cases

  • 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

πŸ“ License

MIT License - feel free to use this in your projects!

About

A tool that combines multiple files from a directory into a single output file. Perfect for sharing codebases with LLMs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages