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 🙏

© 2025 – Pkg Stats / Ryan Hefner

gcommit-jira

v1.1.0

Published

A lightweight CLI tool for generating standardized Git commit messages with JIRA integration

Readme

Git Commit CLI

A lightweight CLI tool for generating standardized Git commit messages with JIRA ticket integration. This tool helps teams maintain consistent commit message formats while seamlessly integrating with JIRA tracking.

Features

  • Interactive Prompts: User-friendly prompts guide you through creating standardized commits
  • Auto-detect Username: Automatically pulls username from git config
  • JIRA Integration: Built-in validation for JIRA ticket format
  • Preview Before Commit: Review formatted message before committing
  • Lightweight: Minimal dependencies, fast execution
  • Cross-platform: Works on Windows, macOS, and Linux
  • No Config Files: Uses git configuration only

Commit Message Format

[type]: [username] [JIRATICKET] message

Optional longer description

Example Output

[feat]: [John Doe] [JIRA-1234] Add user authentication system

Implemented JWT-based authentication with password hashing
and secure session management.

Supported Commit Types

| Type | Description | |------|-------------| | feat | A new feature | | fix | A bug fix | | build | Changes to build system or dependencies | | ci | Changes to CI configuration | | docs | Documentation only changes | | refactor | Code change that neither fixes a bug nor adds a feature | | test | Adding or updating tests | | chore | Other changes that don't modify src or test files |

JIRA Ticket Format

JIRA tickets must follow the pattern: PROJECT-NUMBER

Valid Examples:

  • JIRA-1111
  • PROJ-123
  • ABC-4567

Invalid Examples:

  • jira-123 (lowercase not allowed)
  • JIRA123 (missing hyphen)
  • JIRA- (missing number)

Installation

Global Installation (Recommended)

# Clone or download the repository
cd git-commit-cli

# Install dependencies
npm install

# Install globally
npm install -g .

# Or use npm link for development
npm link

Local Installation

# Install dependencies
npm install

# Run directly
npm start

Usage

Basic Usage

Once installed globally, simply run:

gcommit

The tool will guide you through an interactive session:

  1. Select commit type - Choose from the list of supported types
  2. Enter JIRA ticket - Provide your JIRA ticket number (e.g., JIRA-1234)
  3. Enter commit message - Short description of your changes
  4. Enter description (optional) - Longer, detailed description
  5. Review - Preview the formatted message
  6. Confirm - Proceed with commit or cancel

Prerequisites

Before running gcommit, make sure to:

  1. Stage your changes:

    git add <files>
  2. Ensure git is configured:

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

    If not configured, the tool will prompt you for a username.

Example Workflow

# 1. Make changes to your code
vim src/app.js

# 2. Stage your changes
git add src/app.js

# 3. Run the commit tool
gcommit

# 4. Follow the interactive prompts
? Select the type of change you're committing: feat - A new feature
? Enter JIRA ticket number (e.g., JIRA-1111): JIRA-1234
? Enter commit message (short description): Add user authentication
? Enter longer description (optional, press Enter to skip): Implemented JWT-based auth system

# 5. Review the formatted message
═══════════════════════════════════════════════════════════
📝 COMMIT MESSAGE PREVIEW
═══════════════════════════════════════════════════════════
[feat]: [John Doe] [JIRA-1234] Add user authentication

Implemented JWT-based auth system
═══════════════════════════════════════════════════════════

# 6. Confirm
? Do you want to proceed with this commit? (Y/n) Y

✓ Commit created successfully!

Help Command

View help information:

gcommit --help

Output:

Usage: gcommit [options]

Generate standardized Git commit messages with JIRA ticket integration

Options:
  -V, --version  output the version number
  -h, --help     display help for command

Example usage:
  $ gcommit

This will start an interactive session to create a commit message in the format:
  [type]: [username] [JIRATICKET] message

Supported commit types:
  feat, fix, build, ci, docs, refactor, test, chore

JIRA ticket format:
  Must follow the pattern: PROJECT-1234 (e.g., JIRA-1111, PROJ-123)

Note: Make sure to stage your changes with 'git add' before running this command.

Error Handling

The tool provides clear error messages for common issues:

Not a Git Repository

✗ Error: Not a git repository. Please run this command in a git repository.

No Staged Changes

✗ Failed to create commit: Command failed...
Make sure you have staged changes using: git add <files>

Invalid JIRA Ticket

✗ JIRA ticket must follow the format: PROJECT-1234 (e.g., JIRA-1111)

Missing Git Username

⚠️  Git username not found in config.
? Please enter your username:

Development

Project Structure

git-commit-cli/
├── bin/
│   └── gcommit.js       # Main CLI executable
├── package.json         # Project configuration
└── README.md           # Documentation

Dependencies

  • commander (^11.1.0) - CLI framework for building command-line tools
  • inquirer (^8.2.6) - Interactive command-line prompts
  • chalk (^4.1.2) - Terminal string styling for colored output

Testing Locally

# Install dependencies
npm install

# Link for local testing
npm link

# Test the command
gcommit

# Unlink when done
npm unlink

Comparison with Commitizen

While inspired by Commitizen, this tool is:

  • More Lightweight: Fewer dependencies, faster startup
  • JIRA-Focused: Built-in JIRA ticket validation
  • Custom Format: Specific format: [type]: [username] [JIRATICKET] message
  • No Config Files: Uses git config only, no additional configuration
  • Simplified: Focused on one specific workflow

Troubleshooting

Issue: Command not found after global install

Solution:

# Ensure npm global bin is in your PATH
npm config get prefix

# Add to PATH (example for Unix-based systems)
export PATH=$PATH:$(npm config get prefix)/bin

Issue: Permission denied

Solution:

# Make the file executable
chmod +x bin/gcommit.js

# Or reinstall globally with proper permissions
sudo npm install -g .

Issue: Inquirer prompts not working

Solution:

  • Ensure you're running in a proper terminal (not a non-interactive shell)
  • Update Node.js to version 14 or higher

License

MIT

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

Support

For issues, questions, or suggestions, please open an issue in the repository.


Made with ❤️ for developers who care about consistent commit messages