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

bodhi-commit-genius-js

v1.0.0

Published

πŸš€ Smart commit message generator with AI - supports local LLMs and cloud APIs

Maintainers

bodheeshbodheesh

Keywords

bodhicommit-geniusgitcommitaiartificial-intelligencemachine-learningconventional-commitsollamaopenaigptcliautomationdeveloper-toolsproductivitygit-automationcommit-messagesemantic-commitsversion-controlgit-workflowcode-qualitycode-reviewbest-practiceslocal-llmcloud-aioffline-modesmart-commitsgit-toolsgit-hookscommit-conventioncommit-lintcommit-formatcommit-standardsgit-commitgit-messagegit-historyrepositorysource-controldevelopment-workflowteam-collaborationcode-managementtypescriptjavascriptnodejsnpm-packagedev-toolscoding-assistantai-poweredbodhi-toolsai-assistantcode-automationdevelopment-toolssoftware-developmentprogrammingcodingdeveloper-experiencedxdevopscontinuous-integrationci-cdagilescrumgit-flowgithubgitlabbitbucketversion-managementcode-versioningrepository-managementcommit-historygit-loggit-commandsgit-clicommand-lineterminalshellbashpowershellzshdevelopment-environmentide-integrationvscodevisual-studio-codeintellijwebstormcode-editordevelopment-workflowteam-productivitycollaboration-toolscode-collaborationteam-developmentproject-managementsoftware-engineeringengineering-toolscode-organizationrepository-structuremonorepomulti-repogit-repositorybranch-managementmerge-requestspull-requestscode-changeschange-trackingcode-historycommit-trackingsemantic-versioningsemverchangelogrelease-notesdocumentationcode-documentationapi-documentationtechnical-documentationcode-standardscoding-guidelinesstyle-guidecode-consistencyteam-standardsdevelopment-standardscode-maintainabilitycode-readabilityclean-coderefactoringcode-improvementperformance-optimizationcode-optimizationdebuggingtestingunit-testingintegration-testingtest-automationquality-assuranceqacode-review-toolspeer-reviewteam-reviewcode-analysisstatic-analysisdynamic-analysiscode-metricscode-coveragesecuritycode-securitysecure-developmentdevsecopsopen-sourceossfree-softwarecommunitydeveloper-communityprogramming-toolssoftware-toolsdevelopment-kitsdkapirest-apigraphqlweb-developmentfrontendbackendfull-stackcross-platformmulti-platformwindowslinuxmacosunixcloudcloud-computingsaaspaasiaasmicroservicesserverlesscontainersdockerkubernetesscalabilityreliabilitymaintainabilityextensibilitymodularityreusability

Readme

πŸš€ Bodhi Commit Genius JS

A powerful npm package that generates smart, AI-powered commit messages for your Git repositories. Works offline with smart heuristics, with cloud AI (OpenAI), or with local AI models (Ollama). Perfect for developers, teams, and organizations looking to maintain clean, consistent, and meaningful Git history.

πŸ“¦ Installation

# Install globally
npm install -g bodhi-commit-genius-js

# Or install in your project
npm install --save-dev bodhi-commit-genius-js

πŸš€ Usage Examples

Basic Usage

# Generate message for staged changes
bodhi commit

# Stage and commit all changes
bodhi commit .

# Stage specific files
bodhi commit src/feature.ts tests/feature.test.ts

# Use specific provider
bodhi commit --provider openai
bodhi commit --provider ollama
bodhi commit --provider simple

🎯 Why Choose Bodhi Commit Genius?

  • πŸ€– AI-Powered Intelligence: Uses advanced AI to understand your code changes
  • πŸ”„ Works Offline: Smart heuristics work without internet or AI
  • πŸ›‘οΈ Fallback Protection: Automatically switches to offline mode if AI is unavailable
  • πŸ“Š Smart Analysis: Understands code patterns, file types, and change context
  • 🌐 Multiple AI Options: Choose between cloud AI (OpenAI) or local AI (Ollama)
  • πŸ’° Cost-Effective: Free offline mode, optional AI integration
  • πŸ”’ Privacy-Focused: Local AI option for sensitive code
  • πŸš€ Developer-Friendly: Easy setup, works with existing Git workflow

✨ Features

  • πŸ€– Smart commit message generation using multiple providers:
    • πŸ“ Simple mode: No dependencies, works offline using smart heuristics
    • 🌐 OpenAI mode: Uses OpenAI's GPT models (requires API key)
    • πŸ’» Ollama mode: Uses local LLMs (requires Ollama installation)
  • πŸ“Š Intelligent diff analysis for better context understanding
  • 🎯 Conventional commits support with type inference
  • ⚑ Git hooks integration for seamless workflow
  • πŸ”§ Customizable commit message templates
  • πŸ’» Interactive mode for message editing
  • πŸš€ TypeScript support out of the box

Advanced Examples

# Custom commit template
bodhi commit --template "type(scope): message"

# Interactive mode
bodhi commit -i

