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 🙏

© 2026 – Pkg Stats / Ryan Hefner

auto-git-ai

v1.0.1

Published

Automated Git workflow with AI-generated commit messages using Gemini API

Readme

auto-git-ai

🚀 Automated Git workflow with AI-generated commit messages using Google Gemini API

This CLI tool automates your Git workflow by:

  • Staging all changes (git add .)
  • Generating meaningful commit messages using AI
  • Committing with the AI-generated message
  • Pushing to your remote repository

🎯 Features

  • 🤖 AI-Powered Commit Messages: Uses Google's Gemini AI to analyze your changes and generate descriptive commit messages
  • ⚡ One Command Workflow: Single command to stage, commit, and push
  • 🎨 Beautiful Output: Colorful console output with clear status messages
  • 🛡️ Error Handling: Comprehensive error handling with helpful tips
  • 📝 Conventional Commits: Follows conventional commit format when applicable

📦 Installation

Global Installation (Recommended)

npm install -g auto-git-ai

Local Installation

npm install auto-git-ai

🔧 Setup

  1. Get a Gemini API Key:

  2. Set Environment Variable:

    Option 1: Global Environment Variable

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

    Option 2: Project .env file Create a .env file in your project root:

    GEMINI_API_KEY=your-api-key-here

🚀 Usage

Run in any Git repository with a remote configured:

auto-git

Example Output

🚀 Auto-git: Automated Git workflow with AI
📁 Staging all changes...
🤖 Generating commit message with AI...
📦 Commit message: feat: add user authentication and login validation
💾 Committing changes...
🚀 Pushing to origin/main...
✅ Successfully pushed changes to remote repository!

📋 Requirements

  • Node.js: Version 14.0.0 or higher
  • Git: Properly configured with a remote repository
  • Gemini API Key: Valid Google Gemini API key
  • Internet Connection: Required for AI API calls

🔍 What It Does

  1. Checks Git Repository: Verifies you're in a valid Git repository
  2. Stages Changes: Runs git add . to stage all modifications
  3. Analyzes Changes: Gets the diff of staged changes
  4. Generates Commit Message: Sends diff to Gemini AI for analysis
  5. Commits: Creates commit with AI-generated message
  6. Pushes: Pushes to the current branch on origin

⚠️ Error Handling

The tool handles common scenarios gracefully:

  • No Git Repository: Clear error message if not in a Git repo
  • No Changes: Exits gracefully if nothing to commit
  • No Remote: Helpful tip to configure remote repository
  • API Failures: Falls back to generic commit message
  • Network Issues: Timeout handling and error messages

🎨 Commit Message Format

The AI generates commit messages following these guidelines:

  • Length: Maximum 50 characters
  • Format: Conventional commit format when applicable
  • Types: feat:, fix:, docs:, style:, refactor:, test:, chore:

🔐 Security

  • API key is read from environment variables only
  • No sensitive data is logged or stored
  • Git credentials use your existing Git configuration

🐛 Troubleshooting

"GEMINI_API_KEY environment variable not set"

Make sure you've set the API key as described in the setup section.

"Not in a Git repository"

Navigate to a directory that contains a Git repository.

"No such remote 'origin'"

Configure a remote repository:

git remote add origin <your-repo-url>

"Failed to push changes"

Ensure you have push permissions to the remote repository.

📄 License

MIT License - see LICENSE file for details.

🤝 Contributing

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

🔗 Links

Test npm version