Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oleander/git-ai
Git AI uses ChatGPT and git hook to generate commit messages based on the staged files. Leave the commit message empty and let Git AI do the work for you!
https://github.com/oleander/git-ai
commit-messages git-automation git-hooks openai-chatgpt rust
Last synced: about 2 months ago
JSON representation
Git AI uses ChatGPT and git hook to generate commit messages based on the staged files. Leave the commit message empty and let Git AI do the work for you!
- Host: GitHub
- URL: https://github.com/oleander/git-ai
- Owner: oleander
- License: mit
- Created: 2023-10-10T15:33:54.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-16T08:03:48.000Z (about 2 months ago)
- Last Synced: 2024-11-16T08:20:22.782Z (about 2 months ago)
- Topics: commit-messages, git-automation, git-hooks, openai-chatgpt, rust
- Language: Rust
- Homepage:
- Size: 967 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Git AI [![Rust](https://github.com/oleander/git-ai/actions/workflows/cd.yml/badge.svg)](https://github.com/oleander/git-ai/actions/workflows/cd.yml) [![Crates.io](https://img.shields.io/crates/v/git-ai.svg)](https://crates.io/crates/git-ai) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
**Git AI** seamlessly integrates ChatGPT with git hooks to automate commit message generation based on your staged files. Stage your changes and commit without a message; **Git AI** does the rest, crafting detailed commit messages that reflect the essence of your changes.
### Key Features
- **Smart Integration**: Leverages OpenAI's powerful Assistant API, expertly tailored to transform git diffs into insightful commit messages.
- **Contextual Learning**: This feature maintains a dedicated thread for each project, allowing the assistant to build context over time and thereby improving performance and message relevance with every commit.
- **Local Optimization**: Hosts an exclusive assistant instance on your machine, learning from all your projects to elevate the quality of commit messages throughout your development environment.## Quick Start
```bash
# Install Git AI
cargo install git-ai# Set your OpenAI API key
git-ai config set openai-api-key# Install the Git AI hook in your repo
git-ai hook install# Make your changes, stage them, and commit without a message
git commit --all --no-edit
```## Getting Started
### Prerequisites
- Rust and Cargo installed on your machine.
### Installation Options
#### Via Crates.io
```bash
cargo install git-ai
git-ai config set openai-api-key
git-ai hook install
```#### From Source
```bash
git clone https://github.com/oleander/git-ai
cd git-ai
cargo install --path .
```## Usage Guide
### Setting Up
- Follow the installation instructions to get Git AI ready.
- Initialize Git AI in your repository with `git-ai hook install`.
- Set your OpenAI API key using `git-ai config set openai-api-key `.### Advanced Configuration
Customize Git AI's behavior with these commands:
- `git-ai config set max-commit-length ` (default: 72): Set the maximum length of commit messages.
- `git-ai config set max-tokens ` (default: 512): Set the maximum number of tokens for the assistant.
- `git-ai config set model ` (default: "gpt-3.5-turbo"): Set the OpenAI model to use.
- `git-ai config set openai-api-key `: Set your OpenAI API key.## Contributing
Your feedback and contributions are welcome! Join our community to help improve **Git AI**by submitting issues, offering suggestions, or contributing code. See our [contributing guidelines](CONTRIBUTING.md) for more details.
## Testing
Run `cargo test` to execute the test suite and ensure everything functions as expected.
## License
**Git AI** is proudly open-sourced under the MIT License. See [LICENSE](LICENSE) for more details.