A CLI that writes your git commit messages for you with AI. This project was inspired by AI Commits and has been ported to Rust.
All the commit messages in this repo were generated by this tool.
- Install Rust and Cargo. Then run:
cargo install aicommits-rs
-
Retrieve your API key from OpenAI
Note: If you haven't already, you'll have to create an account and set up billing.
-
Set your API key as an environment variable:
export OPENAI_API_KEY=<your_api_key>
Run the following command to install the latest version of the CLI tool:
brew install EtaCassiopeia/tap/aicommits-rs
run the following command to install the latest version of the CLI tool:
curl -L //TBD
aicommits-rs
This CLI tool uses git diff
to obtain all of the most recent code changes, and then sends them to OpenAI's GPT-3 to generate a commit message that is returned. If the returned commit message is not satisfactory, you can run the command again to generate a new commit message, otherwise you can use the returned commit message to commit your changes.
Note: An error may occur when the number of changes being made to a file is too large for the OpenAI API to process. To avoid this error, try reducing the number of staged changes or writing your own commit message.
Note: This tool is still in development, and is not guaranteed to work as expected.