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

git-reword

v0.0.2

Published

AI-powered Git commit message rewriter

Readme

git-reword

📝 AI-powered Git commit message rewriter.

Features

  • 📚 Batch Rewording: Reword multiple commits at once
  • 🤖 AI-Powered: Generate professional commit messages using AI
  • 🔌 Multi-Provider: Support OpenAI, Anthropic, Google, MiniMax, and more
  • 💬 Interactive UI: Review and accept/skip/regenerate suggestions
  • 🎯 Flexible Targeting: Support --last, --since, range, and single commit
  • ~~☁️ Agent Friendly: First-class integration for AI agents (WIP)~~

Comparison

| Tool | Limitation | | ----------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | | Most AI commit message tools (e.g., aicommits, opencommit) | Only handles the most recent commit | | AI coding assistants (Claude Code, etc.) | Inconvenient for processing batches of commits in conversation | | Manual rebase | Tedious for multiple commits |

Getting Started

Installation

npm i -g git-reword
# or
bun add -g git-reword

Quick Start

# Reword the last commit (default)
git-reword

# Reword the last N commits
git-reword --last 5

# Reword commits from a specific ref
git-reword --since abc1234

# Reword commits in range
git-reword HEAD~3..HEAD

# Reword a specific commit
git-reword abc1234

# Generate commit message for staged changes
git-reword --staged

Usage

Reword Commits

Interactive Mode

Interactive UI displays commits with AI-generated suggestions. For each commit, you can:

  • Accept: Use AI-generated message
  • Skip: Keep original message
  • Regenerate: Request new AI message
  • Abort: Cancel entire operation
# Interactive mode (default)
git-reword --last 3

# Skip confirmation - apply all changes automatically
git-reword --yes --last 3

AI Commit (Staged Changes)

Generate a commit message for staged changes:

# Stage your changes first
git add .

# Generate and apply commit message
git-reword --staged

# Output:
# Suggested message:
# feat(api): add user authentication middleware
#
# Apply? [y/n]
# y: git commit with suggested message
# n: cancel, no commit

Options

| Option | Description | | -------------------- | --------------------------------------------- | | --last <n> | Reword the last N commits | | --since <ref> | Reword commits from ref's next commit to HEAD | | --dry-run | Preview without executing rebase | | --yes, -y | Skip confirmation, apply all changes | | --skip-check, -k | Skip uncommitted changes check (debugging) | | --staged | Generate commit message for staged changes |

Configuration

Create ~/.git-rewordrc:

provider=anthropic
model=claude-sonnet-4-20250514
apiKey=your-api-key

Supported Providers

| Provider | Default Model | | ----------- | ------------------ | | openai | gpt-5-mini | | anthropic | claude-haiku-4-5 | | google | gemini-2.5-flash |

Provider Configuration Examples

OpenAI

provider=openai
model=gpt-5-mini
apiKey=sk-...

Anthropic

provider=anthropic
model=claude-haiku-4-5
apiKey=sk-ant-...

Google

provider=google
model=gemini-2.5-flash
apiKey=AIza...

MiniMax

provider=anthropic
model=MiniMax-M2.5
baseUrl=https://api.minimax.io/anthropic/v1
apiKey=sk-...

MiniMax (CN)

provider=anthropic
model=MiniMax-M2.5
baseUrl=https://api.minimaxi.com/anthropic/v1
apiKey=sk-...

Advanced

GPG Signing

When rewording GPG-signed commits:

  • Signed commits remain signed: git commit --amend without -S preserves the signature
  • Unsigned commits remain unsigned: No new signature is added

If you use GPG-signed commits and git-reword prompts for passphrase during rebase:

  1. Extend GPG agent cache lifetime:

    echo "default-cache-ttl 86400" >> ~/.gnupg/gpg-agent.conf
    echo "max-cache-ttl 604800" >> ~/.gnupg/gpg-agent.conf
    gpgconf --reload gpg-agent
  2. Refresh cache before running git-reword:

    git commit --amend --no-edit -S

Verify signatures after reword:

git log --show-signature -5

Agent Skill Integration (WIP)

The CLI outputs structured text for easy parsing by Skills:

// 1. Preview mode - show what would change
const preview = exec("git-reword --dry-run --last 5");

// 2. Execute mode - apply changes
const result = exec("git-reword --yes --last 5");

// Output:
// ✓ Commit abc123 rewrote
// ✓ Commit def456 rewrote
// Done. 2/2 commits rewrote

Branch Constraint

All reword operations target commits on the current branch only. This tool uses git rebase internally, which replays commits onto the current branch.

# ✅ Correct: operate on current branch
git checkout feature-a
git-reword --last 3

# ✅ Correct: checkout target branch first
git checkout feature-b
git-reword --since abc1234

Pre-flight Checks

Before rewording commits (not --staged):

  1. No uncommitted changes: Ensures safe rebase operation
  2. Fast-forward possible: Verifies commits haven't been rebased or amended

Use --skip-check to bypass these checks (for debugging).

Reference

Exit Codes

| Code | Meaning | | ---- | ------------------------------------------------- | | 0 | Success: all commits rewrote | | 1 | Error: invalid arguments, config error, git error | | 2 | User interrupt: aborted with q or Ctrl+C | | 3 | Partial: some commits rewrote, some skipped |


Apache-2.0 © yelo, 2026 - present