Certainly! Here's a draft for your README:
Generate insightful and structured commit messages with the power of OpenAI's ChatGPT.
This repository provides a Rust utility that takes in a git diff as input and uses ChatGPT to suggest a well-structured commit message. Say goodbye to cryptic or hastily written commit messages!
- Leverages the linguistic capabilities of ChatGPT.
- Supports extraction of API key from environment variables for secure usage.
- Handles potential errors gracefully with comprehensive messages.
- Highly configurable message generation.
- Rust (latest stable version recommended).
- An API key from OpenAI with access to the ChatGPT model.
- Clone the repository:
git clone git@github.com:partychad/git-commit-ai.git
cd git-commit-ai
- Set up the OpenAI API key:
Before running the application, you need to set up your OpenAI API key. You can do this using environment variables:
export GPT_API_KEY={API_KEY}
- Run the application:
Compile and run the application with:
cargo run
Provide the git diff input and wait for the generated commit message.
- Customization:
You can customize the default behavior, endpoint, model, and templated message by modifying the CommitMessageGenerator
instantiation in the main program.
Feel free to open issues or pull requests if you'd like to improve the project. All contributions are welcome!
This project is licensed under the MIT License.