Convert any GitHub repository into a clean, structured, and LLM-ready text digest.
git2txt is a web-based tool that fetches a GitHub repository, processes its contents, and transforms it into a single, well-structured text output optimized for use with large language models (LLMs).
It provides:
- A summarized overview of the repository
- A directory tree structure
- Full file contents (with syntax highlighting)
- A downloadable
.txtdigest
1. Repository Digesting
- Accepts public or private GitHub repositories
- Parses repository structure and files
- Filters files based on size, count, and patterns
2. LLM-Ready Output
- Produces a clean, prompt-friendly text format
- Includes:
- Summary (metadata, stats)
- Directory structure
- File contents
3. Interactive UI
- Built with Next.js (App Router)
- Tab-based interface:
- Summary
- Directory Tree
- Files Content
- Expand/collapse file previews
- Syntax-highlighted code blocks
4. Streaming API
- Uses Server-Sent Events (SSE) for real-time progress updates
- Provides feedback during processing
5. Download & Copy
- Copy digest directly to clipboard
- Download as
.txtfile
Frontend
- Next.js (App Router)
- Tailwind CSS + shadcn/ui components
- Custom hooks for state management (
useDigest)
Backend (API Route)
/api/digest- Streams progress using SSE
- Fetches repository data via GitHub API
Core Logic
Located in /lib:
github.ts→ Fetches repo databuildTree.ts→ Generates directory structureformatter.ts→ Formats final digesthighlighter.ts→ Syntax highlightingparseRepoUrl.ts→ Parses user input
- User inputs a GitHub repository URL
- The app parses the repo (owner/repo)
- API route fetches repository data
- Files are filtered and processed
- A structured digest is generated
- UI displays:
- Summary
- Tree
- Files
- User can copy or download the result
Users can configure:
- Max file size (KB)
- Max number of files
- Include patterns (glob)
- Exclude patterns (glob)
- GitHub Personal Access Token (for private repos)
- GitHub tokens are sent only to GitHub API
- No persistent storage of sensitive data
- Runs entirely in the browser (frontend-driven)
- Preparing repositories for LLM analysis
- Codebase summarization
- Documentation generation
- AI-assisted code reviews
- Next.js
- React
- Tailwind CSS
- shadcn/ui
- TypeScript
- GitHub REST API
MIT © Holiday