opencommit  by di-sukharev

CLI tool for LLM-powered commit messages

created 2 years ago
6,793 stars

Top 7.6% on sourcepulse

GitHubView on GitHub
Project Summary

OpenCommit is a CLI tool that leverages Large Language Models (LLMs) to automatically generate Git commit messages. It aims to replace generic commit messages with descriptive, AI-generated ones, improving code commit quality and developer workflow. The tool is suitable for individual developers and teams seeking to standardize and enhance their commit message practices.

How It Works

OpenCommit analyzes staged Git changes and uses an LLM to generate a commit message. It supports various LLM providers, including OpenAI (GPT models), Anthropic (Claude), and local models via Ollama. Users can configure the AI provider, model, token limits, language, and commit message format (e.g., conventional commits or @commitlint). The tool can also integrate GitMoji for stylized commits and offers a Git hook for seamless integration into the commit process.

Quick Start & Requirements

  • Install globally: npm install -g opencommit
  • Configure API key: oco config set OCO_API_KEY=<your_api_key>
  • Usage: git add <files...> then oco
  • Requirements: Node.js, Git, LLM API key (OpenAI, Anthropic, etc.) or Ollama setup.
  • Docs: https://github.com/di-sukharev/opencommit

Highlighted Details

  • Winner of GitHub 2023 hackathon.
  • Supports OpenAI, Anthropic, Azure, Ollama, Gemini, Flowise, Deepseek LLMs.
  • Configurable GitMoji integration and prompt modules (conventional-commit, @commitlint).
  • Can be set as a prepare-commit-msg Git hook.
  • Available as a GitHub Action for automated commit message improvement.

Maintenance & Community

The project is actively maintained by its author, di-sukharev. Community interaction and contributions are encouraged via GitHub issues and discussions.

Licensing & Compatibility

The repository does not explicitly state a license in the provided README. Users should verify licensing for commercial use or integration with closed-source projects.

Limitations & Caveats

OpenCommit relies on external LLM APIs, incurring costs for usage beyond local models. The quality of generated messages depends on the chosen LLM and prompt configuration. The GitHub Action is in Beta.

Health Check
Last commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
12
Issues (30d)
7
Star History
215 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.