Automated Git Commit Messages using the 'OpenAI' 'GPT' Model

Automates the process of adding, committing, and pushing changes to a 'git' repository using commit messages generated by passing the git diff output to the 'OpenAI' 'GPT-3.5 Turbo' model (< https://platform.openai.com/docs/models/gpt-3>).


Installation

devtools::install_github("stevecondylios/gitGPT")

Quick Start Guide

  1. Get an OpenAI API key from here.

  2. Set the key as an environment variable inside your R session:

Sys.setenv(OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxx)

# Windows users must also set these two environment variables:
Sys.setenv(GIT_AUTHOR_NAME = "Your Name")
Sys.setenv(GIT_AUTHOR_EMAIL = "Your Email")
  1. From inside RStudio, run this single command commit() to add, commit and push with a GPT-generated commit message.
library(gitGPT)

# Ensure getwd() is in your git repo
# Make some changes to files
# Add all changes, commit and push to GitHub with a single command
commit()

If you prefer to see some sample output of what your commit message may look like, you can try:

suggest_commit_message()

You can also see what GPT provides based on your own input:

suggest_commit_message("Tidied headings in plots, optimised matrix multiplication in hpc.R")
# Updated headings and improved matrix multiplication performance.

Note: ChatGPT is non-deterministic, so the same inputs can produce different outputs each time the function is run.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("gitGPT")

0.1.3 by Steve Condylios, 4 years ago


https://github.com/stevecondylios/gitGPT


Report a bug at https://github.com/stevecondylios/gitGPT/issues


Browse source code at https://github.com/cran/gitGPT


Authors: Steve Condylios [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports httr, jsonlite


See at CRAN