Skip to content

colthreepv/llm-context

Repository files navigation

llm-context

A CLI tool to build context files to attach to Large Language Models (LLMs).

llm-context is a command-line utility designed to process directories of files and generate context files suitable for consumption by LLMs.

Usage

llm-context <directory> <suffix> [options]
  • <directory>: The directory to process.
  • <suffix>: The output file suffix.

For local development:

# Clone the repository
git clone https://github.com/yourusername/llm-context.git
cd llm-context

# Install dependencies
pnpm install

# Link globally to invoke it everywhere
pnpm build
pnpm link --global

Options

  • -i, --ignore <paths...>: Additional paths to ignore during processing.

Examples

Process the current directory and generate a context file:

llm-context ./ output

Process a specific directory while ignoring additional paths:

llm-context ./my-project output -i dist coverage .env

Output

After running the command, you will receive:

  • A context file named llm-context.<suffix>.txt containing:
    • A tree representation of your file structure enclosed in <tree> tags.
    • The contents of your files enclosed in tokenized delimiters.

Sample Output

Context file created at: llm-context.output.txt

Report:
<tree>
my-project
├── src
│   ├── index.ts
│   └── utils.ts
├── package.json
└── README.md
</tree>

Estimated Tokens: 1234

Ignoring Additional Paths

You can ignore additional paths using the -i or --ignore option:

llm-context ./ output -i logs temp data.json

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published