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

commit-now-myfriend

v0.1.4

Published

AI-assisted Git commit workflow CLI.

Readme

commit-now-myfriend

AI-assisted Git commit workflow from your terminal.

npm version Node.js Version License: MIT

cnm inspects your staged diff, generates a commit message with your AI provider, then lets you confirm, edit, regenerate, or cancel.

Quick Start · Configuration · CLI Reference · Troubleshooting


Why use it?

Writing good commit messages is valuable, but it can interrupt the flow. commit-now-myfriend keeps the workflow in Git: stage your changes, run cnm, review the generated message, and commit only when you approve it.

Key features:

  • Generates commit messages from staged Git diffs and changed file metadata.
  • Learns repository style from recent commits when promptStyle is auto.
  • Supports OpenAI Responses, Anthropic Messages, Google Gemini, and OpenAI-compatible APIs.
  • Warns about likely secrets, detached HEAD, unstaged files, untracked files, and interrupted Git operations.
  • Offers human-friendly prompts plus JSON output for scripts.

[!IMPORTANT] Your staged diff is sent to the configured AI provider. Review the provider's data handling policy before using cnm on sensitive code.

Quick start

Prerequisites

  • Node.js 20 or newer
  • Git available on PATH
  • An API key for one supported AI provider

Install

npm install -g commit-now-myfriend

Or run it without a global install:

npx commit-now-myfriend

[!NOTE] The package installs the cnm binary. If another tool already uses that name, run npx commit-now-myfriend or npm exec --package commit-now-myfriend cnm.

First commit

cnm init
git add <files>
cnm

The default flow is:

  1. Inspect the repository and staged changes.
  2. Generate a commit message with the configured provider.
  3. Show a preview with warnings, files, and the proposed message.
  4. Let you confirm, edit, regenerate, or cancel.
  5. Run git commit only after confirmation.

If no files are staged and you are in an interactive terminal, cnm can ask whether to stage all current changes. In JSON or non-interactive mode, stage files manually first.

Providers

Configure a provider interactively:

cnm init

Or set it directly:

cnm init \
  --provider openai-responses \
  --model gpt-5.4-mini \
  --api-key <api-key>

Supported provider IDs:

| Provider | Use for | Required config | Default model | | --- | --- | --- | --- | | openai-responses | OpenAI Responses API | apiKey | gpt-5.4-mini | | anthropic-messages | Anthropic Messages API | apiKey | claude-haiku-4-5-20251001 | | google-gemini | Google Gemini API | apiKey | gemini-3-flash-preview | | openai-compatible | OpenAI-compatible or local gateways | apiKey, baseURL | gpt-5.4-mini |

For OpenAI-compatible providers, include a base URL:

cnm init \
  --provider openai-compatible \
  --base-url <base-url> \
  --model <model> \
  --api-key <api-key>

Configuration

cnm merges configuration in this order, with later sources taking precedence:

  1. User config: ~/.cnm/config.json
  2. Project config: .cnmrc.json
  3. Environment variables
  4. CLI flags

Project config is useful for shared defaults, but apiKey is ignored there by design.

{
  "provider": "anthropic-messages",
  "model": "claude-haiku-4-5-20251001",
  "promptStyle": "conventional"
}

Environment variables

Prefer environment variables for API keys:

export CNM_PROVIDER="openai-responses"
export CNM_MODEL="gpt-5.4-mini"
export CNM_API_KEY="<api-key>"

Available variables:

| Variable | Maps to | | --- | --- | | CNM_PROVIDER | provider | | CNM_MODEL | model | | CNM_BASE_URL | baseURL | | CNM_PROMPT_STYLE | promptStyle | | CNM_CUSTOM_PROMPT | customPrompt | | CNM_API_KEY | apiKey | | CNM_HOME | user config directory, default ~/.cnm |

[!WARNING] API keys set with cnm init --api-key or cnm config set apiKey are stored in plaintext in the user config file. cnm attempts to set 0600 permissions on Unix-like systems, but environment variables are still the safer default.

Manage config

# Interactive config panel in a TTY
cnm config

# Print effective config
cnm config list
cnm config list --json

# Read or update one key
cnm config get provider
cnm config set promptStyle conventional
cnm config unset baseURL

Config keys: provider, model, baseURL, promptStyle, customPrompt, apiKey.

Commit message styles

| Style | Behavior | | --- | --- | | auto | Infer style from recent non-merge commits; falls back to Conventional Commits. | | conventional | Use type(scope)?: subject with an optional body. | | angular | Use Angular-style commit subjects. | | google | Use a short imperative subject and an optional explanatory body. | | atom | Use a concise imperative subject, with a body only when useful. | | plain | Use a concise natural-language message without strict prefixes. | | custom | Use your customPrompt instructions. |

Examples:

cnm --prompt-style conventional
cnm --prompt-style custom --custom-prompt "Write concise Chinese commit messages"

CLI reference

cnm

Generate a commit message for staged changes and optionally create the commit.

cnm [options]

| Option | Description | | --- | --- | | --dry-run | Generate a preview without creating a commit. | | --json | Emit machine-readable output; the root workflow returns a preview instead of committing. | | --provider <provider> | Override the provider for this run. | | --model <model> | Override the model for this run. | | --base-url <baseUrl> | Override baseURL for this run. | | --prompt-style <promptStyle> | Override the commit message style. | | --custom-prompt <customPrompt> | Add custom instructions for this run. |

cnm init

Create or update user configuration.

cnm init [options]

Options: --provider, --model, --base-url, --prompt-style, --custom-prompt, --api-key, --dry-run, --json.

cnm config

Inspect and edit configuration.

cnm config
cnm config get [key] [--json]
cnm config list [--json]
cnm config set <key> <value>
cnm config unset <key>

cnm doctor

Diagnose Node.js, Git, repository state, config files, permissions, and effective provider setup.

cnm doctor
cnm doctor --json

Safety and privacy

  • cnm never runs git push.
  • cnm does not amend, rebase, or modify code.
  • Commits are created with git commit -F only after interactive confirmation.
  • Large staged diffs are truncated before being sent to the provider.
  • Potential secrets in staged diffs are reported as warnings before generation.
  • Project-level apiKey values are ignored to avoid committing shared secrets.

Troubleshooting

cnm is not configured yet

Run the setup wizard or provide configuration through environment variables:

cnm init
cnm doctor

No staged changes found

Stage files first, especially in JSON or non-interactive mode:

git add <files>
cnm

OpenAI-compatible provider requires baseURL

Set it in config, env, or a one-off command:

cnm config set provider openai-compatible
cnm config set baseURL <base-url>

Git identity is missing

Configure Git before committing:

git config user.name "Your Name"
git config user.email "[email protected]"

cnm launches a different command

Use the package name explicitly:

npx commit-now-myfriend
npm exec --package commit-now-myfriend cnm

Development

pnpm install
pnpm dev -- --help
pnpm test
pnpm typecheck
pnpm build
npm pack --dry-run