github2file  by QuixiAI

CLI tool for extracting GitHub repo code to a single file

created 1 year ago
868 stars

Top 42.2% on sourcepulse

GitHubView on GitHub
Project Summary

This Python script converts GitHub repositories into single files, ideal for feeding codebases into large-context AI models. It supports public and private repos, language filtering, and optional comment removal, streamlining code sharing for AI-assisted development and analysis.

How It Works

The script clones a specified GitHub repository, optionally filters files by language or excludes directories/types, and then concatenates the content of the selected files into a single output file. For Python files, it can optionally strip comments and docstrings to reduce token count. A separate script handles TypeScript, JavaScript, Svelte, and Rust.

Quick Start & Requirements

  • Install via Conda: conda create -n g2f python=3.10 && conda activate g2f && pip install -r requirements.txt
  • Requires Python 3.x and the requests library.
  • Official documentation and GUI available at github2file-tkinter-GUI.py.

Highlighted Details

  • Supports public and private GitHub repositories.
  • Filters files by language (Python, Markdown, Go, JavaScript) and allows directory/file type exclusion.
  • Optional removal of comments and docstrings from Python code.
  • Includes a separate script (ts-js-rust2file.py) for TypeScript, JavaScript, Svelte, and Rust.
  • Offers a GUI interface (github2file-tkinter-GUI.py) for easier usage.
  • Includes a --claude option for specific output formatting.

Maintenance & Community

No specific contributors, sponsorships, or community links (Discord/Slack) are mentioned in the README.

Licensing & Compatibility

  • MIT License.
  • Permissive license suitable for commercial use and integration with closed-source projects.

Limitations & Caveats

The script's effectiveness relies on the AI model's ability to interpret the concatenated code. The README does not detail specific error handling for large repositories or complex project structures.

Health Check
Last commit

6 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
4 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.