Crates.io | ai-commit |
lib.rs | ai-commit |
version | 0.1.0 |
source | src |
created_at | 2024-08-20 16:34:01.920739 |
updated_at | 2024-08-20 16:34:01.920739 |
description | AI Commit is a command-line tool that generates commit messages using AI. It supports multiple AI providers and models to help you create meaningful and consistent commit messages for your Git repositories. |
homepage | |
repository | |
max_upload_size | |
id | 1345487 |
size | 78,448 |
AI Commit is a command-line tool that generates commit messages using AI. It supports multiple AI providers and models to help you create meaningful and consistent commit messages for your Git repositories.
You can install AI Commit by downloading the pre-built binary for your system from the latest release on GitHub.
Download the appropriate archive for your system:
ai-commit-x86_64-apple-darwin.tar.gz
ai-commit-aarch64-apple-darwin.tar.gz
ai-commit-x86_64-unknown-linux-gnu.tar.gz
ai-commit-aarch64-unknown-linux-gnu.tar.gz
ai-commit-x86_64-pc-windows-msvc.zip
Extract the archive:
.tar.gz
files: tar xzf ai-commit-<version>.tar.gz
.zip
files: Unzip using your preferred toolMove the ai-commit
binary to a directory in your PATH, for example:
sudo mv ai-commit /usr/local/bin/
Alternatively, if you prefer to build from source, make sure you have Rust and Cargo installed on your system. Then, clone this repository and build the project:
git clone https://github.com/EgorHenek/ai-commit.git
cd ai-commit
cargo build --release
The compiled binary will be available in target/release/ai-commit
.
To use AI Commit, you need to set up your API keys for the AI providers you want to use. You can do this by setting environment variables:
OPENAI_API_KEY
OPENROUTER_API_KEY
git diff | ai-commit
This will generate a commit message based on the current git diff using the default provider (OpenAI) and model.
git diff | ai-commit --provider openrouter --model gpt-3.5-turbo
ai-commit --provider openai --list-models
ai-commit --help
You can set default values for the AI model and provider using environment variables:
AI_MODEL
: Sets the default AI modelOPENAI_API_KEY
: Sets the API key for OpenAIOPENROUTER_API_KEY
: Sets the API key for OpenRouterContributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.