llmctx

Crates.iollmctx
lib.rsllmctx
version0.11.0
created_at2025-04-29 00:33:55.049868+00
updated_at2025-10-23 23:48:27.554044+00
descriptionLLM context builder
homepage
repositoryhttps://github.com/joshvoigts/llmctx
max_upload_size
id1652837
size19,923
Josh Voigts (joshvoigts)

documentation

README

llmctx

llmctx is a command-line tool designed to collect and process file content for use as context in large language models (LLMs). It provides a simple way to gather files, with options to control output size, copy results to the clipboard, and/or include build errors.


Installation

cargo install llmctx

Usage

llmctx [OPTIONS] [PATHS]

Options

Flag Description Short Flag
--copy Copy output to clipboard -c
--debug Run build and include in output -d
--test Run tests and include in output -t
--num-tokens Get an estimate of tokens -n
--max-tokens Limit output by max tokens
--exclude Exclude files matching a pattern -e

Examples

  1. Basic usage (process current directory):

    llmctx .
    
  2. Copy output to clipboard:

    llmctx . -c
    
  3. Build and copy to clipboard (only works with rust currently):

    llmctx --debug -c
    

Example Output

When running llmctx without any special flags, the tool will process files in the current directory (or the Git root if in a repo) and output their contents in a structured format:

src/main.rs:
```
fn main() {
    println!("Hello, world!");
}
```

README.md:
```
# My Project

This is a sample project for demonstration purposes.
```

Clipboard Integration

On macOS, llmctx uses the pbcopy command to copy output to the clipboard. For other systems, this feature may require alternative tools or configurations.

Commit count: 27

cargo fmt