An open API service indexing awesome lists of open source software.

https://github.com/xcaeser/cm

🤖 cumul concatenates all files in a directory into a single text file to provide context to Large Language Models (LLMs).
https://github.com/xcaeser/cm

cross-platform executable zig ziglang

Last synced: about 1 month ago
JSON representation

🤖 cumul concatenates all files in a directory into a single text file to provide context to Large Language Models (LLMs).

Awesome Lists containing this project

README

          

# Cumul

`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`.

[![Zig Version](https://img.shields.io/badge/Zig_Version-0.17.0-orange.svg?logo=zig)](README.md)
[![License: MIT](https://img.shields.io/badge/License-MIT-lightgrey.svg?logo=cachet)](LICENSE)
[![Built by xcaeser](https://img.shields.io/badge/Built%20by-@xcaeser-blue)](https://github.com/xcaeser)
[![Version](https://img.shields.io/badge/cumul-v0.4.0-green)](https://github.com/xcaeser/cm/releases)

## Installation

```bash
curl -fsSL https://raw.githubusercontent.com/xcaeser/cm/main/install.sh | bash
```

Updating is as simple as (linux/macos):

```bash
cm update
```

for windows (powershell): WIP, for now download the binary from the [releases](https://github.com/xcaeser/cm/releases) page.

## Usage

### Basic

```bash
cm [directory]
```

Generates `-cumul.txt` with file headers

> running only `cm` scans the current directory

### Options

- `-p, --prefix `: Prefix output filename (e.g., `cm -p my` → `my--cumul.txt`).
- `-e, --exclude `: 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.

## Features

- Concatenates files with headers.
- Integrates `.gitignore` (wildcards supported).
- Filters non-text/dotfiles/output.
- Custom exclusions.

## Installation from Source

```bash
zig build install
```

Installs `cm` to `$HOME/.local/bin`.