A Python script that generates a text representation of a repository's structure and content.
- Creates a tree-like visualization of directories and files
- Dumps file contents into a single output file
- Excludes common unwanted directories (
.git,node_modules, etc.) - Optional filtering of media files and directories
- Configurable recursion depth
git clone https://github.com/KirnoNTX/Repo2Text.gitchmod +x repo2text./repo2textor
./repo2text [-s] [-r DEPTH]
Options:
-s, --small Exclude media files (images, videos, etc.)
-r, --recursive Set maximum depth for directory explorationCreates repo2text.txt containing:
- Tree structure of the repository
- Content of all readable files
- Directories:
.git,node_modules,dist,test, etc. - Files:
package-lock.json, log files, temporary files - Binary and media files (when using
-sflag)
- UTF-8 encoding errors are logged but don't stop execution
- Missing permissions or invalid paths are reported with error messages
MIT | @Kirno