Skip to main content

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

Project description

AI Context

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: llm_context_cli-0.0.3.tar.gz
  • Upload date:
  • Size: 5.1 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.3.tar.gz
Algorithm Hash digest
SHA256 5b8bf35a9a7b19b4a09b0e8f747e6a51427439cd2dcd6edecbdc4edbd6b641a9
MD5 9d66a7618d9c1eb29b10401393feb460
BLAKE2b-256 635b7052df3364527cf1b3652ed1c13c2ee2c448ef76dd81aca474f5b4e9d4e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llm_context_cli-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d81d4156b0238fd3796b0e5806874d5455b50795c059adf2ace6e82bb567e34c
MD5 da51348d2774be5d0c3d3abb87aceaed
BLAKE2b-256 86abbc310c9dc7202e725e4550dbccff54207361bf8e145dd0215199dad85429

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