Open Source CLI Tool

Let AI write your
git commit messages

Commiat uses the OpenRouter API with Google Gemini Flash 1.5 to generate perfect commit messages based on your staged changes.

Powered by OpenRouter and Gemini 1.5 Flash

$ commiat -a # stage all changes

✨ Analyzing staged changes with Gemini...

Generated commit message:

✨ Add user profile page with avatar upload

# Press enter to confirm, edit to adjust, or Ctrl+C to cancel

$ git log -1

commit 1a2b3c4d...

Author: Your Name

Date: Thu Jun 1 14:00:00 2023 +0000

✨ Add user profile page with avatar upload

Listen to a 5-Minute Podcast Excerpt

This is a short 5-minute excerpt (cutoff) from our podcast discussing the Commiat CLI.
You can listen to the full podcast here .

Key Features

Commiat makes your git workflow smarter and more productive

AI-Powered Messages

Uses OpenRouter API with Google Gemini Flash to analyze your diffs and generate clear, descriptive commit messages.

Flexible Staging

Optionally stage all changes with the -a flag or stage manually before running.

Configurable

Support for both global and project-specific configuration via .env files or the global config.

Interactive

Review, edit, or cancel the suggested commit before it's finalized to maintain full control.

Model Selection

Choose your preferred AI model with the OPENROUTER_MODEL setting (defaults to Gemini Flash).

First-Run Setup

Guided configuration when first run, securely saving your OpenRouter API key to the global config.

How Commiat Works

A simple CLI workflow that fits right into your existing git habits

1. Run Commiat

Run commiat after staging changes, or use commiat -a to stage all changes automatically.

2. AI Analysis

Commiat analyzes your staged changes using OpenRouter with Gemini Flash (or your configured model).

3. Review & Commit

Confirm, edit, or cancel the suggested commit message before it's finalized.

Example Workflow

# Install and set up Commiat

$ git clone https://github.com/javimosch/commiat.git

$ cd commiat

$ npm install

$ npm link

# First run - will prompt for OpenRouter API key

$ commiat -a

🔑 Enter your OpenRouter API key: [hidden input]

# Subsequent usage

$ commiat -a

✨ Analyzing staged changes with Gemini...

Generated commit message:

✨ Update README with complete installation instructions

# Press enter to confirm, edit to adjust, or Ctrl+C to cancel

Installation & Configuration

Get started with Commiat in a few simple steps

Installation

# Clone the repository

$ git clone https://github.com/javimosch/commiat.git

$ cd commiat

# Install dependencies

$ npm install

# Link for global access

$ npm link

Configuration

Commiat looks for configuration in this order of precedence:

  1. Project .env file:

    OPENROUTER_API_KEY=your_key_here
    OPENROUTER_MODEL=google/gemini-flash-1.5

  2. Global config (~/.commiat/config):

    Edit with commiat config

  3. Interactive prompt:

    First-run setup will securely save your API key

Note on API Keys

You'll need an OpenRouter API key. Commiat uses google/gemini-flash-1.5 by default, but you can configure any supported model.

Usage

Basic commands to get started:

# Option 1: Stage changes manually

$ git add file1.js file2.css

$ commiat

# Option 2: Stage all changes automatically

$ commiat -a

# Edit global configuration

$ commiat config

Ready to revolutionize your commit workflow?

Open source, easy to install, and powered by cutting-edge AI.