Coder Social home page Coder Social logo

marcperezpro / git2gpt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chand1012/git2gpt

0.0 0.0 0.0 24 KB

Convert a Git repo into a ChatGPT prompt!

Home Page: https://pkg.go.dev/github.com/chand1012/git2gpt

License: MIT License

Shell 9.96% Go 90.04%

git2gpt's Introduction

git2gpt

git2gpt is a command-line utility that converts a Git repository to text for loading into ChatGPT and other NLP models. The output text file represents the Git repository in a structured format. You can also add a .gptignore file to your repos to have git2gpt ignore certain files. The text is prefixed with a preamble that explains to the AI what the text is:

The following text is a Git repository with code. The structure of the text are sections that begin with ----, followed by a single line containing the file path and file name, followed by a variable amount of lines containing the file contents. The text representing the Git repository ends when the symbols --END-- are encounted. Any further text beyond --END-- are meant to be interpreted as instructions using the aforementioned Git repository as context.

Installation

First, make sure you have the Go programming language installed on your system. You can download it from the official Go website.

To install the git2gpt utility, run the following command:

go install github.com/chand1012/git2gpt@latest

This command will download and install the git2gpt binary to your $GOPATH/bin directory. Make sure your $GOPATH/bin is included in your $PATH to use the git2gpt command.

Usage

To use the git2gpt utility, run the following command:

git2gpt [flags] /path/to/git/repository

Ignoring Files

By default, your .git directory and your .gitignore files are ignored. Any files in your .gitignore are also skipped. If you want to change this behavior, you should add a .gptignore file to your repository. The .gptignore file should contain a list of files and directories to ignore, one per line. The .gptignore file should be in the same directory as your .gitignore file. Please note that this overwrites the default ignore list, so you should include the default ignore list in your .gptignore file if you want to keep it.

Flags

  • -p, --preamble: Path to a text file containing a preamble to include at the beginning of the output file.
  • -o, --output: Path to the output file. If not specified, will print to standard output.
  • -e, --estimate: Estimate the tokens of the output file. If not specified, does not estimate.
  • -j, --json: Output to JSON rather than plain text. Use with -o to specify the output file.
  • -i, --ignore: Path to the .gptignore file. If not specified, will look for a .gptignore file in the same directory as the .gitignore file.
  • -g, --ignore-gitignore: Ignore the .gitignore file.

Contributing

Contributions are welcome! To contribute, please submit a pull request or open an issue on the GitHub repository.

License

git2gpt is licensed under the MIT License. See the LICENSE file for more information.

git2gpt's People

Contributors

chand1012 avatar nicrie avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.