repo2txt is an open-source developer tool that converts the contents of a code repository into a single structured text file that can be easily consumed by large language models. The tool is designed to address the challenge of analyzing entire codebases with AI assistants, where code is normally distributed across many files and directories. By collecting repository contents and formatting them into a single text document, repo2txt allows developers to feed complete projects into AI systems for analysis, documentation, or code explanation tasks. The application can load repositories from platforms such as GitHub or from local directories and provides an interface for selecting which files should be included in the generated output. It also supports filtering by file types and automatically respecting ignore patterns defined in project configuration files.
Features
- Converts entire code repositories into a single structured text file
- Supports repositories from GitHub, local directories, and compressed archives
- Smart filtering based on file types and ignore patterns
- Directory tree preview for selecting files before export
- Real-time token counting for large language model prompts
- Fully browser-based processing for privacy and security