GitAI is a command-line tool that leverages OpenAI's GPT models to assist with Git operations. It can generate commit messages, summarize changes, and potentially more in the future.
To use GitAI, you need to have Go installed.
- Clone the repository:
git clone https://github.com/richardamare/gitai.git cd gitai - Build the project:
go build -o gitai
- (Optional) Move the executable to your PATH and ensure it's executable:
sudo mv gitai /usr/local/bin/ sudo chmod +x /usr/local/bin/gitai
Currently, GitAI provides a commit command to generate commit messages and a version command to check the CLI version.
To generate a commit message for your staged changes:
gitai commitThe tool will analyze your staged changes and suggest a commit message.
To check the installed version of GitAI:
gitai versionPre-built binaries for various operating systems and architectures are available on the GitHub Releases page. Download the appropriate executable for your system.
GitAI requires your OpenAI API key to function. Set the OPENAI_API_KEY environment variable:
export OPENAI_API_KEY="your_openai_api_key_here"It's recommended to add this line to your shell's configuration file (e.g., .bashrc, .zshrc, or .profile) to set the environment variable automatically.
Contributions are welcome! Please feel free to open issues or submit pull requests.
This project is licensed under the MIT License.