Skip to content

nhdfr/sweet-commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sweet-commit

npm version

AI-powered commit messages that just work. One command, perfect commits, every time.

Installation

npm install -g sweet-commit

Usage

  1. Stage your changes:

    git add .
  2. Generate and commit:

    scom

The tool will analyze your staged changes, generate a conventional commit message using AI, show it to you, and commit after confirmation.

Setup

Get your Gemini API key from Google AI Studio and configure it:

Option 1: .env file (Recommended) Create a .env file in your project:

GEMINI_API_KEY=your-api-key-here

Option 2: Environment variable

export GEMINI_API_KEY="your-api-key-here"

Option 3: Permanent setup (Not recommended) Add to your shell profile for system-wide access:

For bash users:

echo 'export GEMINI_API_KEY="your-api-key-here"' >> ~/.bashrc
source ~/.bashrc

For zsh users:

echo 'export GEMINI_API_KEY="your-api-key-here"' >> ~/.zshrc
source ~/.zshrc

Warning: This stores your API key permanently in your shell profile. Only use this if you understand the security implications and are on a personal, secure machine.

Features

  • Automatic analysis of staged git changes
  • Generates conventional commit messages following best practices
  • Uses Gemini AI for intelligent commit message creation
  • Clean, minimal interface with no unnecessary output
  • Zero configuration required after API key setup
  • Supports both environment variables and .env files

Dependencies

  • @clack/prompts - Clean CLI interface
  • @google/genai - Gemini AI integration

Requirements

  • Node.js 20 or later
  • Git repository with staged changes
  • Gemini API key

About

sweet commit helps you write clear, conventional commit style messages with ease.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published