npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@heogeon0/lazy-ai

v0.0.2

Published

AI-powered commit message generator using Google Gemini API, designed for seamless integration with Lazygit

Readme

lazy-ai

AI-powered commit message generator using Google Gemini API, designed for seamless integration with Lazygit.

Features

  • AI-Powered: Generates intelligent commit messages using Google Gemini API
  • Conventional Commits: Follows standard commit format (feat, fix, chore, docs, etc.)
  • Lazygit Integration: Works perfectly as a custom command in Lazygit
  • Multiple Suggestions: Generate multiple commit message options to choose from
  • Multilingual: Default language is Korean, customizable to other languages
  • Customizable Rules: Add your own commit message rules

Prerequisites

  • Node.js 18 or higher
  • Git repository
  • Google Gemini API key (Get it here)
  • (Optional) Lazygit for UI integration

Installation

npm install -g @heogeon0/lazy-ai

Configuration

1. Set up API Key and Model

After installation, configure your Gemini API key:

lazy-ai config

You'll be prompted to enter:

  • Gemini API key: Your Google Gemini API key
  • Model (optional): Default is gemini-2.5-flash

Example:

Enter your Google Gemini API key: YOUR_GEMINI_API_KEY_HERE
✓ API key saved
Enter model (default: gemini-2.5-flash):
✓ Model saved

Configuration completed!

2. Lazygit Integration (Recommended)

Add this custom command to your Lazygit configuration file:

Config file location:

  • Linux/macOS: ~/.config/lazygit/config.yml
  • Windows: %APPDATA%\lazygit\config.yml

Add this to your config:

customCommands:
  - key: "I"
    description: "AI commit message"
    command: 'git commit -m "{{.Form.Msg}}"'
    context: "files"
    prompts:
      - type: "menuFromCommand"
        title: "AI Commit Messages"
        key: "Msg"
        command: "lazy-ai g"
        filter: '^(?P<number>\d+)\.\s(?P<message>.+)$'
        valueFormat: "{{ .message }}"
        labelFormat: "{{ .number }}: {{ .message | green }}"
    output: log

Usage

Standalone CLI

  1. Stage your changes:

    git add .
  2. Generate commit messages:

    lazy-ai generate -n 5
    # or use the alias
    lazy-ai g -n 5
  3. Output example:

    1. feat: AI 커밋 메시지 생성기 초기 기능 구현
    2. feat: Gemini API 통합 및 설정 관리자 추가
    3. refactor: 코드 구조 개선 및 타입 안정성 강화
    4. docs: README 및 사용 가이드 작성
    5. chore: 의존성 업데이트 및 빌드 설정

With Lazygit

  1. Open Lazygit in your repository:

    lazygit
  2. Stage your files (use space to stage)

  3. Press I (capital i) to trigger the AI commit message generator

  4. Select a commit message from the generated options

  5. Done! Your commit is created automatically

Commands

lazy-ai config

Configure API key and model settings.

lazy-ai generate [options] (alias: g)

Generate AI-powered commit messages.

Options:

  • -n, --number <count>: Number of commit messages to generate (default: 5)

Example:

lazy-ai g -n 3

How It Works

┌─────────────────────────────────────────────┐
│  1. Stage files (git add)                   │
└────────────┬────────────────────────────────┘
             │
             ▼
┌─────────────────────────────────────────────┐
│  2. Extract git diff (git diff --cached)    │
└────────────┬────────────────────────────────┘
             │
             ▼
┌─────────────────────────────────────────────┐
│  3. Send to Gemini API with prompt rules    │
└────────────┬────────────────────────────────┘
             │
             ▼
┌─────────────────────────────────────────────┐
│  4. Parse AI response                       │
└────────────┬────────────────────────────────┘
             │
             ▼
┌─────────────────────────────────────────────┐
│  5. Display formatted commit messages       │
└─────────────────────────────────────────────┘

Configuration Details

The configuration is stored locally using the conf library:

  • macOS: ~/Library/Application Support/lazy-ai-nodejs/config.json
  • Linux: ~/.config/lazy-ai-nodejs/config.json
  • Windows: %APPDATA%\lazy-ai-nodejs\config.json

Stored settings:

  • apiKey: Your Gemini API key
  • model: AI model to use (default: gemini-2.5-flash)
  • language: Output language (default: ko)
  • customRules: Additional commit message rules

Customization

Change Output Language

Currently, the default language is Korean (ko). To use a different language, you can modify the language setting in your config file or add a CLI option for language selection.

Custom Commit Rules

The tool follows Conventional Commits format by default:

  • feat: - New feature
  • fix: - Bug fix
  • chore: - Maintenance tasks
  • docs: - Documentation
  • refactor: - Code refactoring
  • style: - Code style changes
  • test: - Adding tests

Troubleshooting

"Error: API key not configured"

Run lazy-ai config to set up your API key.

"Error: No staged changes found"

Stage your files first with git add <files>.

Lazygit custom command not working

  1. Verify the config file location
  2. Check YAML indentation (use spaces, not tabs)
  3. Restart Lazygit after configuration changes

Development

Project Structure

src/
├── cli.ts          # CLI commands and entry point
├── ai.ts           # Gemini API integration
├── git.ts          # Git operations (diff extraction)
├── config.ts       # Configuration management
└── rules/
    └── output.ts   # AI prompt rules and formatting

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.


Note: This tool requires staged changes (git add) before generating commit messages. It analyzes the diff to create contextually relevant commit messages.