by JeremiahPetersen via GitHub · MIT licensed · 90 versions
Open source, kept here so you can read it and make your own copy. Not our work.
Turn an entire GitHub Repo into a single organized .txt file to use with LLM's (ChatGPT, Claude, Gemini, etc)
About this project (the project's own write-up)
RepoToText
RepoToText is a web app that scrapes a GitHub repository and converts its files into a single organized .txt. It allows you to enter the URL of a GitHub repository and an optional documentation URL (the doc info will append to the top of the .txt). The app retrieves the contents of the repository, including all files and directories, and also fetches the documentation from the provided URL and includes it in a single organized text file. The .txt file will be saved in the /data folder with user + repo + timestamp info. This file can then be uploaded to (GPT-4, Claude Opus, etc) and you can use the chatbot to interact with the entire GitHub repo.
Demo
Creating a React front end for a GitHub repo containing a functioning back end:
https://chat.openai.com/share/0670c1ec-a8a8-4568-ad09-bb9b152e1f0b
Working front-end project: https://github.com/JeremiahPetersen/CaseConnect/tree/front-end
Running the Application with Docker
To run the application using Docker, follow these steps:
- Clone the repository. Create a .env file in the root folder.
- Set up the environment variable
GITHUB_API_KEYin the.envfile. - Build the Docker images with
docker compose build. - Start the containers with
docker compose up. - Access the application (http://localhost:3000) in a web browser and enter the GitHub repository URL and documentation URL (if available).
- Choose All files or choose specific file types.
- Click the "Submit" button to initiate the scraping process. The converted text will be displayed in the output area, and it will also be saved in the /data folder.
- You can also click the "Copy Text" button to copy the generated text to the clipboard.
Prompt Example
This is a .txt file that represents an entire GitHub repository. The repository's individual files are separated by the sequence '''--- , followed by the file path, ending with ---. Each file's content begins immediately after its file path and extends until the next sequence of '''--- Add your idea here (Example): Please create a react front end that will work with the back end
Environment Configuration
Add your GitHub API Key in the .env file
GITHUB_API_KEY='YOUR GITHUB API KEY HERE'
FolderToText
FolderToText.py is a script that allows you to turn a local folder, or local files, into a .txt in the same way RepoToText.py does. Choose your files with browse (you can continue adding by clicking "Browse". Once you have all of your files selected and uploaded with browse, type in the file type endings you want to copy with a ',' in between. Example: .py , .js , .md , .ts ---> You can also turn this off and it will add every file you uploaded to the .txt ---> Last, enter in the file name you want to appear and the output path. The file will be written with your file name choice and a timestamp.
Info
- Creates a .txt with ('''---) separating each file from the repo.
- Each file from the repo has a header after ('''---) with the file path as the title.
- The .txt file is saved in the /data folder
- You can add a URL to a documentation page and the documentation page will append to the top of the .txt file (great to use for tech that came out after Sep 2021).
Tech Used
- Frontend: React.js
- Backend: Python Flask
- Containerization: Docker
- GitHub API: PyGithub library
- Additional Python libraries: beautifulsoup4, requests, flask_cors, retry
TODO
- [x] Add Docker to project
- [x] Add Dark Mode
- [ ] Build web app for (https://repototext.com/)
- [ ] FIX: Broken file types: .ipynb
- [ ] FIX: FolderToText - fix so a user can pick one folder (currently only working when user selects individual files)
- [ ] Add in the ability to work with private repositories
- [ ] Add ability to store change history and update .txt to reflect working changes
- [ ] Add function to make sure .txt is current repo version
- [ ] Adjust UI for flow, including change textarea output width, adding file management and history UI
Versions (90 — latest: Update README.md)
- Version 90 — May 29, 10:48am — Update README.md latest
- Version 89 — Apr 15, 10:56pm — Update README.md - Update ToDo
- Version 88 — Apr 15, 6:34pm — Update RepoToText.py - clean code
- Version 87 — Apr 15, 6:31pm — Update RepoToText.py -- pylint disable line too long
- Version 86 — Apr 15, 6:27pm — Update RepoToText.py - Add Dark Mode, Add Error Handling
- Version 85 — Apr 15, 6:26pm — Update App.js - Add Dark Mode
- Version 84 — Apr 15, 6:25pm — Update App.css - Add Dark Mode
- Version 83 — Apr 2, 6:16pm — Update ToDo
- Version 82 — Mar 25, 1:41pm — Update README.md -- Added Demo
- Version 81 — Mar 9, 7:18pm — Update README.md move prompt info
- Version 80 — Mar 9, 7:17pm — Update README.md re order running app
- Version 79 — Mar 9, 6:56pm — Update README.md add Claude Opus
- Version 78 — Mar 7, 11:54pm — Update App.js added filetypes 'svg' 'cs'
- Version 77 — Mar 6, 7:22pm — Update docker-compose.yml
- Version 76 — Aug 8, 2:23pm — readme adjust
- Version 75 — Aug 8, 2:22pm — added Docker Compose V2
- Version 74 — Aug 6, 6:51pm — fixed readme .txt save location
- Version 73 — Aug 6, 5:54pm — fix readme .txt save location
- Version 72 — Aug 6, 4:50pm — README fix
- Version 71 — Aug 6, 4:48pm — Added Docker
- Version 70 — Aug 6, 11:56am — readme adjusted
- Version 69 — Aug 6, 11:55am — readme adjust
- Version 68 — Aug 4, 12:39am — Update README.md
- Version 67 — Jul 29, 11:35am — Delete JeremiahPetersen_Textizer_20230729082518.txt
- Version 66 — Jul 29, 11:26am — added error handling for decoding errors
- Version 65 — Jul 29, 10:32am — clean code
- Version 64 — Jul 29, 10:23am — clean code
- Version 63 — Jul 29, 1:39am — fix Github import
- Version 62 — Jul 29, 12:27am — clean code
- Version 61 — Jul 28, 11:59pm — clean requirements.txt
- Version 60 — Jul 28, 11:54pm — clean code
- Version 59 — Jul 28, 11:42pm — edit es-lint.yml
- Version 58 — Jul 28, 11:39pm — fix .eslintrc.yml
- Version 57 — Jul 28, 11:34pm — clean code
- Version 56 — Jul 28, 11:27pm — update requirements.txt
- Version 55 — Jul 28, 11:22pm — clean code
- Version 54 — Jul 28, 11:18pm — clean code
- Version 53 — Jul 28, 11:13pm — added prettier dev dep
- Version 52 — Jul 28, 11:11pm — added eslint as a dev dep
- Version 51 — Jul 28, 11:08pm — add .eslintrc.yml
- Version 50 — Jul 28, 11:01pm — fix indentation
- Version 49 — Jul 28, 10:59pm — clean code
- Version 48 — Jul 28, 10:53pm — clean code
- Version 47 — Jul 28, 10:51pm — clean code
- Version 46 — Jul 28, 10:46pm — clean code
- Version 45 — Jul 28, 10:38pm — add ESLint & Pylint
- Version 44 — Jul 22, 1:58am — cleaned up css
- Version 43 — Jul 20, 5:55pm — fix ignore
- Version 42 — Jul 20, 5:46pm — remove
- Version 41 — Jul 20, 5:43pm — Merge branch 'main' of https://github.com/JeremiahPetersen/RepoToText
- Version 40 — Jul 20, 5:43pm — added in .gitignore
- Version 39 — Jul 18, 12:08pm — Update index.html
- Version 38 — Jul 17, 7:29pm — Update README.md
- Version 37 — Jul 17, 6:46pm — Added .gitignore
- Version 36 — Jul 17, 6:46pm — Removed node_modules folder accidental upload
- Version 35 — Jul 15, 1:11pm — Update README.md
- Version 34 — Jul 14, 6:39pm — Update README.md
- Version 33 — Jul 12, 4:08pm — Update README.md
- Version 32 — Jul 12, 4:07pm — Update FolderToText.py
- Version 31 — Jul 12, 3:19pm — Update README.md
- Version 30 — Jul 12, 3:15pm — Create FolderToText.py
- Version 29 — Jul 10, 9:57pm — Merge branch 'main' of https://github.com/JeremiahPetersen/RepoToText
- Version 28 — Jul 10, 9:55pm — Added file type entry
- Version 27 — Jul 10, 9:50pm — Update README.md
- Version 26 — Jul 10, 8:35pm — Update README.md
- Version 25 — Jul 10, 8:30pm — Added File Type Selection Option
- Version 24 — Jul 10, 4:09pm — Update README.md
- Version 23 — Jul 10, 2:59pm — Update README.md
- Version 22 — Jul 9, 6:55pm — Update LICENSE
- Version 21 — Jul 9, 6:53pm — Create LICENSE
- Version 20 — Jul 9, 5:15pm — Update README.md
- Version 19 — Jul 9, 5:14pm — Update README.md
- Version 18 — Jul 9, 4:47pm — Update README.md
- Version 17 — Jul 9, 4:37pm — Update README.md
- Version 16 — Jul 9, 4:25pm — Update README.md
- Version 15 — Jul 9, 4:23pm — Update README.md
- Version 14 — Jul 9, 3:26pm — Update README.md
- Version 13 — Jul 9, 3:09pm — Update README.md
- Version 12 — Jul 9, 2:55pm — Update README.md
- Version 11 — Jul 9, 2:22pm — Update README.md
- Version 10 — Jul 9, 12:46am — Update README.md
- Version 9 — Jul 9, 12:46am — Update README.md
- Version 8 — Jul 9, 12:46am — Update README.md
- Version 7 — Jul 9, 12:36am — Create requirements.txt
- Version 6 — Jul 8, 11:03pm — Added base Python back React front
- Version 5 — Jul 8, 10:42pm — Update README.md
- Version 4 — Jul 8, 10:41pm — Update README.md
- Version 3 — Jul 8, 10:37pm — Update README.md
- Version 2 — Jul 8, 10:37pm — Update README.md
- Version 1 — Jul 8, 10:27pm — Initial commit
Files (29 · 1.3 MB)
- .github/2 files · 1.7 KB
- public/6 files · 21.2 KB
- src/8 files · 11.6 KB
- .eslintrc.yml219 bytes
- .gitignore144 bytes
- .prettierrc.json110 bytes
- Dockerfile.backend402 bytes
- Dockerfile.frontend353 bytes
- FolderToText.py6.3 KB
- LICENSE1.1 KB
- README.md4.5 KB
- RepoToText.py5.4 KB
- docker-compose.yml318 bytes
- package-lock.json1.3 MB
- package.json1.4 KB
- requirements.txt55 bytes
Open a version to see exactly what changed in it, or download the zip for everything.
Get it on your computer
With the Library Mode tool: librarymode get ken/repototext
Or tell Claude Code / OpenCode: "get ken/repototext from Library Mode"