aicommits-rs

Crates.ioaicommits-rs
lib.rsaicommits-rs
version0.3.0
sourcesrc
created_at2023-03-09 02:26:02.631312
updated_at2023-03-13 02:44:32.089462
descriptionA CLI that writes your git commit messages for you with AI
homepagehttps://github.com/EtaCassiopeia/aicommits-rs
repositoryhttps://github.com/EtaCassiopeia/aicommits-rs
max_upload_size
id805298
size65,108
Mohsen Zainalpour (EtaCassiopeia)

documentation

README

aicommits-rs


Crate Status Build Status Docs Status

A CLI that writes your git commit messages for you with AI. This project was inspired by AI Commits and has been ported to Rust.

asciicast

All the commit messages in this repo were generated by this tool.

Installation

Using Cargo

  1. Install Rust and Cargo. Then run:
cargo install aicommits-rs
  1. Retrieve your API key from OpenAI

    Note: If you haven't already, you'll have to create an account and set up billing.

  2. Set your API key as an environment variable:

export OPENAI_API_KEY=<your_api_key>

Homebrew (Mac Only)

Run the following command to install the latest version of the CLI tool:

brew install EtaCassiopeia/tap/aicommits-rs

Linux

run the following command to install the latest version of the CLI tool:

curl -L //TBD

Usage

aicommits-rs

How it works

This CLI tool uses git diff to obtain all of the most recent code changes, and then sends them to OpenAI's GPT-3 to generate a commit message that is returned. If the returned commit message is not satisfactory, you can run the command again to generate a new commit message, otherwise you can use the returned commit message to commit your changes.

Note: An error may occur when the number of changes being made to a file is too large for the OpenAI API to process. To avoid this error, try reducing the number of staged changes or writing your own commit message.

Note: This tool is still in development, and is not guaranteed to work as expected.

Commit count: 34

cargo fmt