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

ocmt

v1.0.2

Published

AI-powered git commit message generator using opencode.ai

Readme

OpenCommit (ocmt)

AI-powered git commit message, changelog & documentation generator using opencode.ai

┌   oc 
│
◆  Staged changes:
│    + src/index.ts
│    + src/utils/git.ts
│
●  Diff: 42 lines
│
◇  Commit message generated
│
◇  Proposed commit message:
│    "feat: add git status parsing utilities"
│
◆  What would you like to do?
│  ● Commit with this message
│  ○ Edit message
│  ○ Regenerate message
│  ○ Cancel
└

Features

  • AI-powered commit messages - Generates conventional commit messages from your staged changes
  • Changelog generation - Create changelogs from your commit history
  • Interactive CLI - Beautiful terminal UI with confirmation prompts
  • Customizable - Edit .oc/config.md to customize commit message rules
  • Multiple aliases - Use oc, ocmt, or opencommit

Installation

Prerequisites

  • Node.js >= 18.0.0
  • OpenCode installed and authenticated

Install OpenCode

# npm
npm install -g opencode

# or brew
brew install sst/tap/opencode

Then authenticate:

opencode auth

Install ocmt

# bun (recommended)
bun install -g ocmt

# npm
npm install -g ocmt

# pnpm
pnpm install -g ocmt

# yarn
yarn global add ocmt

Usage

Generate Commit Message

# Interactive commit flow
oc

# Stage all changes first
oc -a

# Skip confirmation prompts
oc -y

# Stage all and skip prompts
oc -ay

# Use provided message directly (skips AI)
oc "feat: add new feature"

Generate Changelog

# Interactive changelog generation
oc changelog

# Shorthand aliases
oc cl
oc --changelog
oc -cl

# Specify range
oc changelog --from v1.0.0 --to HEAD
oc changelog -f v1.0.0 -t v2.0.0

Configuration

On first run, ocmt creates a .oc/ directory in your repository root with configuration files:

.oc/config.md - Commit Message Rules

Controls how AI generates commit messages. Default uses Conventional Commits:

# Commit Message Guidelines

## Types
- `feat`: A new feature
- `fix`: A bug fix
- `docs`: Documentation only changes
- `refactor`: Code change that neither fixes a bug nor adds a feature
...

## Rules
1. Use lowercase for the type
2. No scope (e.g., use `feat:` not `feat(api):`)
3. Use imperative mood ("add" not "added")
...

.oc/changelog.md - Changelog Rules

Controls changelog generation format. Default uses Keep a Changelog format.

Edit these files to customize AI behavior for your project.

Commands

| Command | Aliases | Description | |---------|---------|-------------| | oc | ocmt, opencommit | Generate commit message from staged changes | | oc changelog | oc cl | Generate changelog from commits |

Options

Commit Options

| Option | Description | |--------|-------------| | -a, --all | Stage all changes before committing | | -y, --yes | Skip confirmation prompts | | -V, --version | Show version number | | -h, --help | Show help |

Changelog Options

| Option | Description | |--------|-------------| | -f, --from <ref> | Starting commit/tag reference | | -t, --to <ref> | Ending commit/tag reference (default: HEAD) |

How It Works

  1. Connects to OpenCode - Tries to connect to an existing OpenCode server, or spawns a new one
  2. Analyzes your changes - Reads the staged git diff
  3. Generates message - Sends diff to AI with your configured rules
  4. Confirms with you - Shows the proposed message for approval/editing
  5. Commits - Creates the commit with the final message

Models Used

| Feature | Provider | Model | |---------|----------|-------| | Commit messages | opencode | gpt-5-nano | | Changelogs | opencode | claude-sonnet-4-5 |

Examples

Basic Commit Flow

$ oc
┌   oc 
│
◆  Staged changes:
│    + src/utils/parser.ts
│    + src/index.ts
│
●  Diff: 127 lines
│
◇  Commit message generated
│
◇  Proposed commit message:
│    "feat: add expression parser with AST support"
│
◆  What would you like to do?
│  ● Commit with this message
└

Changelog Generation

$ oc changelog
┌   changelog 
│
◇  Found releases and commits
│
◆  Select starting point for changelog:
│  ○ v1.0.0 (release)
│  ○ v0.9.0 (release)
│  ● abc1234 feat: add user authentication
│  ○ def5678 fix: resolve memory leak
└

Troubleshooting

"OpenCode CLI is not installed"

Install OpenCode first:

npm install -g opencode
# or
brew install sst/tap/opencode

"Not authenticated with OpenCode"

Run authentication:

opencode auth

"Not a git repository"

Make sure you're in a git repository:

git init

No staged changes

Stage your changes first:

git add .
# or
oc -a  # stages all changes automatically

Contributing

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

  1. Fork the repository
  2. Create your feature branch (git checkout -b feat/amazing-feature)
  3. Commit your changes (oc 😉)
  4. Push to the branch (git push origin feat/amazing-feature)
  5. Open a Pull Request

Development

# Clone the repo
git clone https://github.com/yourusername/ocmt.git
cd ocmt

# Install dependencies
bun install

# Run in development mode
bun run dev

# Build for production
bun run build

# Type check
bun run typecheck

License

MIT

Links