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

npm-git-helper

v3.0.0

Published

The Git CLI that writes your commit messages. Stage, commit (with AI), and push in one command.

Readme

npm-git-helper

npm version npm downloads License: ISC Node.js

The Git CLI that writes your commit messages. Stage, commit (with AI), and push — in one command.

You type the same three git commands fifty times a day. git-helper collapses them into one, and — if you set an API key — lets Claude or GPT write the commit message for you from the staged diff.

$ git-helper push --ai
→ Staging 4 change(s)
→ Asking anthropic to draft a commit message…

fix(auth): handle expired tokens in refresh flow

- return 401 instead of 500 when the refresh token is past its
  exp claim, so the client can re-authenticate cleanly

? Use this message? [Y/n] y
→ Committing: fix(auth): handle expired tokens in refresh flow
→ Pushing to origin/fix-auth
✓ Pushed successfully.

No API key? You still get an interactive Conventional Commit wizard, a one-shot WIP commit, safe undo, sync, amend, and a pr shortcut.

Install

npm install -g npm-git-helper

Requires Node.js 18+ and a working git binary.

Quickstart

# AI-drafted commit message
export ANTHROPIC_API_KEY=sk-...      # or OPENAI_API_KEY
git-helper push --ai

# Plain push
git-helper push -m "feat: add login"

# Interactive (Conventional Commit wizard) — runs when no message given
git-helper push

# Save a quick "wip" commit so you can switch branches
git-helper wip

# Pull latest and rebase your work onto it
git-helper sync --autostash

# Undo the last commit (keeps your changes staged)
git-helper undo

# Fix the last commit and force-push safely
git-helper amend -m "fix: typo" --force

# Push and open a PR (needs `gh`)
git-helper pr --draft

Commands

| Command | What it does | | --- | --- | | push | Stage all changes, commit (AI / interactive / -m), push with smart upstream tracking | | sync | Fetch + rebase the current branch onto its remote; --autostash and --push flags | | wip | Quick wip: <timestamp> commit so you can switch branches without losing work | | undo | Soft-reset the last commit (keeps changes staged); --hard to discard | | amend | Restage and amend the last commit; --force does a safe --force-with-lease push | | pr | Push the current branch and open a PR via gh (--draft, --title, --body, …) |

Every command has --help.

AI commits

Set one of these env vars and pass --ai to push:

| Provider | Env var | Default model | Override with | | --- | --- | --- | --- | | Anthropic | ANTHROPIC_API_KEY | claude-haiku-4-5-20251001 | GIT_HELPER_MODEL | | OpenAI | OPENAI_API_KEY | gpt-4o-mini | GIT_HELPER_MODEL |

git-helper only sends the staged diff (truncated to 12k chars). It prompts you to accept, edit, or reject the suggestion — nothing is committed without your confirmation. The output is Conventional Commits by design.

Safety

  • No git add ./*. Uses git add -A so deletions, renames, and dotfiles are correctly captured.
  • Protected branches confirm before push. main, master, production, release — pass --yes to skip.
  • --force means --force-with-lease. No silent overwrites of teammates' work.
  • sync --autostash stashes before rebase and restores after; failure leaves the stash intact.
  • undo defaults to soft. Your changes are kept staged; --hard requires confirmation.

Why not just use aliases / gh?

  • Aliases can't prompt you, generate messages, or chain stage → commit → push with branch handling.
  • gh is for GitHub workflows; this is for the local loop you run before you ever touch the PR.
  • commitizen requires hooks and config; this works in any repo, instantly.

Configuration (optional)

Drop a .git-helperrc (JSON) at the repo root for defaults:

{
  "protectedBranches": ["main", "release"],
  "defaultBranch": "main"
}

Programmatic use

const { runPush } = require("npm-git-helper/lib/commands/push");
await runPush({ message: "chore: bump deps", branch: "deps" });

Contributing

Issues and PRs welcome at github.com/Leslie-23/git-helper. Run the test suite with npm test (uses Node's built-in test runner, no extra setup).

License

ISC © Leslie Paul Ajayi

Links