Skip to content

A simple CLI tool that uses LLMs to automatically generate meaningful & conventional commit messages

License

Notifications You must be signed in to change notification settings

garrethlee/gcmt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gcmt

A simple CLI tool that uses LLMs to automatically generate meaningful & conventional commit messages from your staged changes, while also allowing you to edit the message according to your instructions.

gcmt demo

Using the Hugging Face Inference API's generous free tier, you can generate commit messages without incurring additional $$$.

Installation

pip install gcmt

Be sure to set your Hugging Face access token as an environment variable:

export HF_TOKEN="<your-token>"

You can get an access token here after signing up for a Hugging Face account.

Usage

# Generates a commit message for your staged changes
gcmt

# Generates a commit message and commits them automatically, no additional input required
gcmt --auto-commit

# Choose a different model to generate the commit message. List of models [here](https://huggingface.co/docs/api-inference/supported-models)
gcmt --model_name meta-llama/Meta-Llama-3-70B-Instruct

Commands

After generating a commit message, you'll be prompted with several options:

  • c: Commit the changes with the generated message
  • cp: Copy the generated message to clipboard
  • e "<instructions>": Edit the commit message according to your instructions (e.g., e "make it more concise")
  • r: Re-generate a new commit message
  • a: Abort the commit process

🎉 Fun Fact: All of the commit messages in this project were generated using gcmt :)

About

A simple CLI tool that uses LLMs to automatically generate meaningful & conventional commit messages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages