Skip to main content

repository loader for github and chatgpt

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repo-loader-0.2.1.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

repo_loader-0.2.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file repo-loader-0.2.1.tar.gz.

File metadata

  • Download URL: repo-loader-0.2.1.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for repo-loader-0.2.1.tar.gz
Algorithm Hash digest
SHA256 be453af0a60d1bec09d05592a398cb06a4724fa4219c26fcc0bbc691625efdfc
MD5 e2f06d646038d9dad096c76fa2a3c46d
BLAKE2b-256 8fcb5842cca9d38e081f394ade4163addd74f4c392e68db3241bd05636e2124c

See more details on using hashes here.

File details

Details for the file repo_loader-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: repo_loader-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for repo_loader-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 03b2a1f313d3281449b48ebb6d8bfda3e58ef26140e17e309ab07a81b11ef1b9
MD5 9aca124a53ea73c574508af74e9e87bb
BLAKE2b-256 7dd25f6da60d0cc000f2c44ebae7f4ffa9cae0ebde416ae28ba24ea06f0cae32

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page