A git prepare-commit-msg hook for authoring commit messages with GPT-3.

Related tags

Utilities gptcommit
Overview

gptcommit

Github Contributors Github Stars Github Build Status

crates.io status crates.io downloads Rust dependency status

A git prepare-commit-msg hook for authoring commit messages with GPT-3. With this tool, you can easily generate clear, comprehensive and descriptive commit messages letting you focus on writing code.

See announcement blog post.

Demo

asciicast

Installation

  1. Install this tool locally with cargo.
cargo install gptcommit
  1. In your git repository, run the following command to install gptcommit as a git prepare-commit-msg hook. You will need to provide an OpenAI API key to complete the installation.
gptcommit install

Usage

To use gptcommit, simply run git commit as you normally would. The hook will automatically generate a commit message for you using GPT-3. If you're not satisfied with the generated message, you can always edit it before committing.

Note: By default, gptcommit uses the GPT-3 model. Please ensure you have sufficient credits in your OpenAI account to use it.

n.b. If your OpenAI API key has changed, simply re-run gptcommit install.

Encountered any bugs?

If you encounter any bugs or have any suggestions for improvements, please open an issue on the repository.

License

This project is licensed under the MIT License.

You might also like...
Better error messages for axum framework.

axum-debug This is a debugging crate that provides better error messages for axum framework. axum is a great framework for developing web applications

Log defmt messages over the serial port.
Log defmt messages over the serial port.

defmt-serial A defmt target for logging over a serial port. Messages can e.g. be read using socat and passed through defmt-print, see example-artemis

Spot coupling by finding out which files are always in the same commit

git moves-together This tells you when files in the repository frequently move together. This lets you identify where the coupling is in the system. C

Mirror of oxipng for pre-commit.

oxipng pre-commit mirror Mirror of oxipng for pre-commit. Installation Add to your pre-commit config: - repo: https://github.com/adamchainz/pre-comm

Openfare - Monetize software with one commit.
Openfare - Monetize software with one commit.

OpenFare πŸͺ™ Monetize software with one commit. πŸͺ™ OpenFare monetizes any software library with one code change. The goal: fund the next million softwa

Universal changelog generator using conventional commit+ with monorepo support. Written in Rust.
Universal changelog generator using conventional commit+ with monorepo support. Written in Rust.

chlog Universal changelog generator using conventional commit+ with monorepo support. chlog can generate the changelog from the conventional commits w

A partial reimplementation of pre-commit in Rust

preco A partial reimplementation of pre-commit in Rust. Important Heavily just a proof-of-concept and work-in-progress. There are bits that could prob

Simple git/hg tui client focused on keyboard shortcuts
Simple git/hg tui client focused on keyboard shortcuts

verco A simple Git/Hg tui client focused on keyboard shortcuts Screenshots Platforms This project uses Cargo and pure Rust stable and works on latest

🌌⭐ Git tooling of the future.

❯ Glitter Git tooling of the future. ❯ πŸ‘€ Features Config files Fast Easy to use Friendly errors ❯ πŸ“š Documentation For proper docs, see here ❯ βœ‹ What

