Skip to main content

A tool to combine multiple files into a single file for AI context

Project description

LLM Context CLI

Python 3.7+ License: MIT PyPI version

🚀 A powerful command-line tool to combine multiple files into a single file formatted for Large Language Model (LLM) context.

🌟 Features

  • 📁 Combine multiple files into a single document
  • 🎯 Smart file pattern matching and exclusion
  • 🎨 Markdown-formatted output with syntax highlighting
  • 🔄 Preserve file structure and organization
  • ⚡️ Fast and efficient processing
  • 🛠 Customizable output formatting

📋 Prerequisites

  • Python 3.7 or higher
  • pip (Python package installer)

🚀 Installation

Install using pip:

pip install llm-context-cli

Or install with pipx for isolated environments:

pipx install llm-context-cli

💻 Usage

Basic Usage

Simply point the tool to your project directory:

llm-context-cli /path/to/project

Advanced Usage

Customize the output with various options:

llm-context-cli /path/to/project \
    --patterns "*.py, *.js" \
    --exclude "__pycache__/*, node_modules/*" \
    --output llmcontext.txt \
    --header "Project source code for review:" \
    --no-language

🎮 Command Options

Option Short Description Example
--patterns -p File patterns to include (multiple allowed) --patterns "*.py, *.js"
--exclude -e Patterns to exclude (multiple allowed) --exclude "test/*, *.pyc"
--output -o Output file path --output combined.txt
--header -h Optional header text --header "Source code:"
--language/--no-language - Toggle language hints in code blocks --no-language

📝 Examples

Combining Python and JavaScript Files

llm-context-cli . \
    --patterns "*.py, *.js" \
    --exclude "tests/*" \
    --header "Frontend and Backend Source Code:"

Processing a Specific Directory

llm-context-cli ./src \
    --patterns "*.ts" \
    --output typescript-code.txt \
    --language

🤝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Commit your changes (git commit -m 'Add amazing feature')
  5. Push to the branch (git push origin feature/amazing-feature)
  6. Open a Pull Request

📄 License

This project is licensed under the MIT License.

🙏 Acknowledgments

  • Thanks to all contributors who have helped shape this tool
  • Inspired by the need for better LLM context management

Made with ❤️ for the AI and developer community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm_context_cli-0.0.5.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_context_cli-0.0.5-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file llm_context_cli-0.0.5.tar.gz.

File metadata

  • Download URL: llm_context_cli-0.0.5.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for llm_context_cli-0.0.5.tar.gz
Algorithm Hash digest
SHA256 8b1d8753f61dc718e8a5f780edfa6a020f6b43aac167115da068cdcd15248ddc
MD5 6d02efd799e538569eebfa5280cf7b01
BLAKE2b-256 89246764ec61948862931e16dd0f6b51ad894728daa2d82aa2f03ea8f8e53c7c

See more details on using hashes here.

File details

Details for the file llm_context_cli-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_context_cli-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f22a0d4cc72b2140f73839f18f19663fd4a3605e661c3e6b73f76cd161f88572
MD5 8ef7163cb03160a3d617498a48c44146
BLAKE2b-256 ff0a83aecc7b5f11eeeafbfd00d8b9c2b126fc51e52e53453f27441c9573e233

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page