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.
npm install -g gitfiBefore you can use gitfi, you need to provide your Gemini API key. The tool will look for the key in the following order:
- A
.envfile in your project's root (GEMINI_API_KEY=...). - A global config file at
~/.config/gitfi/.gitfi.conf(Linux) or~/Library/Preferences/gitfi/.gitfi.conf(macOS). - A local
.gitfi.conffile 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.
After staging your files with git add, you have two ways to use gitfi.
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 gRun the commit command to have the AI generate a message and commit the changes instantly.
gitfi commit
# or the alias
gitfi cgitfi can track how much time it saves you.
-
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
-
View Your Report: At any time, run the
reportcommand to see an aggregated summary of your time savings for the current repository.gitfi report