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

conventionalize

v1.0.0

Published

Diff to Conventional Commit Builder CLI tool powered by heuristic & AI diff analysis.

Readme

conventionalize

A terminal CLI tool that reads staged git diffs and suggests Conventional Commit header messages using local heuristic rules or an LLM.


Motivation and prior art

Existing git commit tools fall into two main categories:

  1. Interactive prompts (commitizen, git-cz): These require answering multiple interactive questions for every single commit (selecting type, scope, subject, body, breaking changes). This adds friction for small, frequent atomic commits.
  2. Git hooks (husky, commitlint): These validate commit messages after you write them, but do not help write or format the message.

conventionalize bridges this gap by inspecting git diff --staged before you commit. It analyzes changed file paths, status, and patch hunks to propose a fully formatted Conventional Commit message (type(scope): subject) in one step.


Installation

From npm (recommended)

Install globally via npm:

npm install -g conventionalize

Or run directly without installing using npx:

npx conventionalize

Or install as a project devDependency:

npm install --save-dev conventionalize

From local source directory

Clone the repository and install locally:

git clone https://github.com/akil4/conventionalize.git
cd conventionalize
npm install
npm run build
npm install -g .

From GitHub release archive or Git URL

Install directly from the GitHub repository archive:

npm install -g https://github.com/akil4/conventionalize/archive/refs/tags/v1.0.0.tar.gz

Or enable git dependencies in npm and install via git URL:

npm config set allow-remote true
npm config set allow-git true
npm install -g git+https://github.com/akil4/conventionalize.git

Usage

Interactive mode (default)

Stage your changes and run conventionalize:

git add .
conventionalize

Sample terminal interface:

conventionalize

Staged files (2):
  modified src/core/parser.ts (+15/-2)
  added    tests/parser.test.ts (+35/-0)

Suggested Commit Message:
  feat(core): implement git diff hunk parser and test suite

? Action:
  ❯ Commit change (git commit -m ...)
    Edit header (type, scope, description)
    Print commit text
    Cancel

Direct stdout mode

To output the formatted commit header directly to standard output for use in shell scripts:

conventionalize --raw

Verbose telemetry mode

To view patch size, file counts, provider selection, and analysis latency:

conventionalize --debug

Git hook installation

To automate git commit so it pre-populates commit headers using conventionalize:

conventionalize hook install

This writes a .git/hooks/prepare-commit-msg hook in the current repository.


Configuration

Settings are stored in ~/.gcairc. You can configure settings interactively or view active values:

conventionalize config
conventionalize config --list

Configuration schema:

{
  "provider": "heuristic",
  "model": "gemini-3.7-flash",
  "maxSummaryLength": 72,
  "maxDiffChars": 6000,
  "defaultScope": "core",
  "ticketPrefix": "PROJ-123",
  "autoCopy": false,
  "includeBody": true,
  "debug": false
}

Configuration fields

  • provider: Classification engine to use (heuristic, gemini, openai).
  • apiKey: API key for Gemini or OpenAI providers.
  • model: Target LLM model name (e.g. gemini-3.7-flash, gemini-3.5-flash-lite, gpt-4o-mini, o3-mini).
  • defaultScope: Fallback scope when path inference yields no common top-level directory.
  • ticketPrefix: Prefix prepended to commit subjects (e.g., [PROJ-123]).
  • maxDiffChars: Truncation limit for diff patches sent to LLM providers (default: 6000).

Shell autocompletion

Generate shell tab completion scripts for bash or zsh:

# zsh completion
conventionalize completion zsh > ~/.zsh/completion/_conventionalize

# bash completion
conventionalize completion bash > /etc/bash_completion.d/conventionalize

Trade-offs and limitations

  • Diff size truncation: Diffs exceeding maxDiffChars (default: 6,000 characters) are truncated. For large structural refactors spanning multiple packages, break changes into smaller atomic commits.
  • Non-git directories: conventionalize requires an active git working tree. Running the tool outside a git repository exits with code 1.
  • Offline classification bounds: The default local heuristic classifier relies on path structures and patch keywords. For ambiguous refactors without clear file additions or bug fix keywords, an LLM provider yields higher semantic precision.

Testing

Run the test suite using Vitest:

npm test

Build the TypeScript executable:

npm run build

License

MIT © akil4