2 releases
0.1.7 | Mar 29, 2023 |
---|---|
0.1.5 | Feb 17, 2023 |
#9 in #staged
19KB
438 lines
GCM-AI
GCM-AI
is a command-line tool that generates commit messages based on the diff of staged changes using OpenAI.
This app inspired by aicommits with some tweaks and written in Rust.
Installation
To install GCM-AI, you will need to have Rust installed on your system. You can install Rust by following the instructions here.
Once Rust is installed, you can install GCM-AI by running the following command:
cargo install gcm-ai
Usage
To generate a commit message for the staged changes, simply run the following command:
gcm-ai
This will generate a commit message using OpenAI's GPT-3 language model and print it to the console. You can then copy and paste the generated commit message into your git commit.
Configuration
GCM-AI uses the OpenAI API to generate commit messages. To use the OpenAI API, you will need an API key. You can get an API key by signing up for OpenAI here.
Please note that OpenAI is currently in beta, and the API is not free. But for now when you sign up, you will get $18 of free credits to use on the API, which should be enough to generate enough commit messages as the generated commit messages are very cheap.
Once you have an API key, you can configure GCM-AI to use it by running the following command:
gcm-ai --config
This will prompt you for your OpenAI API key. Once you enter your API key, it will be saved to a .toml
configuration file in your home directory.
Contributing
Contributions are welcome! If you would like to contribute to GCM-AI, please open a pull request.
License
GCM-AI is licensed under the MIT License. See the LICENSE file for more information.
Dependencies
~7–22MB
~299K SLoC