CLI tool for extracting GitHub repo code to a single file
Top 42.2% on sourcepulse
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
conda create -n g2f python=3.10 && conda activate g2f && pip install -r requirements.txt
requests
library.github2file-tkinter-GUI.py
.Highlighted Details
ts-js-rust2file.py
) for TypeScript, JavaScript, Svelte, and Rust.github2file-tkinter-GUI.py
) for easier usage.--claude
option for specific output formatting.Maintenance & Community
No specific contributors, sponsorships, or community links (Discord/Slack) are mentioned in the README.
Licensing & Compatibility
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.
6 months ago
Inactive