跳到正文
DEV Community· Manit Mishra·· 2 小時前AI 評分41

CommitMate:讓 AI 撰寫 Git 摘要,而非代你提交程式碼

CommitMate: Let AI Write Your Git Summaries, Not Your Commits

AI 導讀

CommitMate 是一款以本機運作為優先的 CLI 工具,可從 Git diff 生成變更摘要、Conventional Commit 訊息、PR 標題與描述,以及建議的測試和驗證步驟。它使用 Python、Git 和透過 Ollama 執行的本機 AI 推理,無須把 diff 傳送至外部 AI 服務。工具不會替用戶提交、推送或修改程式碼。

正文

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady

What I Built

CommitMate is a local-first CLI tool that takes the repetitive work out of working with Git.

Writing commit messages, summarizing changes, and drafting pull request descriptions are small tasks, but they add up when you're building software every day. CommitMate takes your Git diff and generates:

  • A concise summary of your changes.
  • A Conventional Commit message.
  • A ready-to-use pull request title and description.
  • Suggested tests and validation steps.

The idea is simple: spend less time describing the code you just wrote and more time actually building. And importantly, CommitMate doesn't commit, push, or modify your code for you. You stay in control.

Demo

The project is available on GitHub:

View CommitMate on GitHub

Code

Repository: https://github.com/Manit098/CommitMate

Check out the source code, explore the implementation, and try it yourself.

How I Built It

CommitMate is built around Python, Git, and local AI inference using Ollama.

Git provides the diff, Python handles the CLI and output validation, and an open-weight language model generates summaries and draft messages.

The goal is to keep the workflow local-first rather than depending on a hosted AI API. Developers can use AI assistance on their code without needing to send their diffs to an external AI service.

Some of the engineering challenges include handling staged and unstaged changes, validating structured model output, managing large diffs, and handling errors such as empty changes or unavailable models. The focus is on making AI assistance practical without taking control away from the developer.

Why Does Open Innovation Matter?

Developer tools shouldn't have to be locked behind proprietary APIs.

Open-weight models and tools like Ollama make local AI workflows possible for developers who want more control over their code, costs, and infrastructure.

For CommitMate, this means the AI component can run locally, the workflow can be inspected, and developers can experiment with different supported models instead of being tied to a single hosted provider. Open innovation also makes projects like this easier to learn from, adapt, and improve collaboratively.

The Lazy Payoff

Commit messages and pull request descriptions aren't difficult to write. They're just repetitive.

CommitMate aims to turn that repetitive process into a quick review-and-copy workflow, giving developers a useful first draft instead of another blank text box.

The goal is straightforward: less time writing boilerplate, more time building.

來源:DEV Community · dev.to