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
-
Add multiple files to the context:
llmcxt add src/main.py tests/test_main.py -
Remove a file from the context:
llmcxt remove src/deprecated.py -
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.
Metadata
Release files for llmcxt 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| llmcxt-0.1.3.tar.gz | 8.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llmcxt-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.8 kB
Release files / llmcxt-0.1.3.tar.gz
| Download URL | llmcxt-0.1.3.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d53c4f9592699182d23b98dbfa32be600493a30427128ce1b8456e0203d5dffa
|
|
BLAKE2b-256 checksum How to use checksums |
8f7c229e92ddf2f420526f15bd0c13111747f8c6e2f76414303f2e96a4c7bd65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.8
|
Release files / llmcxt-0.1.3-py3-none-any.whl
| Download URL | llmcxt-0.1.3-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
55ac1193d79c2b1828b9e852a6aaa446f7b240d1be9552edbaf3155a9f08f59b
|
|
BLAKE2b-256 checksum How to use checksums |
e09eaf74f8de4079f3179ff4e152732fb12f2dd8c1dfb0e7c9c6377518fe0fdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.8
|