Comments
  • Make gptcommit not overwrite commit message when using git commit --amend

    Make gptcommit not overwrite commit message when using git commit --amend

    When using git commit --amend gptcommit always replaces the last commit message with the same generic message:

    # AI Generated Commit Summary:
    # EDIT BELOW AS NEEDED
    - Refactor backend code to improve performance
    - Update frontend design to improve user experience
    - Add new features to improve application functionality
    #
    # File-level changes:
    ~                      
    
    opened by grayfallstown 3
  • cargo install fails on windows

    cargo install fails on windows

    error[E0433]: failed to resolve: could not find `unix` in `os`
     --> C:\Users\mk\scoop\persist\rustup-msvc\.cargo\registry\src\github.com-1ecc6299db9ec823\gptcommit-0.1.0\src\actions\install.rs:4:27
      |
    4 |     process::Command, os::unix::prelude::PermissionsExt,
      |                           ^^^^ could not find `unix` in `os`
    
    error[E0599]: no function or associated item named `from_mode` found for struct `Permissions` in the current scope
      --> C:\Users\mk\scoop\persist\rustup-msvc\.cargo\registry\src\github.com-1ecc6299db9ec823\gptcommit-0.1.0\src\actions\install.rs:45:64
       |
    45 |     fs::set_permissions(&prepare_commit_msg_path, Permissions::from_mode(0o755))?;
       |                                                                ^^^^^^^^^ function or associated item not found in `Permissions`
    
    Some errors have detailed explanations: E0433, E0599.
    For more information about an error, try `rustc --explain E0433`.
    error: could not compile `gptcommit` due to 2 previous errors
    error: failed to compile `gptcommit v0.1.0`, intermediate artifacts can be found at `C:\Users\mk\AppData\Local\Temp\cargo-installdYv1GZ`
    
    opened by grayfallstown 2
  • Windows Support for `gptcommit`

    Windows Support for `gptcommit`

    [src/actions/install.rs]

    • Add #[cfg(unix)] annotation for the permissions setter
    • Set the permissions for the prepare-commit-msg file to 0o755 on unix only

    refs #1

    opened by grayfallstown 1
  • Better README, adjust max length, and optimize dependencies

    Better README, adjust max length, and optimize dependencies

    • Switch to colored output and remove unnecessary dependencies
    • Reduce maximum length of summary comments
    • Add installation options and demo link to README
    opened by zurawiki 0
Owner
Roger Zurawicki
building something new
Roger Zurawicki
Easily add emojis to your git commit messages 😎

gimoji A CLI tool that makes it easy to add emojis to your git commit messages. It's very similar to (and is based on) gitmoji-cli but written in Rust

Zeeshan Ali Khan 12 May 29, 2023
A dead-simple AI-powered CLI tool for effortlessly crafting meaningful Git commit messages

AI Commit Message acm A dead-simple AI-powered CLI tool for effortlessly crafting meaningful Git commit messages. Features Effortlessly create meaning

syeijs 3 Nov 5, 2024
A git hook to manage derivative files automatically.

git-derivative A git hook to manage derivative files automatically. For example if you checked out to a branch with different yarn.lock, git-derivativ

Sung Jeon 3 Oct 30, 2022
mdTranslation is a utility to prepare multi-lingual Markdown documents.

mdTranslation is a utility to prepare multi-lingual Markdown documents. There's also a mdBook preprocessor called mdbook-translation for

Charles Lew 15 Dec 26, 2022
A gitmoji interactive client for using gitmojis on commit messages.

gitmoji in Rust This is just an opinionated version of gitmoji-cli written in Rust . A gitmoji interactive client for using gitmojis on commit message

igor 2 Aug 16, 2022
A CLI tool that automatically writes commit messages for you.

Automagically-generated commit messages A CLI tool that generates commit messages from your staged changes, built in Rust and using OpenAI's Codex. In

Miguel Piedrafita 839 Jan 6, 2023
miette is a diagnostic library for Rust. It includes a series of traits/protocols that allow you to hook into its error reporting facilities, and even write your own error reports!

miette is a diagnostic library for Rust. It includes a series of traits/protocols that allow you to hook into its error reporting facilities, and even write your own error reports!

Kat MarchΓ‘n 1.2k Jan 1, 2023
A fetcher hook for the Plato document reader that syncs an e-reader with an OPDS catalogue.

plato-opds A fetcher hook for the Plato document reader that syncs an e-reader with an OPDS catalogue. Motivation I wanted to be able to sync my e-rea

null 11 Nov 8, 2023
Rust libraries for working with GPT (GUID Partition Table) disk data

gpt-disk-rs no_std libraries related to GPT (GUID Partition Table) disk data. There are three Rust packages in this repository: uguid The uguid packag

Google 25 Dec 24, 2022
A GPT-powered daily newsletter bot, written in Rust

AI Newsie 1. Introduction Meet AI Newsie - your personalized GPT-powered bot that delivers daily newsletters tailored to your interests. The bot is po

null 5 May 7, 2023