Skip to main content

repo-loader

Linting MacOS_Tests Ubuntu_Tests Win_Tests

This is a fork of the very excellent gptrepo by zackees, which itself is a fork of gpt-repository-loader by mpoon.

This tool concatenates through all the files in the repo and adds ai prompts which can be used for chat gpt conversations.

Simply open up the file, copy and paste it into the chat gpt window and then ask your question about the code.

Features

  • dump entire code of github repository into a single file
  • easy to split if you want to embed single files
  • respect .gitignore and .gptignore
  • show progress bar
  • use in CLI and scripts

Usage

CLI

pip install repo-loader
repo-loader  # now output.txt should appear in the current directory

Script

from repo_loader import repo_loader
repo_loader.load("example_repo")

Options

Argument Type Default Description
repo_path str Current directory The path to the git repository to be processed.
out_path str 'output.txt' The path to the output file.
preamble_file str None The path to a preamble file. Contents are written to output first.
preamble str here Text that will be written to the output file before the repo contents.
clipboard bool False If True, output is copied to the clipboard instead of a file.
quiet bool False If True, the script will not print to stdout or auto-open the file.
progress bool False If True, the script will display a progress bar during processing.
open_file_after_processing bool False If True, the output file will be automatically opened after processing.

Description

repo-loader is a command-line and script tool that converts the contents of a Git repository into a text format, preserving the structure of the files and file contents. The generated output can be interpreted by AI language models, allowing them to process the repository's contents for various tasks, such as code review or documentation generation.

Contributing

Some context around building this is located here. Appreciate any issues and pull requests in the spirit of having mostly GPT build out this tool. Using ChatGPT Plus is recommended for quick access to GPT-4.

Running Tests

To run the tests for repo-loader, follow these steps:

  1. Ensure you have Python 3 installed on your system.

  2. Navigate to the repository's root directory in your terminal.

  3. Run the tests with the following command:

    tox
    

    Now, the test harness is added to the repo-loader project. You can run the tests by executing the command tox in your terminal.

License

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

Metadata

Release files for repo-loader 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for repo-loader 0.2.3
File Size Uploaded
repo-loader-0.2.3.tar.gz 13.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for repo-loader 0.2.3
File Interpreter ABI Platform
repo_loader-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 22.0 kB

Release files / repo-loader-0.2.3.tar.gz

Download URL repo-loader-0.2.3.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
35ed788a9b641b1e5a28ec09cd5281c68bf2c43ee1319ca31d3e6ff8c0f62550
BLAKE2b-256 checksum
How to use checksums
efbb978b77c8a9c4c53d3f6bc6b7700455a00809655ebb615b6cd8d733e1d705
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / repo_loader-0.2.3-py3-none-any.whl

Download URL repo_loader-0.2.3-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
44b02599be65894135da5cc85d3d6426ca6c099aa800b79b50953edca916a895
BLAKE2b-256 checksum
How to use checksums
775bc1d89065cfd45eec52a6d3be34a791e3e78993672a57aa9ed800f82205d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page