OpenCommit — AI-Powered Git Commit Messages
OpenCommit auto-generates meaningful git commit messages using AI. 7.2K+ stars. Claude, GPT, Ollama, git hook integration. Open source.
Staging seguro para este activo
Este activo primero queda en staging. El prompt copiado pide inspeccionar los archivos staged antes de activar scripts, config MCP o config global.
npx -y tokrepo@latest install 8f087c35-53cf-4194-8342-c3ed43018302 --target codexPrimero deja archivos en staging; la activación requiere revisar el README y el plan staged.
What it is
OpenCommit is a CLI tool that analyzes your staged git changes and generates meaningful commit messages using AI. It reads the diff, sends it to an LLM (Claude, GPT, or local models via Ollama), and proposes a conventional commit message. It supports git hook integration so commit messages are generated automatically on every commit.
Developers who want consistent, descriptive commit messages without spending time writing them benefit from OpenCommit. Teams enforcing conventional commit standards find it especially useful.
How it saves time or tokens
Writing good commit messages takes 30-60 seconds per commit. OpenCommit generates one in about 1 second. Over a day with dozens of commits, this saves meaningful time. The AI reads the full diff context, producing messages that are often more descriptive than hastily written manual ones. The token_estimate per commit is approximately 389 tokens.
How to use
- Install OpenCommit globally via npm
- Configure your AI provider and API key
- Stage your changes and run
ocoinstead ofgit commit
Example
# Install
npm install -g opencommit
# Configure provider
oco config set OCO_API_KEY=sk-ant-your-key
oco config set OCO_MODEL=claude-sonnet-4-20250514
# Use: stage changes and run
git add .
oco
# Output: feat(auth): add JWT token refresh logic with expiry check
# Or install as git hook (auto-generate on every commit)
oco hook set
git add . && git commit # Message generated automatically
Related on TokRepo
- AI tools for coding — Browse AI development tools
- Featured workflows — Discover top-rated tools and workflows
Common pitfalls
- Large diffs (many files changed) produce longer context and higher token costs; commit frequently in small batches
- The git hook runs on every commit including rebases and merges; disable it for non-standard commits
- Generated messages may not match your team's exact commit convention; customize the prompt template in config
Preguntas frecuentes
OpenCommit supports OpenAI (GPT-4, GPT-4o), Anthropic (Claude), local models via Ollama, and any OpenAI-compatible endpoint. You configure the provider and model in the oco config.
Yes. Run `oco hook set` to install a prepare-commit-msg hook. Every `git commit` will automatically generate an AI commit message. Run `oco hook unset` to remove it.
Yes. OpenCommit generates messages in Conventional Commits format by default (feat:, fix:, docs:, etc.). You can customize the format through configuration.
Cost depends on diff size and model. A typical commit with Claude costs fractions of a cent. Large diffs with GPT-4 may cost a few cents. Using Ollama with local models is free.
Yes. By default, OpenCommit shows the generated message and asks for confirmation. You can edit it, regenerate, or cancel. Auto-approve mode is available but not recommended.
Referencias (3)
- OpenCommit GitHub— AI-powered git commit message generator
- OpenCommit README— Supports Claude, GPT, and Ollama providers
- Conventional Commits— Conventional Commits specification
Relacionados en TokRepo
Fuente y agradecimientos
di-sukharev/opencommit — 7,200+ GitHub stars
Discusión
Activos relacionados
Coturn — Open Source TURN and STUN Server for WebRTC
A free, open-source TURN and STUN server implementation that provides NAT traversal for WebRTC, VoIP, and real-time communication applications.
thirdweb — Full-Stack Web3 Development Platform
An open-source SDK and toolchain for building Web3 applications, providing ready-made smart contracts, wallet connection components, and backend infrastructure for deploying to any EVM chain.
seek-tune — Song Recognition Algorithm in Go
An open-source implementation of the Shazam audio fingerprinting algorithm written in Go, capable of identifying songs from short audio samples.
OpenSSF Scorecard — Security Health Metrics for Open Source
OpenSSF Scorecard automatically assesses open source projects against a set of security best practices, producing a score that helps maintainers and consumers understand supply chain risk.