- Auto-ACP is a command-line interface application written in python that allows for quick and easy git add, commit, and pushes
- Auto-ACP uses OpenAI's ChatGPT API to automatically generate a 1 line commit message
- Once installed, simply run the command
autoacp
in your terminal. Auto-ACP will then:git add -N .
git diff
- Generate a commit message based on the output of git diff
git add .
git commit -m "<generated_commit_message>"
git push
- Finally, Auto-ACP will print the generated commit message to the terminal
- If there aren't changes to any files it will exit early. Helpful when setting Auto-ACP to a timer with watch!
- View an entire commit history generated by Auto-ACP 👀
- Clone this repository
$ git clone [email protected]:adamowada/auto-acp.git
- Optionally you may download as a zip or fork the repository
- Create a virtual environment in the root of your directory
$ cd auto-acp
$ python3.11 -m venv .venv
- Optionally use an older version of python (it works with 3.10.6. No guarantees)
- Activate virtual environment
$ source .venv/bin/activate
- Pip install requirements
$ pip install -r requirements.txt
- Create an
.env
file in the root of your directory (same location as .env.sample)$ touch .env
- Edit .env following the example of
.env.sample
and of course add your own personal API key - Edit
autoacp
in a file editor of your choosing:- Change line 1 the be the absolute path of your virtual environment's python
- Change line 10 to be the absolute path of your
.env
file
- Make the
autoacp
file an executable$ chmod +x autoacp
- Add the root directory to your $PATH variable. The easiest way to do this is to add a line to the bottom of your .bashrc file
- Example:
export PATH=$PATH:/home/adam/projects/auto-acp
- Restart your terminal
- Example:
- Test by running
$ autoacp
in a git repository with uncommitted changes. If you see a commit message (and don't see errors) it works! - 🎉 You did it! 🎉
Optional Step: Add a watch alias to your .bashrc:
- Add this to the bottom of your
.bashrc
file:
aacp() {
wait="$*"
watch -n $wait autoacp
}
- Then when you are working you can run
$ aacp 60
which will use watch to autoacp every 60 seconds (or however many seconds you pass as an argument)
- Large diffs that cause the request to exceed 4096 tokens, which is approximately 16,000 characters, will fail
- This can happen when many boilerplate files are created
- Does a good job describing 'what' changes were made, but not the 'why' or 'how'
- OpenAI's API is paid. Therefore while this app is free, using it will cost you money. Use at your own risk
- Add pictures to installation guide
- Make installation easier
- Add configuration option to match commit message style guides