AI-powered Git commit message generator that creates beautiful, Conventional Commits compliant messages using Google's Gemini API.
π€ AI-Powered: Leverages Google Gemini to analyze your changes and generate contextual commit messages
π Conventional Commits: All messages follow the Conventional Commits specification
π¨ Beautiful UI: Colorful, emoji-enhanced terminal interface
β‘ Fast & Easy: Interactive selection from 3-5 AI-generated suggestions
π§ Flexible: Works with any Git repository, supports custom paths
npm install -g commicgit clone <repository-url>
cd commic
npm install
npm linkOn your first run, Commic will guide you through a quick setup:
-
API Key: You'll be prompted to enter your Google Gemini API key
- Get your free API key at Google AI Studio
-
Model Selection: Choose your preferred Gemini model
- Currently supports: Gemini 3 Flash Preview
Your configuration is saved to ~/.commic/config.json for future use.
Run in your current Git repository:
commic .Commit to a different repository:
# Relative path
commic ../other-repo/
# Absolute path
commic /path/to/repository/Update your API key or model preference:
commic --reconfigure- π Analyzes your Git changes (staged and unstaged)
- π€ Generates 5 commit message suggestions using AI
- π― Validates all messages against Conventional Commits spec
- β¨ Presents an interactive menu for selection
- π Commits automatically with your chosen message
All generated messages follow this format:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasksperf: Performance improvementsci: CI/CD changesbuild: Build system changes
feat(auth): add JWT authentication
fix: resolve memory leak in event handler
docs: update installation instructions
refactor(api)!: restructure endpoint handlers
BREAKING CHANGE: API endpoints now require authentication
Make sure you're running the command in a Git repository or providing a valid path to one.
git init # Initialize a new repository if neededCreate an initial commit first:
git add .
git commit -m "Initial commit"Reconfigure with a valid API key:
commic --reconfigureMake some changes to your files first, or check if everything is already committed:
git statusConfiguration is stored at ~/.commic/config.json:
{
"apiKey": "your-api-key",
"model": "gemini-3-flash-preview",
"version": "1.0.0"
}- Node.js >= 18.0.0
- Git installed and configured
- Google Gemini API key
We welcome contributions from the open-source community! This guide will help you get started.
-
Fork and clone the repository
git clone https://github.com/your-username/commic.git cd commic -
Install dependencies and set up Git hooks
npm install
Note:
npm installautomatically runs thepreparescript which sets up Git hooks via Husky. If Git hooks don't work after installation, manually runnpm run prepareto set them up. -
Link the package locally for testing
npm link
This project uses Biome for linting and formatting to ensure consistent code quality.
We use Husky to automatically run linting and auto-fix issues before each commit. This ensures all code follows our standards:
- Pre-commit hook: Automatically runs
biome check --write --unsafebefore every commit - Auto-fix: Automatically fixes linting issues that can be auto-fixed
- Commit blocked: If there are unfixable errors, the commit will be blocked
Setup: Git hooks are automatically set up when you run
npm install(via thepreparescript). If hooks don't work, runnpm run preparemanually.
You don't need to do anything special - just commit as normal, and the hook will handle the rest!
You can also run linting manually:
# Check for linting issues
npm run lint
# Auto-fix linting issues
npm run lint:fix
# Format code only
npm run formatOur Biome configuration enforces:
- β Code formatting: Consistent indentation, spacing, and line breaks
- β Import organization: Automatic import sorting
- β Unused code detection: Flags unused variables and imports
- β Best practices: Enforces const usage, template literals, and more
β οΈ TypeScript: Warns on explicitanytypes
-
Create a feature branch
git checkout -b feat/your-feature-name # or git checkout -b fix/your-bug-fix -
Make your changes
- Write clean, readable code
- Follow existing code patterns
- Add comments for complex logic
-
Test your changes
npm run build npm run link # Test locally -
Commit your changes
commic .The pre-commit hook will automatically:
- Format your code
- Fix linting issues
- Organize imports
If there are errors that can't be auto-fixed, fix them manually and try again.
-
Push and create a Pull Request
git push origin feat/your-feature-name
We follow Conventional Commits specification:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasksci:- CI/CD changesbuild:- Build system changes
- Ensure your code passes all linting checks (handled automatically)
- Update documentation if needed
- Write clear commit messages
- Reference any related issues in your PR description
- Wait for code review and address feedback
If you have questions or need help, feel free to:
- Open an issue for discussion
- Check existing issues and PRs
- Review the codebase to understand patterns
Thank you for contributing! π
MIT