Crates.io | autocommit |
lib.rs | autocommit |
version | 0.1.5 |
source | src |
created_at | 2023-05-29 12:27:32.941974 |
updated_at | 2023-07-08 16:35:31.322719 |
description | A simple tool to automatically commit changes to a git repository using GPT-3.5 to generate commit summaries |
homepage | |
repository | https://github.com/raghavanand98/autocommit |
max_upload_size | |
id | 877083 |
size | 71,940 |
Download the releases from the releases page or use the install script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/raghavanand98/autocommit/releases/download/v0.1.3/autocommit-installer.sh | sh
On MacOS you can use Homebrew to install autocommit
.
brew tap raghavanand98/autocommit
brew install autocommit
Autocommit is a tool to automatically create commits of a repo every X minutes. If you have an OpenAI key (env var as OPENAI_API_KEY
) the commit diff (upto 1500 characters) is passed to gpt-3.5-turbo to summarize the commit to create a meaningful commit message. Otherwise, the current datetime is used as the commit message.
Autocommit has 4 commands:
Usage: autocommit <COMMAND>
Commands:
run --path {PATH_TO_GIT_REPO}
create --frequency {FREQUENCY_IN_MINUTES} --path {PATH_TO_GIT_REPO}
list # List currently configured autocommits
delete --path {PATH_TO_GIT_REPO}
The general usage pattern will just be to use create
to set up autocommit on a particular Git repo, list
to see what is currently setup and delete
to stop autocommitting. run
can be used to test autocommit
behavior in a one-off fashion, and it's also what the cronjob is configured to call. autocommit
will log to ${REPO_PATH}/.autocommit_log
when it runs at the configured frequency. Make sure to add .autocommit_log to your .gitignore before setting up a repo, otherwise you will run into an infinite loop where changes to autocommit
will trigger more commits.
There are a few rough edges that need to be fixed, although the general structure of the code works (all the commits in this repo have been generated through autocommit
):
libgit
was used, but it might be better to simply dispatch subprocess commands to automatically pick up the right SSH keys, add untracked files etc. ✅.autocommit_log
to their .gitignore
✅