repo-to-text

Convert a repository structure and its contents into a single text file, including the tree output and file contents in markdown code blocks. It may be useful t

What is repo-to-text?

Convert a repository structure and its contents into a single text file, including the tree output and file contents in markdown code blocks. It may be useful to chat with LLM about your code.

Overview of repo-to-text

What it is

repo-to-text is a command-line tool that converts a directory's structure and file contents into a single formatted text file. The output includes a directory tree and the content of each file, presented in markdown code blocks. It is designed to help share code with large language models (LLMs) for development and debugging purposes. The tool is written in Python and is available as an open-source package on PyPI.

Key features

  • Generates a single text file containing the directory tree and the contents of all files in the repository.
  • Outputs the result in a structured format using XML-like tags for better readability.
  • Supports customization via a .repo-to-text-settings.yaml configuration file, allowing users to ignore specific files or directories using gitignore-style rules.
  • Provides command-line options to specify an output directory, enable debug logging, output to stdout, or create a default settings file.
  • Can split the output into multiple files if a maximum word count per file is set in the settings.
  • Also available as a Docker container for containerized usage.

Use cases

  • Sharing a codebase with an LLM for code review, debugging, or refactoring assistance.
  • Creating a snapshot of a repository's structure and content for documentation or archiving.
  • Preparing a concise text representation of a project for analysis or comparison.

Getting started

bashpip install repo-to-textcd /path/to/your/repositoryrepo-to-textThis will create a timestamped text file in the current directory and copy its contents to the clipboard. For more options, see the repository README.

License and pricing

The project is licensed under the MIT License. It is open-source and free to use.

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/kirill-markinrepo-to-text.svg)](https://yunodb.com/tools/kirill-markinrepo-to-text?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/kirill-markinrepo-to-text?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/kirill-markinrepo-to-text.svg" alt="Featured on YunoDB" height="20"></a>