repo-to-text utility optimized for easy import in to NixOS systems https://pypi.org/project/repo-to-text/
Find a file
2024-06-09 09:46:54 +02:00
.github/workflows cleanup 2024-06-08 13:13:26 +02:00
examples more examples 2024-06-08 15:26:09 +02:00
repo_to_text ignore-tree-and-content setting 2024-06-09 09:46:54 +02:00
tests output-dir option 2024-06-08 11:58:13 +02:00
.gitignore cleanup 2024-06-08 12:20:42 +02:00
.repo-to-text-settings.yaml ignore-tree-and-content setting 2024-06-09 09:46:54 +02:00
LICENSE Initial commit 2024-06-08 09:25:52 +02:00
MANIFEST.in release fix 2024-06-08 13:05:20 +02:00
README.md more examples 2024-06-08 15:26:09 +02:00
requirements.txt ignore-content setting 2024-06-09 09:38:27 +02:00
setup.py version and description 2024-06-08 15:36:32 +02:00

repo-to-text

repo-to-text is an open-source project that converts the structure and contents of a directory (repository) into a single text file. By executing a simple command in the terminal, this tool generates a text representation of the directory, including the output of the tree command and the contents of each file, formatted for easy reading and sharing. This can be very useful for development and debugging with LLM.

Example of Repository to Text Conversion

Example Output

The generated text file will include the directory structure and contents of each file. For a full example, see the example output for this repository.

The same text will appear in your clipboard. You can paste it into a dialog with the LLM and start communicating.

Features

  • Generates a text representation of a directory's structure.
  • Includes the output of the tree command.
  • Saves the contents of each file, encapsulated in markdown code blocks.
  • Copies the generated text representation to the clipboard for easy sharing.
  • Easy to install and use via pip and Homebrew.

Installation

Using pip

To install repo-to-text via pip, run the following command:

pip install repo-to-text

Usage

After installation, you can use the repo-to-text command in your terminal. Navigate to the directory you want to convert and run:

repo-to-text

This will create a file named repo_snapshot_YYYY-MM-DD-HH-MM-SS-UTC.txt in the current directory with the text representation of the repository. The contents of this file will also be copied to your clipboard for easy sharing.

Options

You can customize the behavior of repo-to-text with the following options:

  • --output-dir <path>: Specify an output directory where the generated text file will be saved. For example:

    repo-to-text --output-dir /path/to/output
    

    This will save the file in the specified output directory instead of the current directory.

  • --debug: Enable DEBUG logging. By default, repo-to-text runs with INFO logging level. To enable DEBUG logging, use the --debug flag:

    repo-to-text --debug
    

Install Locally

To install repo-to-text locally for development, follow these steps:

  1. Clone the repository:

    git clone https://github.com/kirill-markin/repo-to-text
    cd repo-to-text
    
  2. Install the package locally:

    pip install -e .
    

Installing Dependencies

To install all the required dependencies, run the following command:

pip install -r requirements.txt

Running Tests

To run the tests, use the following command:

pytest

Uninstall

To uninstall the package, run the following command from the directory where the repository is located:

pip uninstall repo-to-text

Contributing

Contributions are welcome! If you have any suggestions or find a bug, please open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

This project is maintained by Kirill Markin. For any inquiries or feedback, please contact markinkirill@gmail.com.