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

@thankarezos/git-ai-commit

v0.1.5

Published

Generate editable git commit messages using a configurable AI CLI

Downloads

743

Readme

git-aic

Generate a git commit message from your staged diff using any AI CLI you already have on your machine (Claude Code, Antigravity CLI, Codex, llm, Ollama, or a custom command). The message opens in your editor — save to commit, quit without saving to abort.

$ git aic -ap "mention the migration"
# (AI runs against your staged diff, message opens in nano)
# Save -> commit. Quit without saving -> abort.

Install

npm install -g @thankarezos/git-ai-commit

Requires Node 18+. Because the binary is named git-aic, git resolves git aic automatically.

Install from source

git clone https://github.com/thankarezos/git-ai-commit.git
cd git-ai-commit
npm link

Quick start

git add <files>
git aic                          # generate, edit, commit
git aic -a                       # stage everything first (git add -A)
git aic -p "be terse"            # add hints to the prompt
git aic -ap "be terse"           # combine -a and -p
git aic --no-commit              # generate + edit only, don't commit

First run launches an interactive wizard that asks you to pick a provider, editor, and behavior flags, and writes the result to ~/.config/git-aic/config.json. You can re-run it any time with git aic --init.

Flags

| Flag | Meaning | |---|---| | -a, --add | Run git add -A before generating | | -p "...", --prompt "..." | Append extra instructions to the AI prompt | | -ap "...", -pa "..." | Combine -a and -p | | --provider <name>, -P <name> | One-off provider override. <name> matches a preset command (claude, agy, codex, opencode, llm, ollama). | | --no-commit | Generate and edit, but skip the git commit | | --commit | Force commit (overrides commit: false in config) | | --require-edit | Refuse to commit if the saved message is byte-identical to what the AI produced | | --no-require-edit | Allow committing the AI message unchanged | | --init | Run the interactive setup wizard | | --config | Print the active config path and contents | | -v, --version | Print the package version | | -h | Show usage. (--help is intercepted by git, so use -h.) |

How it decides to commit

After the AI generates a message, the file opens in your editor:

  • Save (Ctrl+XY in nano, :wq in vim) → commits.
  • Quit without saving (Ctrl+XN, :q!) → aborts with File not saved. Aborted.
  • With requireEdit: true, the saved content must additionally differ from the AI's output, otherwise it aborts with No edit detected. Aborted.

Configuration

Stored at ~/.config/git-aic/config.json (override with GIT_AIC_CONFIG=/path/to/config.json):

{
  "provider": {
    "command": "claude",
    "args": ["-p", "{prompt}"]
  },
  "editor": "nano",
  "commit": true,
  "requireEdit": false
}
  • provider.command — the binary to invoke.
  • provider.args — argv passed to that binary. {prompt} and {diff} are placeholders. If neither {prompt} nor {diff} appear in the args, the prompt is appended as the last arg and the diff is piped on stdin.
  • editor — the editor command (overridden by $EDITOR if set).
  • commit — whether to actually git commit after editing.
  • requireEdit — require the saved message to differ from the AI output.

Overriding prompts and cleanup patterns

The wizard (git aic --init) writes the full defaults into your config so you can see and edit everything in one place. Any of these fields can be removed, changed, or extended:

  • prompt — array of lines sent to the AI. Include {extraPrompt} somewhere if you want -p "..." to keep working.
  • commitMessageTag — the XML tag the AI is told to wrap the message in.
  • removeLinesMatching — case-insensitive regex strings; matching lines are stripped from the AI's output.
  • stopLinesMatching — case-insensitive regex strings; lines from the first match onward are dropped (used to cut off AI rambling).

Each field in your user config replaces the default if present. If you delete a field entirely, the built-in default from bin/prompts.json is used instead.

Providers

The wizard ships with presets for:

  • Claude Codeclaude -p "{prompt}" (reads diff from stdin)
  • Antigravity CLIagy -p "{prompt}"
  • Codex CLIcodex exec --skip-git-repo-check "{prompt}"
  • OpenCodeopencode run "{prompt}"
  • llm (Simon Willison) — llm "{prompt}"
  • Ollamaollama run llama3 "{prompt}"
  • Custom — type your own command and args

You can edit provider in the config file at any time, or rerun git aic --init.

Windows note

Most CLIs work the same on Windows. The exception is a CLI that renders its output to the console instead of stdout (like agy): to capture it, git-aic must spawn it with no console, which briefly flashes a console window. A provider can opt into this with a windows field carrying extra spawn options:

"provider": {
  "command": "agy",
  "args": ["-p", "{prompt}"],
  "windows": { "detached": true }
}

CLIs that write to stdout (e.g. claude) don't need this and run without any window.

Customizing the prompt

git aic --init copies the prompt template, the <commit_message> tag, and the cleanup patterns into your config file (run git aic --config to see its path and contents). Edit the config file to customize them — these values override the built-in defaults:

  • Change tone, rules, or allowed Conventional Commit types in prompt.
  • Add line patterns to removeLinesMatching to strip more AI boilerplate.
  • Add line patterns to stopLinesMatching to cut off output when the AI starts rambling.

Patterns are case-insensitive JS regex strings.

The built-in defaults live in bin/prompts.json; editing that only changes the fallback for fields your config doesn't set, and is overwritten on reinstall — so prefer the config file.

Tests

npm test

Uses Node's built-in test runner (no external dependencies). Tests cover cleanCommitMessage, extractCommitMessage, and the config merge logic.

License

MIT