aicog
v1.4.8
Published
AI Commit Generator - Generate git commit messages using AI
Readme
aicog
A CLI tool that automatically generates meaningful git commit messages using AI, based on your staged changes.
Requirements
- Node.js >= 20
Setup
Get your API key from Google AI Studio.
Option 1: Store API Key (Recommended)
aic config -kThis will prompt you to enter your API key, which will be saved locally at ~/.aicog/config.json.
Option 2: Use Environment Variable
export AIC_API_KEY="your-api-key-here"The app will use the stored config if available, otherwise it falls back to the environment variable.
Usage
Basic Usage
Stage your changes and run:
aic- Review the generated message in the terminal
- Choose an action:
- [Enter] — Commit with the generated message
- [e] — Edit the message before committing
- [r] — Regenerate (use next available message or generate new ones)
- [i] — Regenerate with additional prompt (provide extra context to AI)
- [s] — Select from available generated messages
- [p] — Commit and push to remote
- [n] — Cancel
Command Options
Auto-Stage with -a Flag
Automatically stage changes before committing:
aic -a # Stages all changes (git add .)
aic -a . # Same as above
aic -a src/ # Stage specific path (git add src/)
aic -a "*.ts" # Stage by pattern (git add "*.ts")Auto-Commit with -y Flag
Skip the confirmation prompt and commit automatically:
aic -y # Generate message and commit immediately
aic -a -y # Stage all, generate message, and commitAuto-Push with -p Flag
Generate message, commit, and push to remote in one command:
aic -p # Generate, commit, and push to origin
aic -p upstream # Generate, commit, and push to upstream
aic -a -p # Stage all, commit, and push to origin
aic -a -p github # Stage all, commit, and push to githubNumber of Messages with -n Flag
Specify how many commit message variations to generate:
aic -n 10 # Generate 10 commit messages
aic -n 3 -a -y # Generate 3 messages, stage all, and auto-commit
aic -n 5 -p # Generate 5 messages, commit, and push to originDefault is 5 messages if not specified.
Push Command
Push the current branch to a remote:
aic push # Push to origin
aic push upstream # Push to upstream
aic p # Short alias for origin
aic p github # Short alias for specified remoteConfiguration
Edit app configurations: api key, ai model, commit prompt
aic configOptions
-k— Configure API key only-c— Configure commit prompt only (choose between global or local config, edit in Vim)-m— Configure model only (choose between global or local config)-o— Configure AI provider only (quick setup, saved globally)-b— Configure number of messages only (choose between global or local config)
AI Provider
You can select which AI provider the CLI should use. By default the provider is set to google.
Supported providers:
google— Gemini AI (default)openai— OpenAIanthropic— Anthropicdeepseek— DeepSeekxai— xAI
Installation Options
Option 1: Global Installation
npm install -g aicog
aicog
# or
aicOption 2: Using npx
npx aicog