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.4.tar.gz (5.0 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.4-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llm_context_cli-0.0.4.tar.gz
  • Upload date:
  • Size: 5.0 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.4.tar.gz
Algorithm Hash digest
SHA256 41a5204a05ac3f1938f5a3edd894e0e2ac828d5505e301500f993c3229a0f14b
MD5 0781f278568d2bf4d4ed1b76588c2403
BLAKE2b-256 443e6d7dd43adc1cbbbe9d6df9b110de862be03d55db4b8127028c64aab710b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llm_context_cli-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c3b65b0847aed083e86938516bcace7c2182cda7560b689132fe566aa77ba887
MD5 1de73e7b97ee5ba7d1a88ef444a61d2a
BLAKE2b-256 a197c607f14b2a3b59420b1f78e3e451447074305b4717587166afc3b1b61d7f

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