cm is a fast CLI tool that concatenates text files in a directory into one output file, ideal for LLM context.
It respects .gitignore, skips binaries, dotfiles, and non-text formats (e.g., images).
Executable name: cm.
curl -fsSL https://raw.githubusercontent.com/xcaeser/cm/main/install.sh | bashUpdating is as simple as (linux/macos):
cm updatefor windows (powershell): WIP, for now download the binary from the releases page.
cm [directory]Generates <directory-name>-cumul.txt with file headers
running only
cmscans the current directory
-
-p, --prefix <string>: Prefix output filename (e.g.,cm -p my→my-<dir>-cumul.txt). -
-e, --exclude <string>: Comma-separated list of file names, extensions, or glob patterns (supports globs).e.g.: *.md,*.ico,src/cli/*.zig,LICENSE, -
-h, --help: Show help.
Outputs summary: files cumulated, lines, size.
- Concatenates files with headers.
- Integrates
.gitignore(wildcards supported). - Filters non-text/dotfiles/output.
- Custom exclusions.
zig build installInstalls cm to $HOME/.local/bin.