A tool to gather project context into a single file for LLMs
Project description
📦 repo-to-llm-context 📦
Stop copy-pasting code. Start shipping smarter prompts.
the ultimate context packer for your AI coding assistant. it scans your repo, ditches the junk, and bundles the good stuff into one perfect, clipboard-ready prompt.
🧭 Quick Navigation
⚡ Get Started • ✨ Key Features • 🎮 Usage & Examples • ⚙️ Advanced Flags • 🆚 Comparison
repo-to-llm-context is the project manager your AI assistant wishes it had. Stop feeding your LLM random files and praying for a good answer. This tool acts like a pro developer, reading your entire project, intelligently selecting the most relevant files, and packaging them into a perfectly structured prompt so your AI can actually understand what the hell is going on.
🧠Smart FilteringDitches node_modules & junk |
🎯Relevance ScoringPuts the important code first |
📋Clipboard ReadyOne command, ready to paste |
How it slaps:
- You:
cd my-project && context context: Scans, filters, scores, formats, and copies.- You:
Cmd+Vinto Claude/ChatGPT/Gemini. - LLM: "Ah, I see. A well-structured project. Here is your god-tier answer."
💥 Why This Slaps Other Methods
Manually prepping context is a vibe-killer. repo-to-llm-context makes other methods look ancient.
| ❌ The Old Way (Pain) | ✅ The `context` Way (Glory) |
|
|
We're not just concatenating files. We're building a high-signal, low-noise prompt with a sophisticated scoring algorithm that knows a README.md is more important than a test utility, and a main.py is more critical than a config file deep in a subdirectory.
🚀 Get Started in 60 Seconds
The context command will be available in your terminal after installation.
🍎 macOS & 🐧 Linux: Homebrew (Recommended)
This is the cleanest, most native experience.
# 1. Add the Tap (a one-time setup)
brew tap yigitkonur/context
brew install context
🪟 Windows & Others: pipx (Recommended)
pipx is the gold standard for installing Python CLI tools. It keeps things tidy and isolated.
# 1. Install pipx if you don't have it
python3 -m pip install --user pipx
python3 -m pipx ensurepath
# 2. Install the tool (from PyPI once published, or from GitHub for latest)
pipx install repo-to-llm-context
# OR for latest dev version: pipx install git+https://github.com/yigitkonur/code-to-clipboard-for-llms.git
✨ Zero Manual Setup: After installation, the
contextcommand should be ready to go. If not, just restart your terminal!
🎮 Usage: Fire and Forget
The workflow is dead simple.
1. Navigate to Your Project
cd /path/to/your/killer-app
2. Run the Command
context
Your clipboard is now loaded with perfectly formatted Markdown.
3. Paste & Prompt Go to your favorite LLM and paste the context. Now you can ask the real questions.
Output Control 🕹️
Don't want it on your clipboard? No problem.
- Save to a file:
context --output project_context.md
- Print directly to your terminal (for piping or peeking):
context --stdout
✨ Feature Breakdown: The Secret Sauce
| Feature | What It Does | Why You Care |
|---|---|---|
🧠 Smart FilteringNo junk allowed |
Auto-excludes node_modules, venv, builds, .git, logs & more |
Stops you from wasting tokens on garbage |
🎯 Relevance ScoringAI-optimized order |
Prioritizes files with a nuanced algorithm | Your LLM gets the most important info first |
🏗️ Project TreeVisual context |
Includes a tree-style view of what's included |
The AI (and you) can see the project structure |
⚙️ Git-AwareRespects your repo |
Can read your .gitignore and check tracking status |
Context matches your actual source code |
📋 Clipboard ReadyCmd+C on steroids |
Copies the entire formatted output in one go | Zero manual work between terminal and AI |
🔧 Hyper-ConfigurableYou're the boss |
Flags to include/exclude anything you want | Fine-tune the context for any weird project |
🔒 Privacy FirstNo path leaks |
Masks your local home directory path in the summary | Share your code, not your user folder |
⚙️ Advanced Usage & Customization
The defaults are great, but you can dial it in just right.
Expand for the full list of command-line flags
Filtering and Inclusion Control
--include PATTERN: Glob pattern to force inclusion of files/directories that might be excluded (e.g.,--include "config/**.yaml").--exclude PATTERN: Glob pattern to add custom exclusions beyond the defaults (e.g.,--exclude "*.log").--include-only: A powerful mode that includes only files matching--includepatterns, excluding everything else.--exclude-extension EXT: Exclude all files with a specific extension (e.g.,--exclude-extension .tmp).--include-extension EXT: Force include files with an extension that is normally excluded by default.
Override Default File Type Exclusions
--include-json: Include.json/.jsoncfiles.--include-yaml: Include.yaml/.ymlfiles.--include-xml: Include.xmlfiles.--include-html: Include.html/.htmfiles.--include-css: Include.cssfiles.--include-sql: Include.sqlfiles.--include-csv: Include.csv/.tsvfiles.--include-markdown: Include all Markdown files, not just the rootREADME.md.
Size and Content Control
--max-size SIZE: Exclude files larger than the specified size (e.g.,500k,10M). Default is2M.--include-binary: Attempt to include files detected as binary (default is to exclude them).--max-depth N: Limit scanning to a maximum directory depth.
Git Integration Behavior
--no-gitignore: (Default) Ignore.gitignorerules and Git tracking status entirely.--gitignore-only: Use.gitignorerules for exclusion but don't filter based on Git tracking status.--use-git: Use both.gitignorerules and only include files that are tracked by Git.
Output and Execution Behavior
--output FILE: Write output to a file instead of the clipboard.--stdout: Print the full output to the terminal.--no-clipboard: Disable automatic copying to the clipboard (useful when using--stdoutor--output).--preview: Show a summary of what would be included without processing files or generating output.--dry-run: Run the entire process but do not write any output to the clipboard, file, or stdout.--sort-alpha: Override the relevance-based sorting and sort files alphabetically instead.
🆚 Why This Slaps Other Methods
| Method | The Pain 😩 | The context Way 😎 |
|---|---|---|
| Manual Copy/Paste | You'll miss a file. You'll include junk. You'll hate your life. | One command. Perfect context. Every time. |
cat file1 file2 > out.txt |
Zero structure. No filtering. Still manual. Basically useless. | Auto-filters, adds a file tree, and formats beautifully. |
| Sharing a GitHub Link | LLM can't see local changes. Can't access private repos. | Works offline. Works on your latest, unpushed code. |
Simple tree command |
Shows structure but includes zero code content. | Gives you the full package: structure AND content. |
🛠️ For Developers & Tinkerers
Running from Source
Want to hack on the code? Easy.
-
Clone the repo:
git clone https://github.com/yigitkonur/code-to-clipboard-for-llms.git cd code-to-clipboard-for-llms
-
Set up a virtual environment and install in editable mode:
python3 -m venv venv source venv/bin/activate pip install -e .
Now, any change you make to
llmcontext.pywill be live on yourcontextcommand.
Fork & Customize
If you fork the repo, you can permanently change the default filters by editing the constants at the top of llmcontext.py.
🔥 Common Issues & Quick Fixes
Expand for troubleshooting tips
| Problem | Solution |
|---|---|
context: command not found |
Restart your terminal. 99% of the time, this is the fix. If not, run pipx ensurepath (for pipx) or check your PATH environment variable. |
| Clipboard isn't working | Linux users: You might need a clipboard utility. Run sudo apt install xclip or sudo pacman -S xclip. For any OS, you can always use --stdout or --output my_context.md to bypass the clipboard. |
.gitignore is ignored |
By default, git integration is off for speed. Use the --gitignore-only or --use-git flag to turn it on. |
| Script errors out | Make sure you're on Python 3.8 or newer (python3 --version). |
Built with 🔥 because manually crafting LLM prompts is a soul-crushing waste of time.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file repo_to_llm_context-2.2.0.tar.gz.
File metadata
- Download URL: repo_to_llm_context-2.2.0.tar.gz
- Upload date:
- Size: 24.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eaefa28d54dce423f6ec95a1bb30f88017aaa70fd070046a2799f3bbafc96326
|
|
| MD5 |
fa54ebf83d924d9b181c3adbcd18a75f
|
|
| BLAKE2b-256 |
60643dff74b2d07a64dd96c9b0cb6a74f4871121a0a71009d93281b706ab5ad6
|
File details
Details for the file repo_to_llm_context-2.2.0-py3-none-any.whl.
File metadata
- Download URL: repo_to_llm_context-2.2.0-py3-none-any.whl
- Upload date:
- Size: 19.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79a90c9cbb2fa4d3331edb1d4af420c1cc69a101809a2a1d40020786902cf39a
|
|
| MD5 |
9fee061906537b518e3974b909f4d9fa
|
|
| BLAKE2b-256 |
a4f6fe90e8f8a091e9c9eea5d09391fe0f245d6eb22886904e465396c5da2056
|