gac is an AI-powered CLI that automates Git commits by generating structured commit messages from repository changes and handling sync workflows.
- AI-Driven Message Generation: Analyzes staged changes (diffs) to generate structured messages adhering to the Conventional Commits specification.
- Remote Synchronization: Automatically executes
git fetchto detect remote updates and prompts for apulloperation 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
pushoperations 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, andverbose. - 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.
It supports multiple package managers. Please use the one that you are familiar with.
npm install -g gac-cligit clone https://github.com/ravvdevv/gac.git
cd gac
bun install
bun linkInitial 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 configRun gac in any Git repository to initiate the automated commit workflow:
gacTo regenerate the commit message for the most recent commit:
gac --amendTo generate a message without executing a commit:
gac --dry-runTo copy the generated message directly to the system clipboard:
gac --copy| 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. |
To install a pre-commit hook that invokes gac automatically:
gac install-hookThe .gacignore file in the repository root allows for excluding specific files from AI analysis using standard glob patterns.
gac supports all OpenRouter-compatible models. Use gac --model custom to specify a custom model ID.
This project is licensed under the Raven License. Refer to the LICENSE file for complete terms.
Maintained by Raven