← Back to Leaderboard
Odi-sukharev

di-sukharev/opencommit

Node.js CLI and Git hook that turn staged diffs into LLM-drafted commit messages

Engineering Health (Methodology)
A+ · 92/100
Maintenance Activity
● Updated 3d ago
Latest Release
v4.0.0
Commercial License Check
MIT · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption17/25
Release Cadence20/20
License Clarity20/20
CLIAPILocal AI1 README badge views (30d)
Total Stars
★ 7,553
24h Growth
+0
7d Growth
+5
Forks
454

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

di-sukharev/opencommit Star History (2023-03-05 - 2026-12-04) ALL-TIME STAR HISTORY (2023-03 – 2026-12) +7.6k in 1370d · avg +6/day 8k 4k 0 2023-03-05: ★ 12023-05-27: ★ 3,7402023-08-19: ★ 4,1312023-11-11: ★ 4,4572024-02-03: ★ 4,8142024-04-27: ★ 5,1392024-07-20: ★ 5,4572024-10-12: ★ 5,7942025-01-04: ★ 6,0572025-03-29: ★ 6,3482025-06-21: ★ 6,5352025-09-13: ★ 6,7022025-12-06: ★ 6,9152026-02-28: ★ 7,0722026-05-23: ★ 7,2192026-08-15: ★ 7,4612026-12-04: ★ 7,553 ★ 7.6k 2023-03 2025-01 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

OpenCommit is a Node.js CLI and Git hook integration. Its npm package exposes opencommit and oco; generation takes the staged Git diff, applies the selected commit-message prompt, and requests a draft from the configured model backend. The interactive CLI can stage files for you and proceed to a commit, whereas the prepare-commit-msg hook drafts text within the Git or IDE workflow and leaves it editable before the commit is finalized.

The manifest includes cleye and @clack/prompts for CLI interaction, execa for subprocess execution, @dqbd/tiktoken for tokenization, and client SDKs for OpenAI, Anthropic, Azure OpenAI, Google Generative AI, and Mistral. The root separates src/, test/, and out/ and includes esbuild and TypeScript configuration. The evidenced integration surfaces are Git hooks and provider APIs; there is no established MCP server interface.

Key Capabilities & Differentiators

Provider choices include OpenAI, Anthropic, Azure, Gemini, Mistral, and OpenRouter, as well as local backends such as Ollama and llama.cpp. OpenAI-compatible gateways can be selected by configuring the base URL and model under the openai provider. oco setup fetches available models and caches the list for seven days; oco models --refresh updates it. Default token settings are 4,096 for input and 500 for output, with a separate default budget of 1,000 completion tokens for reasoning models, including hidden reasoning.

Conventional Commits is the default prompt module. Formatting controls cover language, descriptions, one-line output, scope omission, branch ticket references, and GitMoji, including the full specification. The $msg placeholder lets callers wrap generated text in a template. The optional @commitlint module derives prompts and an example from local rules and saves them in .opencommit-commitlint. Changes to those rules or the output language require a refresh with oco commitlint force, which overwrites manual edits. The experimental OCO_WHY option is available only with that module.

Trade-offs & Limitations

Compared with a static Git template, OpenCommit drafts text specific to the staged changes. Compared with a standalone commit linter, it generates prose rather than certifying that a message meets policy. A diff describes what changed more reliably than why, so review the draft and keep an independent lint check where rules are mandatory. Hosted inference avoids operating a model server but sends diffs to the selected endpoint and incurs provider latency and potential usage charges. A local endpoint can keep diffs on infrastructure you control, at the cost of model sizing, serving, and quality tuning.

For scripts, oco --yes is narrower than interactive mode: it commits staged files without prompting and will neither stage nor push. The repository .env allowlist reduces configuration risk, but the @commitlint module runs the current repository's package and config; use it only in trusted repositories. MIT permits commercial use of the tool under its notice requirements, but does not grant rights to model weights or hosted services.

Hardware & Deployment Guide

Install with npm install -g opencommit on a machine with Node.js, npm, and Git. For hosted inference, configure the provider, API key, model, and any required endpoint or headers; a key saved through oco config set resides in ~/.opencommit. Shell settings take precedence over allowed repository .env settings, which override global config. For local inference, start Ollama and explicitly select an already-pulled model, or run a llama.cpp server with a GGUF model and configure its endpoint. Compute and memory sizing belong primarily to the inference host and depend on the selected model and workload.

The v4.0.0 release fixes the high-severity advisory GHSA-pxcf-vgf2-9676; upgrade older installations before using the CLI or hook with unfamiliar repositories. Install the hook with oco hook set. It records absolute paths for Node.js and OpenCommit so Git clients do not need Node.js on PATH; refresh the hook if either path moves. If a recorded path disappears, the hook lets Git continue and prints a recovery hint. Remove the hook before uninstalling or downgrading.

Git integration: oco drives the commit workflow directly; the prepare-commit-msg hook drafts an editable message in the existing Git or IDE workflow.
Inference routing: Named cloud providers, OpenAI-compatible gateways via OCO_API_URL, and local runtimes including Ollama and llama.cpp.
Prompt control: Conventional Commits by default, optional @commitlint guidance, plus locale, scope, GitMoji, and branch-ticket formatting.
Model management: oco setup fetches available models, model listings are cached for seven days, and oco models --refresh refreshes them.
Script behavior: oco --yes commits only staged files, never prompts, stages, or pushes, and exits with code 1 when required input or configuration is missing.
Security boundary: v4.0.0 fixes GHSA-pxcf-vgf2-9676 and restricts repository .env settings to an allowlist of message-format options.
Best For

Teams that want editable, diff-based commit drafts in their terminal or IDE and can route inference to an approved API or private model server.

Skip If

A static Git template already meets the need, every message must be deterministic without a review step, or policy prohibits sending diffs to any available model endpoint.

Reviewed on 2026-12-02 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

CLIAPILocal AI
npm install -g opencommit

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/di-sukharev/opencommit.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

di-sukharev/opencommit Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about opencommit

Should I use the CLI directly or install the Git hook?

Run oco to generate a commit message from staged changes and create the commit. If you want to keep your normal git commit or IDE workflow, install the prepare-commit-msg hook with oco hook set. The hook supplies a draft that you can edit before committing. If Node.js or OpenCommit moves, reinstall the hook to refresh its recorded paths.

What hardware does OpenCommit need, and where does inference run?

The CLI needs Node.js and Git, not a GPU. With a hosted API, inference happens at the provider. With Ollama or llama.cpp, size the inference host for the chosen model, quantization, context length, and concurrency. There is no fixed VRAM requirement for OpenCommit itself.

Can a company use or self-host it for proprietary repositories?

Yes. The MIT license permits commercial use, modification, and redistribution, subject to its notice requirements. Verify model weights, runtime components, and hosted API terms separately. For a private-code workflow, check the configured endpoint and proxy routing, and confirm where diffs are processed and retained.

When is it a better fit than a Git template or commitlint alone?

Choose OpenCommit when you want a draft based on actual changes or want to switch between hosted and local inference. Choose a Git template if predictable wording and no model dependency matter more. If commit format must be guaranteed, pair generation with an independent lint check; the @commitlint prompt steers generation but does not guarantee compliance.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining di-sukharev/opencommit? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature di-sukharev/opencommit on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare