AI-Powered Git Commit Message Generator

0 downloads

Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/askrobots_commitgen.git
HTTPS
https://gitstable.com/git/askrobots/askrobots_commitgen.git
SSH
ssh://git@gitstable.com:2222/askrobots/askrobots_commitgen.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

danq9 Create commit message adjusting OpenAI initialization and error handling. c0d2e25 2 years, 6 months ago History
README.md

AskRobotsCommitGen

Overview

AskRobotsCommitGen is an AI-powered tool designed to generate meaningful git commit messages. It leverages OpenAI's GPT model to analyze your git diffs and suggest concise, relevant commit messages. The tool can now automatically commit changes with the generated message.

Additionally, it includes a command to modify existing files with AI, running like ar-ai-modify notes.txt "Make a list of the most common git commands used by django devs". This offers an effective method to edit files for Django developers streamlining their workflow with common git commands.

Features

  • AI-powered commit message generation.
  • Easy integration with existing git workflows.
  • Option to automatically commit changes with the AI-generated message.
  • AI-powered file modification with specific instructions.
  • Customizable message formats.

Prerequisites

  • Python 3.7 or higher
  • Git

Installation

Clone the repository:

git clone https://github.com/yourusername/askrobots_commitgen.git
cd askrobots_commitgen

Install the required dependencies:

pip install -r requirements.txt

Configuration

Set up your OpenAI API key in an environment variable:

export OPENAI_API_KEY='your-api-key'

Option alias in .zshrc to give a shortcut for running instead of "python path-to-commitgen/main.py" you run "commitgen"

alias commitgen='python ~/IdeaProjects/askrobots_commitgen/main.py'

Usage

Run the script in your git repository:

To automatically commit changes with the AI-generated message:

python main.py

To only display the generated commit message without committing:

python main.py --show-only

To modify a file with AI, run the following command:

ar-ai-modify notes.txt "Make a list of the most common git commands used by django devs"

Contributing

Contributions to AskRobotsCommitGen are welcome! Please read our contributing guidelines for details on how to contribute.

License

AskRobotsCommitGen is open-sourced software licensed under the MIT license.

Contact

For questions or feedback, please reach out to dan@quellhorst.com.

Acknowledgments

  • This project is inspired by aicommit.
  • Thanks to OpenAI for providing the GPT API.