Skip to content

ravvdevv/gac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gac (Git Auto Commit)

gac is an AI-powered CLI that automates Git commits by generating structured commit messages from repository changes and handling sync workflows.

npm version npm downloads license

Features

  • AI-Driven Message Generation: Analyzes staged changes (diffs) to generate structured messages adhering to the Conventional Commits specification.
  • Remote Synchronization: Automatically executes git fetch to detect remote updates and prompts for a pull operation when the local branch is behind, preventing merge conflicts.
  • Interactive Staging: Automatically detects unstaged changes and prompts to stage all files when no changes are currently indexed.
  • Post-Commit Workflows: Optional prompts for immediate push operations and Pull Request (PR) creation on GitHub for non-main branches.
  • Advanced Diff Filtering: Automatically excludes lock files (e.g., bun.lock, package-lock.json) and system noise to optimize AI context and token efficiency.
  • Configurable Styles: Supports multiple commit styles: conventional, detailed, minimal, vibe, and verbose.
  • Auto-Update: Automatically checks for new versions and prompts to update via bun.
  • Extensibility: Support for custom system prompts and repository-specific ignore rules via .gacignore.

Installation

It supports multiple package managers. Please use the one that you are familiar with.

Via npm

npm install -g gac-cli

From Source

git clone https://github.com/ravvdevv/gac.git
cd gac
bun install
bun link

Configuration

Initial setup requires an OpenRouter API key:

gac --key <YOUR_API_KEY>

To set the preferred AI model (Default: openrouter/free):

gac --model <MODEL_ID>

To view current configuration:

gac config

Usage

Basic Execution

Run gac in any Git repository to initiate the automated commit workflow:

gac

Amending Commits

To regenerate the commit message for the most recent commit:

gac --amend

Dry Run and Clipboard Integration

To generate a message without executing a commit:

gac --dry-run

To copy the generated message directly to the system clipboard:

gac --copy

Command Options

Option Description
--no-sync Disable remote update checks (offline mode).
--no-verify Skip Git pre-commit hooks.
--style <style> Override the default commit style (conventional, vibe, minimal, detailed, verbose).
--verbose, -v Show detailed logs and raw AI interactions.
--prompt <text|path> Specify a custom system prompt or prompt file.

Hook Installation

To install a pre-commit hook that invokes gac automatically:

gac install-hook

Project Configuration

.gacignore

The .gacignore file in the repository root allows for excluding specific files from AI analysis using standard glob patterns.

Model Selection

gac supports all OpenRouter-compatible models. Use gac --model custom to specify a custom model ID.

License

This project is licensed under the Raven License. Refer to the LICENSE file for complete terms.


Maintained by Raven

About

CLI tool that turns git diffs into Conventional Commit messages using AI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors