A newer version of the Gradio SDK is available:
5.35.0
metadata
title: repo2txt
emoji: 🗃️
colorFrom: blue
colorTo: blue
sdk: gradio
sdk_version: 4.42.0
app_file: app.py
pinned: true
license: mit
short_description: GitHub repo to text file converter for easy archiving & LLM
repo2txt
repo2txt
is a Python package that clones a GitHub repository, generates a text file containing the repository's directory structure and the contents of all its files, and handles cleanup.
Installation
You can install repo2txt
using pip:
pip install git+https://github.com/blaisewf/repo2txt.git
Alternatively, you can clone the repository and install it locally:
git clone https://github.com/blaisewf/repo2txt.git
cd repo2txt
pip install .
Git is required to clone the repository. If you don't have Git installed, you can download it from git-scm.com.
Usage
Once installed, you can use the CLI command repo2txt
to process a GitHub repository. Here’s the basic syntax:
repo2txt --repo-url <repository_url> --output-file <output_file_path>
Example
repo2txt --repo-url https://github.com/example/repository.git --output-file output.txt
This command will:
- Clone the repository from
https://github.com/example/repository.git
. - Generate a text file
output.txt
containing the directory structure and contents of all files in the repository. - Clean up the cloned repository directory.
License
This project is licensed under the MIT License. See the LICENSE file for details.