Repo2Txt is a Next.js-based web application that allows users to download the contents of a GitHub repository as a single text file. This tool is particularly useful for training Language Learning Models (LLMs) on repository-specific content.
- Fetch and display the directory structure of any public GitHub repository
- Support for private repositories using GitHub Personal Access Tokens
- Filter files by extension
- Select specific files or entire directories for download
- Download selected files as a single concatenated text file
- Syntax highlighting for various programming languages
- Responsive design for both desktop and mobile use
To run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Then open http://localhost:3000 in your browser to see the application.
- Enter a GitHub repository URL in the input field.
- (Optional) Enter a GitHub Personal Access Token for private repositories or increased API rate limits.
- Click "Fetch Directory Structure" to load the repository contents.
- Use the file tree to select which files you want to include.
- Filter files by extension using the checkboxes provided.
- Click "Download into txt" to generate and download a single text file with the contents of all selected files.
The main application logic is located in src/app/page.tsx
. The project uses Next.js with TypeScript and Tailwind CSS for styling.
Contributions to Repo2Txt are welcome! If you'd like to contribute, feel free to submit a pull request.
If you encounter any problems or have ideas for new features, please open an issue on the GitHub repository.
This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License. This means you are free to share and adapt the material, under the following terms:
- Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made.
- NonCommercial — You may not use the material for commercial purposes.
For more details, see the LICENSE file or visit Creative Commons BY-NC 4.0.
Copyright (c) 2024 Ali Hamza Kamboh