{"id":49889447,"url":"https://github.com/cbarkinozer/repo-context","last_synced_at":"2026-05-15T20:09:40.957Z","repository":{"id":303259949,"uuid":"1014815356","full_name":"cbarkinozer/repo-context","owner":"cbarkinozer","description":"RepoContext generates text context for your repo, allowing you to catch up with your LLM on the last state of the repo you're working on.","archived":false,"fork":false,"pushed_at":"2025-08-13T16:03:14.000Z","size":113,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-18T00:00:59.824Z","etag":null,"topics":["context","context-builder","llm","llm-context-builder","llm-context-generator","repo-context-builder"],"latest_commit_sha":null,"homepage":"https://repocontext.streamlit.app/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cbarkinozer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-06T13:24:26.000Z","updated_at":"2025-08-03T10:08:51.000Z","dependencies_parsed_at":"2025-07-06T17:30:56.801Z","dependency_job_id":"b12e7ba6-fa8c-4c4d-b2a0-c583e558db99","html_url":"https://github.com/cbarkinozer/repo-context","commit_stats":null,"previous_names":["cbarkinozer/repo-context"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cbarkinozer/repo-context","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbarkinozer%2Frepo-context","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbarkinozer%2Frepo-context/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbarkinozer%2Frepo-context/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbarkinozer%2Frepo-context/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cbarkinozer","download_url":"https://codeload.github.com/cbarkinozer/repo-context/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbarkinozer%2Frepo-context/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33078206,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T20:05:40.333Z","status":"ssl_error","status_checked_at":"2026-05-15T20:05:38.672Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["context","context-builder","llm","llm-context-builder","llm-context-generator","repo-context-builder"],"created_at":"2026-05-15T20:09:40.339Z","updated_at":"2026-05-15T20:09:40.934Z","avatar_url":"https://github.com/cbarkinozer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Repo to LLM Context Generator\n\n[![PyPI Version](https://img.shields.io/pypi/v/repo-context-generator.svg)](https://pypi.org/project/repo-context-generator/)\n[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://repo-context.streamlit.app/)\n\nAn intelligent context generator for Large Language Models. This tool analyzes a public **or private** GitHub repository, extracts key information, and formats it into a single, comprehensive text file. It is available as a command-line tool and as a web UI.\n\nYou can use this when:\n*   You need to provide context to a Large Language Model without a \"chat history\" feature.\n*   Your conversation with an LLM is going in circles and you need to restart with full context.\n*   You have questions about a repository's implementation, dependencies, or structure.\n\n## The Problem\n\nWhen working with Large Language Models on a software project, providing the full context of a repository is challenging:\n\n1.  **Limited Context Windows:** LLMs can't read an entire codebase at once.\n2.  **Tedious Manual Work:** Manually copying and pasting dozens of files is slow and error-prone.\n3.  **Irrelevant \"Noise\":** A raw dump includes useless \"noise\" for an LLM, such as `node_modules`, `__pycache__`, and build artifacts, which wastes precious context space.\n4.  **Lack of Structure:** A simple concatenation of files makes it hard for the LLM to distinguish where one file ends and another begins.\n\nThis tool solves these problems by creating a clean, intelligent, and structured snapshot of your repository's current state.\n\n## ✨ Key Features\n\n*   **Dual Interface:** Use the friendly [web UI](https://repo-context.streamlit.app/) or the powerful command-line tool (`repo-context`) for easy integration into scripts.\n*   **Pip Installable:** Easily install the tool with a single command: `pip install repo-context-generator`.\n*   **Private Repository Support:** Securely analyze private repositories using a GitHub Personal Access Token (PAT).\n*   **Automated Dependency Analysis:** Detects tech stacks (`Python`, `JavaScript`, etc.) and lists dependencies from common package files.\n*   **Intelligent File Tagging:** Adds heuristic tags like `[⭐ Likely Project Entry Point]` to guide the LLM's focus.\n*   **Intelligent Filtering:** Automatically respects the repository's `.gitignore` file and excludes common non-essential files.\n*   **Rich Metadata Header:** The context starts with a header including the repo URL, timestamp, and latest commit details.\n\n## ⚙️ Installation\n\nInstall the package directly from PyPI:\n\n```bash\npip install repo-context-generator\n```\n\n## 🚀 Usage\n\nYou can use the tool via the **Web UI** or the **Command-Line**.\n\n### 🖥️ Command-Line Interface\n\nOnce installed, you can use the `repo-context` command in your terminal.\n\n**1. Generate context and print to console:**\n\n```bash\nrepo-context \"https://github.com/user/repo\"\n```\n\n**2. Save context to a file:**\n\n```bash\nrepo-context \"https://github.com/user/repo/tree/main\" -o my_project_context.md\n```\n\n**3. Analyze a private repository:**\nYou can provide a token via the `--token` flag or the `GITHUB_TOKEN` environment variable.\n\n```bash\n# Using a flag\nrepo-context \"https://github.com/private-user/private-repo\" --token YOUR_GITHUB_PAT\n\n# Or by setting an environment variable\nexport GITHUB_TOKEN=\"YOUR_GITHUB_PAT\"\nrepo-context \"https://github.com/private-user/private-repo\"\n```\n\n**4. See all available options:**\n\n```bash\nrepo-context --help\n```\n\n### 🌐 Web UI\n\n**Try the app live here:** [https://repo-context.streamlit.app/](https://repo-context.streamlit.app/)\n\n1.  Navigate to the deployed Streamlit application.\n2.  Paste the full URL of a public or private GitHub repository.\n3.  **For private repositories,** expand the \"🔑 Private Repository Access\" section and paste your Personal Access Token (PAT).\n4.  Configure any optional settings, like file extensions or line limits.\n5.  Click the **\"🚀 Generate Intelligent Context\"** button.\n6.  Use the **\"📥 Download Context.md\"** button to save the output.\n\n---\n\n## 📝 Example Output Structure\n\nThe generated output is a single, enriched Markdown file designed to be easily parsed by an LLM.\n\n```markdown\n# LLM CONTEXT SNAPSHOT\n- **Repository Source:** https://github.com/user/my-python-app\n- **Branch:** main\n- **Snapshot Timestamp:** 2025-07-19 20:55:00 UTC\n- **Last Commit Hash:** a1b2c3d4e5f6g7h8i9j0\n- **Last Commit Message:** \"feat: Implement user authentication\"\n- **Detected Technology Stack:** Python\n```\n---\n\n# 1. Project Dependencies Analysis\n\n**Dependencies (`requirements.txt`):**\n```txt\nstreamlit==1.33.0\ngitpython==3.1.43\npyyaml==6.0.1\n```\n\n# 2. Repository File Structure\n\n```txt\n📂 my-python-app\n├── 📄 .gitignore\n├── 📄 app.py\n├── 📄 README.md\n└── 📄 requirements.txt\n```\n\n---\n# 3. File Contents\n\n--- FILE: app.py [⭐ Likely Project Entry Point] (Lines: 152 | Chars: 4891 | Funcs/Classes: 6) ---\n```python\nimport streamlit as st\n# ... rest of the file content\n```\n---\n\n## 💻 Running for Development\n\nTo contribute to this project or run the web UI locally, follow these steps.\n\n**Prerequisites:**\n*   Python 3.8+\n*   Git command-line tool\n\n**Setup:**\n\n1.  **Clone the repository:**\n    ```bash\n    git clone https://github.com/cbarkinozer/repo-context.git\n    cd repo-context\n    ```\n\n2.  **Create and activate a virtual environment:**\n    ```bash\n    # For macOS/Linux\n    python3 -m venv venv\n    source venv/bin/activate\n\n    # For Windows\n    python -m venv venv\n    .\\venv\\Scripts\\activate\n    ```\n\n3.  **Install the project in editable mode:**\n    This command reads the `pyproject.toml` file and installs all necessary dependencies, including Streamlit.\n    ```bash\n    pip install -e .\n    ```\n\n4.  **Run the Streamlit app:**\n    ```bash\n    streamlit run app.py\n    ```\nThe application should now be running at `http://localhost:8501`.\n\n## 🛠️ Technologies Used\n\n*   **Framework:** [Streamlit](https://streamlit.io/)\n*   **Language:** Python 3\n*   **CLI:** `argparse`\n*   **Git Operations:** [GitPython](https://gitpython.readthedocs.io/en/stable/)\n*   **File Parsing:** [gitignore-parser](https://pypi.org/project/gitignore-parser/), [tomli](https://pypi.org/project/tomli/), [PyYAML](https://pypi.org/project/PyYAML/)\n\n## 📄 License\n\nThis project is licensed under the MIT License. See the `LICENSE` file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbarkinozer%2Frepo-context","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcbarkinozer%2Frepo-context","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbarkinozer%2Frepo-context/lists"}