MCPcopy
hub / github.com/abinthomasonline/repo2txt

github.com/abinthomasonline/repo2txt @main sqlite

repository ↗ · DeepWiki ↗
307 symbols 660 edges 88 files 117 documented · 38%
README

repo2txt

Deploy License: MIT

💡 Looking for the classic version? Check out repo2txt-classic

Convert repositories to plain text for LLM prompts Fast, browser-based tool for AI-assisted development

🔗 Try it now →

✨ Features

🔌 Multiple Sources

  • GitHub - Public and private repositories with token support
  • Local Files - Directory picker for your local projects
  • Zip Upload - Drag & drop zip files
  • GitLab (Beta) - GitLab repository support
  • Azure DevOps (Beta) - Azure Repos integration

🎯 Smart Filtering

  • Extension Filter - Select/deselect by file type
  • Gitignore Support - Automatically respect .gitignore patterns
  • Custom Patterns - Add your own ignore patterns
  • Directory Selection - Cherry-pick specific folders
  • File Tree Preview - Visual file selection with virtual scrolling

🚀 Performance

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

🎨 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 feedback during loading

🔒 Privacy First

  • 100% Browser-Based - No server uploads, all processing is local
  • No Tracking - Your code never leaves your device
  • Secure - GitHub tokens stored in sessionStorage only
  • Open Source - Fully auditable codebase

🚀 Quick Start

Use Online

Visit abinthomas.in/repo2txt - no installation needed!

Run Locally

# Clone the repository
git clone https://github.com/abinthomasonline/repo2txt.git
cd repo2txt

# Install dependencies
npm install

# Start dev server
npm run dev

# Open http://localhost:5173/repo2txt/

Build for Production

npm run build
# Output in ./dist folder

📖 Usage

GitHub Repository

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

Supported URL formats: - https://github.com/owner/repo (default branch) - https://github.com/owner/repo/tree/branch-name - https://github.com/owner/repo/tree/branch-name/path/to/folder - Branch names with slashes: feature/test/branch-name

Local Files

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

🛠️ Tech Stack

  • Framework: React 19 + TypeScript
  • Build Tool: Vite 5
  • Styling: Tailwind CSS 3
  • State Management: Zustand
  • File Handling: JSZip
  • Tokenization: gpt-tokenizer
  • Virtual Scrolling: TanStack Virtual
  • Testing: Vitest + Playwright
  • CI/CD: GitHub Actions

📊 Project Stats

  • Bundle Size: ~330KB main chunk (gzipped)
  • First Load: < 2s on 3G
  • Test Coverage: 100% E2E test pass rate
  • Performance: Lighthouse 95+ across all metrics
  • Compatibility: Chrome 90+, Firefox 88+, Safari 14+, Edge 90+

🤝 Contributing

We welcome contributions! Please see: - CONTRIBUTING.md - Development guide and architecture - AGENT.md - Detailed design documentation for LLM agents

Quick Contribution Guide

# Fork and clone
git clone https://github.com/YOUR_USERNAME/repo2txt.git

# Create branch
git checkout -b feature/amazing-feature

# Make changes and test
npm run test:unit
npm run test:e2e

# Commit and push
git commit -m "Add amazing feature"
git push origin feature/amazing-feature

# Open pull request

📝 License

MIT License - see LICENSE for details

🙏 Acknowledgments

  • Built with ❤️ by Abin Thomas
  • Inspired by the need for better LLM context preparation
  • Thanks to all contributors

🔗 Links

⭐ Star History

If you find this project helpful, please consider giving it a star! It helps others discover the tool.


Made with 🤖 for AI developers

Extension points exported contracts — how you extend this code

FileNode (Interface)
(no doc)
src/types/index.ts
AdvancedFiltersProps (Interface)
(no doc)
src/components/AdvancedFilters.tsx
TreeBuilderOptions (Interface)
(no doc)
src/lib/tree-builder.ts
ProviderSlice (Interface)
(no doc)
src/store/slices/providerSlice.ts
AzureFileItem (Interface)
(no doc)
src/features/azure/AzureDevOpsProvider.ts
TokenizeRequest (Interface)
(no doc)
src/workers/tokenizer.worker.ts
FileContent (Interface)
(no doc)
src/types/index.ts
FileStatsProps (Interface)
(no doc)
src/components/FileStats.tsx

Core symbols most depended-on inside this repo

validateUrl
called by 27
src/lib/providers/types.ts
getNode
called by 21
src/lib/file-tree/FileTree.ts
sanitizeFilename
called by 17
src/lib/utils/repoName.ts
parseUrl
called by 15
src/lib/providers/types.ts
execute
called by 14
src/lib/utils/rateLimiter.ts
initialize
called by 14
src/features/local/LocalProvider.ts
clear
called by 13
src/lib/file-tree/FileTree.ts
setCredentials
called by 12
src/lib/providers/BaseProvider.ts

Shape

Method 122
Function 112
Interface 47
Class 25
Enum 1

Languages

TypeScript100%

Modules by API surface

src/lib/file-tree/FileTree.ts25 symbols
src/lib/providers/types.ts18 symbols
src/features/local/LocalProvider.ts16 symbols
src/features/gitlab/GitLabProvider.ts16 symbols
src/features/github/GitHubProvider.ts16 symbols
src/lib/providers/ProviderFactory.ts14 symbols
src/features/azure/AzureDevOpsProvider.ts13 symbols
src/lib/utils/rateLimiter.ts12 symbols
src/lib/providers/BaseProvider.ts12 symbols
src/lib/file-tree/FileNode.ts11 symbols
src/features/local/components/ZipUploader.tsx11 symbols
src/types/index.ts10 symbols

Dependencies from manifests, versioned

@eslint/js9.39.1 · 1×
@playwright/test1.58.2 · 1×
@tanstack/react-virtual3.13.18 · 1×
@testing-library/jest-dom6.9.1 · 1×
@testing-library/react16.3.2 · 1×
@testing-library/user-event14.6.1 · 1×
@types/node24.10.1 · 1×
@types/react19.2.7 · 1×
@types/react-dom19.2.3 · 1×
@vitejs/plugin-react4.7.0 · 1×
@vitest/coverage-v84.0.18 · 1×
autoprefixer10.4.24 · 1×

For agents

$ claude mcp add repo2txt \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact