Skip to content

frai-labs/frai-commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– frai-commit

Let an AI bot write your Git commit messages β€” powered by Google Gemini.

frai-commit reads your staged changes, sends them to Gemini, and generates clear, concise, and professional Git commit messages automatically.


✨ Features

  • 🧠 Uses Google Gemini AI (via @google/generative-ai)
  • πŸ“„ Parses your git diff to understand code changes
  • πŸ’¬ Generates commit messages in natural language (English)
  • βš™οΈ Easy setup using .env for your API key
  • βœ… Works with any Git project using Node.js

πŸš€ Installation

1. Clone the repo

git clone https://github.com/your-username/frai-commit.git
cd frai-commit

2. Install dependencies

npm install

πŸ” Setup

Create a .env file in the root of the project with your Gemini API key:

GEMINI_API_KEY=your_google_gemini_api_key_here

πŸ”‘ Get your API key here: https://makersuite.google.com/app/apikey

πŸ§ͺ Usage

Stage your changes:

git add .

Run the bot:

node frai-commit.js

You'll see something like:

πŸ”„ Checking for modified files...
πŸ” Reading staged changes...
πŸ€– Generating commit message...

βœ… Generated commit message:

Refactor: Remove git object instantiation from AICommitMessageGenerator constructor.

πŸš€ Commit completed successfully!

πŸ“¦ Optional: Use it as a global CLI

To run frai-commit from anywhere:

Make the script executable:

chmod +x frai-commit.js

(Optional) Move or link it to your global path:

ln -s $(pwd)/frai-commit.js /usr/local/bin/frai-commit

Now you can run it globally:

frai-commit

πŸ›‘οΈ Disclaimer

This tool uses the Gemini API to generate commit messages based on your code diffs. Review the generated messages before pushing to production.

πŸ“„ License

MIT License

Made with 🍟 by Frai Labs

About

Generate Git commit messages using Gemini AI, based on staged code changes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published