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

@amnesia2k/git-aic

v2.1.12

Published

Git AIC

Readme

Git AIC: AI-Powered Conventional Commits

Git AIC is a TypeScript CLI for two related workflows inside a Git repository:

  • generating AI-assisted conventional commit messages from staged changes
  • generating AI-explained markdown diff reports from selected working-tree changes

It is built for local Git usage with interactive file selection, Gemini-based summarization, and a low-friction terminal UX.

What It Does

Commit flow

git aic

  • inspects the repository for changed files
  • auto-stages deleted files and excludes them from the selection list
  • shows the remaining local changes and lets you choose which ones to stage
  • stages only the files you selected, then generates the commit from that staged set
  • sends the staged diff to Gemini
  • generates a Conventional Commits style message
  • commits with that message

git aic --push / git aic -p

  • runs the same commit flow
  • pushes after a successful commit

Diff report flow

git aic --diff / git aic -d

  • inspects the repository for changed files
  • lets you choose which files should be included in the report when there are multiple changed files
  • does not stage or unstage files for the diff workflow
  • reads the selected changes directly from the working tree
  • generates a markdown report in git-diffs/
  • explains each selected file diff with AI
  • includes current repo metadata such as branch and base commit hash

Key Behaviors

  • Conventional commit generation: Commit messages are guided by strict prompt rules.
  • Single logical change stays one line: If multiple files all belong to one logical change, the generated commit message stays a one-line summary.
  • Unrelated changes may become a list: If the changes are clearly unrelated, the generated commit message may use a summary line plus bullet points.
  • Interactive file selection: Multi-file changes open a selector so the user can choose the exact file set to commit, push, or document.
  • AI diff reports: Diff reports explain the selected changes before showing the raw patch.
  • Structured diff naming: Report filenames use a concise type-topic.md format such as feat-auth-flow.md.
  • Organized output: Reports are written to git-diffs/ in the current working directory.
  • Git ignore support: On the first diff report run that creates git-diffs/, the tool adds git-diffs/ to the current directory’s .gitignore if it is not already ignored.
  • Visible loading states: Uses cli-loaders with the arrows_3 loader and step-specific status messages.
  • Retry-safe AI requests: Retries temporary Gemini rate limits and transient failures, then falls back cleanly if needed.

Diff Report Contents

Each generated markdown report includes:

  • report title
  • metadata section
  • generated timestamp
  • current branch
  • short base commit hash
  • full base commit hash
  • selected file list
  • one section per file
  • AI explanation above the raw diff block

Installation

1. Global Installation (Standard)

The easiest way to use Git AIC is to install it globally via npm or bun:

npm install -g @amnesia2k/git-aic
# or
bun install -g @amnesia2k/git-aic

Once installed, you can skip the manual setup and use the built-in configuration commands:

  • git-aic set-key your_gemini_api_key_here
  • git-aic alias

2. Local Development (Clone)

For developers or users who want to run the tool from the source code:

  1. Clone the repository:
git clone https://github.com/amnesia2k/git-aic.git
cd git-aic
  1. Install dependencies:
bun install
  1. (Optional) Link the package locally:
npm link

Configuration & API Key

Git AIC requires a Google Gemini API key.

A. Persistent Configuration (Recommended)

You can securely store your API key in your user profile:

git-aic set-key your_gemini_api_key_here

To see your current configuration:

git-aic show

B. Environment Variables (Manual)

Alternatively, you can set the GEMINI_COMMIT_MESSAGE_API_KEY variable.

Windows PowerShell:

setx GEMINI_COMMIT_MESSAGE_API_KEY "your_gemini_api_key_here"

MacOS & Linux:

export GEMINI_COMMIT_MESSAGE_API_KEY=your_gemini_api_key_here

Restart the terminal after setting the variable.

Usage

1. The "git aic" Alias

To use the tool as a native Git subcommand (git aic), you need to set up a Git alias.

Option A: Automatic Setup (Global NPM)

If you installed via NPM, run:

git-aic alias

Option B: Manual Setup (Local Clone)

If you are running from a local clone, point the alias to your entry point:

Windows PowerShell:

git config --global alias.aic '!npx tsx "C:/Users/YourName/path/to/git-aic/bin/cli.ts"'

macOS / Linux:

git config --global alias.aic '!npx tsx "/Users/YourName/path/to/git-aic/bin/cli.ts"'

2. Commands

Generate and create a commit:

git aic

Generate, commit, and push:

git aic --push

Generate a markdown diff report:

git aic --diff

Show current configuration:

git aic show

Display help:

git aic help

[!TIP] Use git aic help or git aic -h to see the help menu. Git reserves --help for its own internal documentation search, which causes raw --help to fail on custom aliases.

Also supported:

git aic -d : This is a shortcut for `git aic --diff`
git aic -p : This is a shortcut for `git aic --push`

Important Workflow Notes

Commit mode auto-stages deletions, then stages your selection

Commit workflows are based on the staged diff.

When you run git aic or git aic --push:

  • deleted files are staged automatically and are not shown in the selection list
  • the tool lists the remaining local changes and prompts you to choose which ones to stage
  • only the files you selected, plus the auto-staged deletions, remain staged for the commit
  • the final commit message is generated from the resulting staged diff

Diff mode does not stage files

Diff report workflows are based on the selected changes directly.

When you select files for -d / --diff:

  • the tool does not stage files
  • the tool does not unstage files
  • the tool reads the selected diffs and generates the markdown report from them

This keeps the report flow non-destructive and avoids changing index state unnecessarily.

Example Output Location

Example generated report paths:

  • git-diffs/feat-auth-flow.md
  • git-diffs/fix-config-loading.md
  • git-diffs/refactor-cli-loader.md

If a filename already exists, numeric suffixes are used:

  • feat-auth-flow.md
  • feat-auth-flow-1.md
  • feat-auth-flow-2.md

Technologies Used

| Technology | Description | | ------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- | | TypeScript | Primary language for robust and scalable code. | | Node.js | JavaScript runtime used to execute the CLI tool. | | Bun | Fast all-in-one JavaScript runtime. | | Google Gemini | Large Language Model for intelligent commit message generation. | | Axios | Promise-based HTTP client for API requests. | | simple-git | Facilitates Git operations programmatically. | | Clack Prompts | Interactive command-line interface prompts. | | cli-loaders | Provides animated terminal loaders for visible CLI progress. | | Chalk | Terminal string styling for enhanced readability. | | Commander.js | Framework for building robust command-line interfaces. | | tsx | Runs the TypeScript CLI entrypoint directly during local usage. | | ts-node | Supports direct TypeScript execution in the project scripts. |

License

This project is licensed under the MIT License. See the file for details.

Author Info

Developed by a passionate software engineer.

Badges

TypeScript Node.js NPM Version License: MIT

Readme was generated by Dokugen