Convert Git repositories into LLM-friendly context format
Project description
repo-context
Convert Git repositories into LLM-friendly context format. This tool processes local repositories or GitHub URLs and generates a formatted file suitable for use with Large Language Models.
Features
- Process local Git repositories or GitHub URLs
- Configurable file ignore patterns
- Progress tracking with rich console output
- Markdown-formatted output optimized for LLM context
- Built with UV package manager support
Installation
Using UV:
uv venv
uv pip install repo-context
From source:
git clone https://github.com/mathiasesn/repo-context
cd repo-context
uv venv
uv pip install -e .
Usage
Command Line Interface
Basic usage:
repo-context /path/to/local/repo
repo-context https://github.com/username/repo
Options:
repo-context --help
usage: repo-context [-h] [--output OUTPUT] [--ignore IGNORE [IGNORE ...]] source
Convert a repository into LLM-friendly context
positional arguments:
source Local path or GitHub URL to repository
options:
-h, --help show this help message and exit
--output OUTPUT, -o OUTPUT
Output file path (default: context.md)
--ignore IGNORE [IGNORE ...]
Patterns to ignore (default: ['.git', '__pycache__', '*.pyc', '*.pyo', '*.pyd', '.DS_Store'])
Python API
from repo-context import RepoConverter
converter = RepoConverter(ignore_patterns=[".git", "*.pyc"])
context = converter.convert("/path/to/repo")
Output Format
The tool generates a Markdown file with the following structure:
# File: path/to/file1
```
[file1 content]
```
# File: path/to/file2
```
[file2 content]
```
Development
Requirements:
- Python >=3.12
- UV package manager
Setup development environment:
uv venv
uv pip install -e ".[dev]"
Run tests:
pytest tests/
License
MIT License
Contributing
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
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
File details
Details for the file repo_context-0.4.0.tar.gz
.
File metadata
- Download URL: repo_context-0.4.0.tar.gz
- Upload date:
- Size: 36.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 094f5d218cdda2d77e89149d1854b965a77c5d0032a926cb5ad357eff1c3f094 |
|
MD5 | e79208751dd12d1503d484d6f4290566 |
|
BLAKE2b-256 | 976a074e14e36e1abd49ce55f8824068dfeb20b450dd753d16312f92d0a22412 |
Provenance
The following attestation bundles were made for repo_context-0.4.0.tar.gz
:
Publisher:
publish.yaml
on mathiasesn/repo-context
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
repo_context-0.4.0.tar.gz
- Subject digest:
094f5d218cdda2d77e89149d1854b965a77c5d0032a926cb5ad357eff1c3f094
- Sigstore transparency entry: 165711091
- Sigstore integration time:
- Permalink:
mathiasesn/repo-context@4a6ef1ecc7b371fbb6f492a190a5fbd2a0d591e6
- Branch / Tag:
refs/tags/0.4.0
- Owner: https://github.com/mathiasesn
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
publish.yaml@4a6ef1ecc7b371fbb6f492a190a5fbd2a0d591e6
- Trigger Event:
release
- Statement type:
File details
Details for the file repo_context-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: repo_context-0.4.0-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 442790f3d725eceb5937031f8f21b2d981009169b37070c717fca6ee56796925 |
|
MD5 | b19a9f0bb7d1b6102ea85226b6afe5c2 |
|
BLAKE2b-256 | 391b45ea497116f14295fa6e480443fd41a1a52d9dd7ff418993b9bf959cfdcf |
Provenance
The following attestation bundles were made for repo_context-0.4.0-py3-none-any.whl
:
Publisher:
publish.yaml
on mathiasesn/repo-context
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
repo_context-0.4.0-py3-none-any.whl
- Subject digest:
442790f3d725eceb5937031f8f21b2d981009169b37070c717fca6ee56796925
- Sigstore transparency entry: 165711096
- Sigstore integration time:
- Permalink:
mathiasesn/repo-context@4a6ef1ecc7b371fbb6f492a190a5fbd2a0d591e6
- Branch / Tag:
refs/tags/0.4.0
- Owner: https://github.com/mathiasesn
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
publish.yaml@4a6ef1ecc7b371fbb6f492a190a5fbd2a0d591e6
- Trigger Event:
release
- Statement type: