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

gitcai

v1.0.2

Published

AI-powered Git commit message generator CLI for Conventional Commits using Ollama or Gemini

Readme

gitcai - AI Git Commit Message Generator CLI

npm version

Generate Conventional Commit messages from your Git diff using Ollama or Gemini, then commit from your terminal.

gitcai is an AI Git commit message generator CLI. It reads your staged Git diff, asks Ollama or Gemini to write a clear Conventional Commit message, lets you edit the result, and runs git commit.

Quick Start

npm install -g gitcai
gitcai

What It Does

  • Generates commit messages from your Git changes
  • Creates Conventional Commit messages from staged diffs
  • Supports ollama and gemini
  • Runs a first-time setup when you use it for the first time
  • Lets you edit the generated commit message before committing
  • Auto-stages files when nothing is staged
  • Can push after commit with --push
  • Stores user config outside your repository
  • Automatically excludes lockfiles from the diff sent to AI to save tokens and improve message quality

Requirements

  • Node.js 20 or newer
  • Git
  • One AI provider:
    • Ollama local or remote server
    • Gemini API key

Install

From npm

npm install -g gitcai

Then run:

gitcai

From Yarn

yarn global add gitcai

Then run:

gitcai

From This Repository

git clone https://github.com/VanChung369/gitcai.git
cd gitcai
yarn install
yarn build
yarn link

Now the gitcai command is available globally on your machine.

First-Time Setup

The first time you run:

gitcai

the tool asks for only the required setup:

  • AI provider: ollama or gemini
  • Commit message language: English or Vietnamese
  • Provider-specific values:
    • Ollama: base URL and model
    • Gemini: API key and model

You can also run setup manually:

gitcai config setup

Basic Usage

Go to any Git repository:

cd path/to/your/repo

Run:

gitcai

The tool will:

  1. Read staged changes
  2. Auto-stage files if nothing is staged
  3. Generate a commit message
  4. Let you edit the message
  5. Ask for confirmation
  6. Run git commit

Commit and push:

gitcai --push

Skip editing:

gitcai --no-edit

Skip confirmation:

gitcai --yes

Skip both editing and confirmation:

gitcai --no-edit --yes

Do not auto-stage files:

gitcai --no-stage

Ollama Setup

Local Ollama:

gitcai config set provider ollama
gitcai config set ollamaUrl http://localhost:11434
gitcai config set model qwen2.5:1.5b

Remote Ollama:

gitcai config set provider ollama
gitcai config set ollamaUrl https://ai.example.com
gitcai config set model qwen2.5:1.5b

Use without saving config:

gitcai --provider ollama --ollama-url http://localhost:11434 --model qwen2.5:1.5b

Gemini Setup

Save Gemini config:

gitcai config set provider gemini
gitcai config set model gemini-2.5-flash
gitcai config set geminiApiKey YOUR_API_KEY

Use an environment variable instead:

set GEMINI_API_KEY=YOUR_API_KEY
gitcai --provider gemini

On macOS or Linux:

export GEMINI_API_KEY=YOUR_API_KEY
gitcai --provider gemini

Use without saving config:

gitcai --provider gemini --gemini-api-key YOUR_API_KEY --model gemini-1.5-flash

Config Commands

Run setup again:

gitcai config setup

Show all config:

gitcai config list

Get one value:

gitcai config get provider

Set one value:

gitcai config set language vi

Reset config:

gitcai config reset

Show config file path:

gitcai config path

Config is stored in a user-level JSON file using conf. It is not committed to your project.

Useful Options

gitcai --provider ollama
gitcai --provider gemini
gitcai --language en
gitcai --language vi
gitcai --max-length 72
gitcai --max-diff-chars 10000
gitcai --temperature 0.2

Ollama-specific:

gitcai --num-predict 40

Gemini-specific:

gitcai --max-output-tokens 1280

Troubleshooting

Current directory is not a Git repository

Run the command inside a Git repository:

cd path/to/your/repo
gitcai

Ollama Request Timeout

If your Ollama server is slow or behind a proxy, reduce the diff size:

gitcai --max-diff-chars 2000 --num-predict 30

Gemini API Key Missing

Set the key:

gitcai config set geminiApiKey YOUR_API_KEY

or:

set GEMINI_API_KEY=YOUR_API_KEY

Development

yarn install
yarn dev -- --help
yarn dev -- config setup
yarn build

Run the built CLI:

node dist/cli.js --help

Link locally:

yarn build
yarn link
gitcai --help

Unlink:

yarn unlink

Security Notes

gitcai sends your staged diff to the configured AI provider. Do not use a remote provider for changes that contain secrets, credentials, private keys, or sensitive code.