# With OpenAI key
bodhi commit --provider openai --api-key your-key

# With specific Ollama model
bodhi commit --provider ollama --model codellama

Example Commit Messages

  1. Feature Addition

    feat(auth): add OAuth2 authentication with Google provider
  2. Bug Fix

    fix(api): handle null response in user service
  3. Code Refactoring

    refactor(core): move API routes to dedicated modules
  4. Documentation

    docs(api): add OpenAPI specification and examples
  5. Testing

    test(auth): add integration tests for login flow
  6. Performance

    perf(db): optimize user query with index

Configuration

Create a .commitgenius.json in your project root or configure via CLI:

{
  "provider": "simple", // "simple", "ollama", or "openai"
  "model": "codellama", // for ollama provider
  "apiKey": "your-openai-key", // for openai provider
  "template": "{type}: {description}",
  "conventionalCommits": true
}

πŸ€– Provider Setup Guide

Commit Genius offers three modes of operation, giving you the flexibility to use it with or without AI capabilities:

1. Simple Mode (Default) - No AI Required

The simplest way to get started - works offline and requires no additional setup.

✨ Features:

  • Works completely offline
  • No API keys or external dependencies
  • Smart heuristics for commit type detection
  • Conventional commit format support
  • Analyzes file changes and code patterns

πŸš€ Setup:

# Just install and use!
npm install -g bodhi-commit-genius-js
bodhi commit

2. OpenAI Mode - Cloud AI

Get high-quality commit messages using OpenAI's GPT models. Requires an API key but offers the best quality.

✨ Features:

  • High-quality, context-aware commit messages
  • Understands complex code changes
  • Best semantic analysis of changes
  • Handles multiple files intelligently

πŸ”‘ Setup:

  1. Get your OpenAI API key:

  2. Configure Commit Genius:

    # Set API key permanently
    cmg config set apiKey your-openai-key
    cmg config set provider openai
       
    # Or use per command
    bodhi commit --provider openai --api-key your-openai-key

πŸ’‘ Note: If OpenAI is unavailable or the API key is invalid, Commit Genius will automatically fall back to simple mode.

3. Ollama Mode - Local AI

Run AI locally on your machine. Free to use and privacy-friendly, but requires local installation.

✨ Features:

  • Runs completely locally
  • No API keys needed
  • Good balance of quality and privacy
  • Multiple models supported

πŸš€ Setup:

  1. Install Ollama:

    • Windows:
      # Download and install from:
      https://ollama.ai/download/windows
    • Mac:
      brew install ollama
    • Linux:
      curl -fsSL https://ollama.ai/install.sh | sh
  2. Pull the model (one-time setup):

    ollama pull codellama
  3. Configure Commit Genius:

    # Set as default provider
    cmg config set provider ollama
       
    # Or use per command
    bodhi commit --provider ollama

πŸ’‘ Note: If Ollama is not running or encounters an error, Commit Genius will automatically fall back to simple mode.

Comparison of Modes

| Feature | Simple | OpenAI | Ollama | |---------------------------|----------------|----------------|----------------| | Setup Required | None | API Key | Local Install | | Works Offline | βœ… | ❌ | βœ… | | Message Quality | Good | Best | Very Good | | Privacy | Best | Cloud-Based | Local Only | | Cost | Free | Pay-per-use | Free | | Speed | Fastest | Fast | Moderate | | Resource Usage | Minimal | Cloud-Based | Local GPU/CPU |

πŸ”§ Integration Guide

Git Hooks Setup

  1. Automatic Setup

    {
      "scripts": {
        "prepare": "bodhi-commit-genius-js install-hooks"
      }
    }
  2. Manual Setup

    # Install husky
    npm install husky --save-dev
       
    # Add prepare script
    npm pkg set scripts.prepare="husky install"
       
    # Add commit-msg hook
    npx husky add .husky/commit-msg 'npx bodhi validate $1'

CI/CD Integration

# GitHub Actions Example
name: Validate Commits
on: [pull_request]

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
      - run: npm install -g bodhi-commit-genius-js
      - run: cmg validate --from ${{ github.event.pull_request.base.sha }}

IDE Integration

  1. VS Code

    • Install Git Lens extension
    • Configure external diff tool
    • Use with VS Code source control
  2. JetBrains IDEs

    • Use with built-in VCS
    • Configure external diff tool
    • Terminal integration

πŸ“š Best Practices

  1. Commit Organization

    • One logical change per commit
    • Clear, descriptive messages
    • Reference issues when relevant
  2. Message Structure

    type(scope): description
       
    [optional body]
    [optional footer]
  3. Common Types

    • feat: New features
    • fix: Bug fixes
    • docs: Documentation
    • style: Formatting
    • refactor: Code restructuring
    • test: Adding tests
    • chore: Maintenance
  4. Scopes

    • Module names
    • Feature areas
    • Components
    • File types

πŸ“ License

MIT

πŸ™ Contributing

Contributions are welcome! Please feel free to submit a Pull Request.