aicommit

aicommit

become the world's laziest committer

Stars: 81

Visit
 screenshot

aicommit is a small command line tool for generating commit messages that follow the repository's existing style. It helps users create commit messages with intention, context, and external references to aid understanding of code changes. The tool offers flags like `-c` for adding context and supports retrying and dry-running commit messages. Users can also provide context to the AI for better message generation and save API key to disk for convenience. aicommit reads a `COMMITS.md` file to determine the style guide, following it if available.

README:

aicommit

aicommit is a small command line tool for generating commit messages. There are many of these already out there, some even with the same name. But none (to my knowledge) follow the repository's existing style, making them useless when working in an established codebase.

A good commit message is more than a summary of the code changes. It contains the intention, context, and external references that help others understand the change. Thus, aicommit has a -c/--context flag for quickly adding this detail.

aicommit is inspired by our good friend @sreya:

sreya-log

Install

go install github.com/coder/aicommit/cmd/aicommit@main

Or, download a binary from the latest release.

Usage

You can run aicommit with no arguments to generate a commit message for the staged changes.

export OPENAI_API_KEY="..."
aicommit

You can "retry" a commit message by using the -a/--amend flag.

aicommit -a

You can dry-run with -d/--dry to see the ideal message without committing.

aicommit -d

Or, you can point to a specific ref:

aicommit HEAD~3

You can also provide context to the AI to help it generate a better commit message:

aicommit -c "closes #123"

aicommit -c "improved HTTP performance by 50%"

aicommit -c "bad code but need for urgent customer fix"

When tired of setting environment variables, you can save your key to disk:

export OPENAI_API_KEY="..."
aicommit --save-key
# The environment variable will override the saved key.

Style Guide

aicommit will read the COMMITS.md file in the root of the repository to determine the style guide. It is optional, but if it exists, it will be followed even if the rules there diverge from the norm.

If there is no repo style guide, aicommit will look for a user style guide in ~/COMMITS.md.

For Tasks:

Click tags to check more tools for each tasks

For Jobs:

Alternative AI tools for aicommit

Similar Open Source Tools

For similar tasks

For similar jobs