Skip to content

michael-farah/repo2txt-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

118 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

repo2txt-extension-logo

repo2txt-extension

Convert any repo to LLM-ready text โ€” in one click

License: MIT Install from Releases GitHub Stars Privacy First

repo2txt-extension-banner

Overview

repo2txt-extension is a privacy-first browser extension that converts GitHub repositories and local folders into plain text optimized for LLM prompts. Whether you're analyzing code with ChatGPT, Claude, or any other AI assistant, this tool gets your codebase ready in seconds โ€” without ever uploading your code to a server.

๐Ÿ”’ 100% Client-Side โ€ข ๐Ÿš€ One-Click Conversion โ€ข ๐ŸŒ GitHub + Local Files


โœจ Features

๐Ÿ“ Multiple Sources

  • GitHub โ€” Public and private repositories with personal access token support
  • Local Files โ€” Native directory picker for projects on your machine
  • Zip Upload โ€” Drag and drop zip files for instant conversion

๐Ÿ” Smart Filtering

  • Extension Filter โ€” Select and deselect by file type in one click
  • Gitignore Support โ€” Automatically respects .gitignore patterns
  • Custom Patterns โ€” Add your own ignore rules on the fly
  • Directory Selection โ€” Cherry-pick specific folders from the tree
  • File Tree Preview โ€” Visual file selection with virtual scrolling

โšก Performance

  • Virtual Scrolling โ€” Handles repositories with 10,000+ files smoothly
  • Code Splitting โ€” Lazy-loaded providers for optimal bundle size
  • Web Workers โ€” Tokenization runs in background threads
  • Progressive Loading โ€” Streams file contents as they load
  • Smart Caching โ€” Efficient memory usage for large repositories

๐ŸŽจ Modern UX

  • Dark Mode โ€” System, light, and dark themes
  • Responsive Design โ€” Works on desktop, tablet, and mobile
  • Token Counter โ€” Real-time GPT token counting
  • File Statistics โ€” Per-file token and line counts
  • Progress Indicators โ€” Clear visual feedback during loading
  • GitHub Integration โ€” "Convert to Text" button injected on GitHub repo pages

๐Ÿ›ก๏ธ Privacy First

  • 100% Client-Side โ€” No server uploads, all processing is local
  • No Tracking โ€” Your code never leaves your device
  • Encrypted Storage โ€” GitHub tokens encrypted with per-install keys
  • Open Source โ€” Fully auditable codebase

๐Ÿš€ Installation

From GitHub Releases (Recommended)

This is the quickest way to get started โ€” no coding or terminal required.

  1. Download the latest .zip from the Releases page

  2. Unzip the file to a folder on your computer

  3. Open your browser's extensions page โ€” type one of the following into your address bar:

    Browser URL
    Chrome chrome://extensions
    Edge edge://extensions
    Brave brave://extensions
    Opera opera://extensions
    Vivaldi vivaldi://extensions
    Arc chrome://extensions
  4. Enable "Developer mode" โ€” toggle the switch in the top-right corner of the extensions page

  5. Click "Load unpacked" โ€” select the unzipped folder

  6. Pin the extension to your toolbar โ€” click the puzzle piece icon ๐Ÿงฉ and pin repo2txt

๐Ÿ’ก Tip: This extension works on all Chromium-based browsers. If your browser isn't listed above, try chrome://extensions โ€” it often works as a fallback.

From Source (For Developers)

# Clone the repository
git clone https://github.com/michael-farah/repo2txt-extension.git
cd repo2txt-extension

# Install dependencies
bun install

# Build the extension
bun run build

# Then load the dist/ folder as an unpacked extension (see steps 3โ€“6 above)

Distribution Build

bun run build:crx

Creates:

  • release/repo2txt-v{version}.zip โ€” for self-hosted distribution
  • release/repo2txt-v{version}.crx โ€” for direct installation

๐Ÿ“– Usage

GitHub Repository

  1. Click the extension icon in your toolbar
  2. Paste a GitHub URL: https://github.com/facebook/react
  3. Optionally add a personal access token for:
    • Private repositories
    • Higher rate limits (5,000 vs 60 requests/hour)
  4. Click "Load Repository"
  5. Select files using the tree or extension filters
  6. Click "Generate"
  7. Copy to clipboard or download as .txt

Pro tip: Visit any GitHub repo page and click the "Convert to Text" button injected into the page header.

Supported URL Formats

https://github.com/owner/repo                           (default branch)
https://github.com/owner/repo/tree/branch-name          (specific branch)
https://github.com/owner/repo/tree/branch-name/path     (subfolder)

โœ“ Branch names with slashes (e.g., feature/test/branch-name) are fully supported.

Local Files

  1. Switch to the "Local" provider tab
  2. Choose "Directory" or "Zip File"
  3. Select your project folder or upload a zip
  4. Use the same filtering and export options as GitHub

๐Ÿ—๏ธ Tech Stack

Category Technology
Framework React 19 + TypeScript
Build Tool Vite 5
Styling Tailwind CSS 3
State Management Zustand
File Handling JSZip
Tokenization gpt-tokenizer (Web Worker)
Virtual Scrolling TanStack Virtual
Testing Vitest + Playwright

๐ŸŒ Browser Support

Browser Status Notes
Chrome โœ… Supported Manifest V3, service workers, chrome.storage.local
Edge โœ… Supported Compatible with Chrome extensions
Brave โœ… Supported Compatible with Chrome extensions
Opera โœ… Supported Compatible with Chrome extensions
Vivaldi โœ… Supported Compatible with Chrome extensions
Arc โœ… Supported Compatible with Chrome extensions
Firefox ๐Ÿ“‹ Planned Requires browser-polyfill and MV3 adjustments
Safari ๐Ÿ“‹ Planned Requires Xcode project and App Store distribution

Contributions for cross-browser support are welcome!


๐Ÿ”ฎ Future Providers

Support for additional Git hosting platforms is under consideration:

  • GitLab โ€” API authentication, self-hosted instances, different rate limits
  • Bitbucket โ€” API authentication, different repository structure
  • Gitea/Forgejo โ€” Self-hosted instances, API versioning

To contribute a new provider, extend BaseProvider and implement fetchTree, fetchFile, validateUrl, and parseUrl. See src/features/github/GitHubProvider.ts for reference.


๐Ÿค Contributing

See CONTRIBUTING.md for the development guide and architecture details.

git clone https://github.com/michael-farah/repo2txt-extension.git
cd repo2txt-extension
bun install
bun run test:unit
bun run build

๐Ÿ™ Acknowledgments

This extension forks repo2txt by Abin Thomas. The original web version lives at abinthomas.in/repo2txt. Core architecture, provider system, and UI design come from the original project.


๐Ÿ“„ License

MIT License ยฉ Michael Farah


About

Browser extension tool that converts GitHub repository contents into a single formatted text file

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages