Skip to content

rkhatta1/gitfi

Repository files navigation

Git Fixed-It

An AI powered cli to generate/automate (better) git commit messages.

Static Badge Static Badge Static Badge Static Badge

gitfi is a simple command-line tool that uses Google's Gemini to automatically generate a descriptive commit message based on your staged Git changes.

Installation

npm install -g gitfi

Configuration

Before you can use gitfi, you need to provide your Gemini API key. The tool will look for the key in the following order:

  1. A .env file in your project's root (GEMINI_API_KEY=...).
  2. A global config file at ~/.config/gitfi/.gitfi.conf (Linux) or ~/Library/Preferences/gitfi/.gitfi.conf (macOS).
  3. A local .gitfi.conf file in your project's root.

Your config file can contain any of these settings:

# Your Gemini API Key (required)
GEMINI_API_KEY=your_secret_api_key_here

# Optional: Specify a different Gemini model
GEMINI_MODEL=gemini-2.0-flash

# Optional: Provide a completely custom prompt.
PROMPT=You are a pirate. Write a commit message for this treasure map:

Note: The .env file uses the same variable names.

Usage

After staging your files with git add, you have two ways to use gitfi.

Interactive Mode (For when you're feeling cautious)

Run the gen command to have the AI generate a message and present you with options to commit, edit, or cancel.

gitfi gen

# or the alias
gitfi g

Direct Commit Mode (For when you're feeling confident)

Run the commit command to have the AI generate a message and commit the changes instantly.

gitfi commit

# or the alias
gitfi c

See How Much Time You're Saving

gitfi can track how much time it saves you.

  1. Collect Data: Use the --metric (or -m) flag with your commands. The performance data will be automatically and discreetly added to the commit message.

    gitfi commit --metric
    gitfi g -m
  2. View Your Report: At any time, run the report command to see an aggregated summary of your time savings for the current repository.

    gitfi report

About

git fixed-it: an AI git helper to generate/automate (better) commit messages.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published