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

@pmatheis/goodgit

v1.2.21

Published

CLI tool for GoodGit Commit - AI-powered commit message generation

Downloads

28

Readme

GoodGit Commit CLI

AI-powered Git commit message generator that analyzes your staged changes and suggests clear, conventional commit messages.

Features

  • 🤖 AI-Powered: Uses OpenAI to analyze code changes and generate meaningful commit messages
  • 📝 Conventional Commits: Follows conventional commit standards (feat:, fix:, docs:, etc.)
  • 🎯 Smart Analysis: Detects programming language and repository context
  • Interactive: Choose from multiple suggestions or enter custom messages
  • 🔧 Configurable: Customize API settings, themes, and default behaviors
  • 🚀 Fast: Quick setup and instant suggestions

Installation

From Source

# Clone the repository
git clone https://github.com/goodgit/commit.git
cd commit/cli

# Install dependencies
npm install

# Build the CLI
npm run build

# Install globally
npm link

From NPM (Coming Soon)

npm install @pmatheis/goodgit

Quick Start

  1. Get your API key from the GoodGit dashboard

  2. Setup (first time only):

    goodgit setup

    You'll need to provide your API key during setup.

  3. Stage your changes:

    git add .
  4. Generate commit message:

    goodgit generate

Usage

Basic Commands

# Generate commit message from staged changes
goodgit generate
goodgit gen

# Sync local repository commits to GoodGit
goodgit sync

# Setup configuration
goodgit setup

# Manage configuration
goodgit config

# Show version information
goodgit version

Advanced Options

Generate Command

# Force specific commit type
goodgit generate --type feat

# Add scope to commit message
goodgit generate --scope auth

# Include detailed body
goodgit generate --body

# Auto-accept first suggestion
goodgit generate --yes

# Dry run (show suggestions without committing)
goodgit generate --dry-run

# Custom API URL
goodgit generate --api-url https://api.goodgit.com

Sync Command

# Sync last 100 commits (default)
goodgit sync

# Sync specific number of commits
goodgit sync --max-commits 50

# Sync commits since a specific date
goodgit sync --since "2024-01-01"
goodgit sync --since "1 week ago"

# Sync all commits (no limit)
goodgit sync --force

# Custom API URL
goodgit sync --api-url https://api.goodgit.com

Configuration

The CLI stores configuration in ~/.goodgit/config.json. You can manage it through:

# Interactive configuration
goodgit config

# View current settings
goodgit config --list

# Reset to defaults
goodgit config --reset

Configuration Options

  • API URL: Backend API endpoint for commit generation
  • API Key: Required - Authentication key for the API (get from dashboard)
  • Default Type: Default commit type to use
  • Include Body: Whether to include detailed body by default
  • Auto Accept: Whether to auto-accept first suggestion
  • Theme: UI theme preference (auto/light/dark)

Note: An API key is required to use GoodGit Commit. You can get your API key from the dashboard after signing up.

Examples

Basic Usage

$ git add src/components/Button.tsx
$ goodgit generate

🚀 GoodGit Commit - AI-Powered Commit Message Generator

📋 Staged Changes:
──────────────────────────────────────────────────
+export interface ButtonProps {
+  children: React.ReactNode;
+  variant?: 'primary' | 'secondary';
+  onClick?: () => void;
+}
+
+export const Button: React.FC<ButtonProps> = ({ children, variant = 'primary', onClick }) => {
+  return (
+    <button className={`btn btn-${variant}`} onClick={onClick}>
+      {children}
+    </button>
+  );
+};
──────────────────────────────────────────────────

🤖 Generating AI commit suggestions...

💡 AI-Generated Commit Suggestions:

1. [conventional]
   feat: add Button component with TypeScript support

2. [simple]
   Add reusable Button component

3. [detailed]
   feat(ui): add Button component with TypeScript support

   Add a reusable Button component with TypeScript interfaces,
   variant support, and click handling for improved UI consistency.

? Choose a commit message: (Use arrow keys)
❯ feat: add Button component with TypeScript support (conventional)
  Add reusable Button component (simple)
  feat(ui): add Button component with TypeScript support (detailed)
  ✏️  Enter custom message
  🔄 Regenerate suggestions
  ❌ Cancel

With Options

# Force specific type and scope
$ goodgit generate --type feat --scope auth --body

# Auto-accept first suggestion
$ goodgit generate --yes

# Dry run to see suggestions without committing
$ goodgit generate --dry-run

API Integration

The CLI connects to your GoodGit Commit backend API. Make sure your API is running and accessible.

Local Development

# Start the backend API
cd ../app
npm run dev

# Use local API in CLI
goodgit generate --api-url http://localhost:3000/api

Production

# Setup with production API
goodgit setup --api-url https://api.goodgit.com --api-key your-api-key

Git Integration

Git Hooks (Optional)

You can set up a Git hook to automatically suggest commit messages:

# Create prepare-commit-msg hook
echo '#!/bin/sh
goodgit generate --yes' > .git/hooks/prepare-commit-msg
chmod +x .git/hooks/prepare-commit-msg

VS Code Integration

The CLI works great with VS Code's integrated terminal. You can also use it with the VS Code extension for seamless integration.

Troubleshooting

Common Issues

  1. "Not in a Git repository"

    • Make sure you're in a Git repository directory
    • Run git init if needed
  2. "No staged changes found"

    • Stage your changes with git add . or git add <file>
    • Check with git status
  3. "API connection failed"

    • Check your API URL and key configuration
    • Ensure the backend API is running
    • Test connection with goodgit config
  4. "No suggestions generated"

    • Check your API configuration
    • Ensure you have a valid API key
    • Try with --dry-run to debug

Debug Mode

# Enable debug logging
DEBUG=goodgit* goodgit generate

Development

Building

# Install dependencies
npm install

# Build TypeScript
npm run build

# Run in development mode
npm run dev

Testing

# Run tests (when available)
npm test

# Test with sample repository
cd test-repo
git add .
goodgit generate

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Support

  • 📖 Documentation: https://docs.goodgit.com
  • 🐛 Issues: https://github.com/goodgit/commit/issues
  • 💬 Discussions: https://github.com/goodgit/commit/discussions