Skip to main content

A tool to manage and generate context for Large Language Models from project files

Project description

llmcxt (LLM Context Tool)

llmcxt is a command-line tool designed to manage and generate context for Large Language Models (LLMs) from your project files. It allows you to easily add, remove, and list files in your project, and generate a comprehensive context that includes both the project structure and the contents of selected files.

Features

  • Add single or multiple files to the context
  • Remove single or multiple files from the context
  • List the project structure
  • Generate a comprehensive context for LLMs
  • Ignore files based on .cxtignore or .gitignore patterns
  • Colorized output for better readability
  • Easy cleanup with a delete command
  • Automatically copy generated context to clipboard (optional)
  • View list of files in the current context

Installation

You can install llmcxt directly from PyPI:

pip install llmcxt

Usage

After installation, you can use the llmcxt command from anywhere in your project directory. The tool will look for a .cxtignore file (or .gitignore if .cxtignore is not found) in the parent directories to determine the project root.

Basic Commands

  • Add file(s) to context:

    llmcxt add <file1> [<file2> ...]
    
  • Remove file(s) from context:

    llmcxt remove <file1> [<file2> ...]
    
  • List project structure:

    llmcxt ls
    
  • Generate context:

    llmcxt generate
    
  • Generate context and copy to clipboard:

    llmcxt generate --clipboard
    
  • View current context (file paths):

    llmcxt context
    
  • Drop all context:

    llmcxt drop
    
  • Delete llmcxt and all related files:

    llmcxt delete
    

Examples

  1. Add multiple files to the context:

    llmcxt add src/main.py tests/test_main.py
    
  2. Remove a file from the context:

    llmcxt remove src/deprecated.py
    
  3. Generate context for LLM:

    llmcxt generate > llm_context.txt
    

Configuration

Ignore File

Create a .cxtignore file in your project root to specify patterns for files and directories that should be ignored. If .cxtignore is not found, the tool will fall back to using .gitignore.

Example .cxtignore:

# Ignore Python cache files
__pycache__/
*.pyc

# Ignore virtual environment
venv/

# Ignore .git directory
.git/

# Ignore the configuration file itself
.llmcxt_config.json

Uninstallation

To remove llmcxt and all related files, run:

llmcxt delete

This will prompt for confirmation before removing the tool and its dependencies.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

llmcxt-0.1.3.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

llmcxt-0.1.3-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file llmcxt-0.1.3.tar.gz.

File metadata

  • Download URL: llmcxt-0.1.3.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.8

File hashes

Hashes for llmcxt-0.1.3.tar.gz
Algorithm Hash digest
SHA256 d53c4f9592699182d23b98dbfa32be600493a30427128ce1b8456e0203d5dffa
MD5 76bfe7b4ef51b57ee1863a0e46b89874
BLAKE2b-256 8f7c229e92ddf2f420526f15bd0c13111747f8c6e2f76414303f2e96a4c7bd65

See more details on using hashes here.

File details

Details for the file llmcxt-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: llmcxt-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.8

File hashes

Hashes for llmcxt-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 55ac1193d79c2b1828b9e852a6aaa446f7b240d1be9552edbaf3155a9f08f59b
MD5 2a65ce17ead4d30b31b18ad694ca5d16
BLAKE2b-256 e09eaf74f8de4079f3179ff4e152732fb12f2dd8c1dfb0e7c9c6377518fe0fdf

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