gitmyhub

opencommit

JavaScript ★ 7.3k updated 4d ago

top #1 and most feature rich GPT wrapper for git — generate commit messages with an LLM in 1 sec — works with Claude, GPT and every other provider, supports local Ollama models too

A command-line tool that automatically writes your git commit messages using AI, run `oco` after staging files and it reads your diff, calls an AI model, and commits in about two seconds.

JavaScriptNode.jsnpmOpenAI APIAnthropic APIOllamasetup: easycomplexity 2/5

OpenCommit is a command-line tool that writes your git commit messages for you using an AI model. After you stage the files you want to commit, you run oco instead of git commit, and the tool reads your changes, sends them to an AI, and commits with a generated message. The whole process takes about two seconds. It won the GitHub 2023 hackathon.

The tool supports a wide range of AI providers: OpenAI (the default), Anthropic, Azure, Gemini, DeepSeek, and others. It also supports running fully offline using Ollama, which lets you run a local model like Llama or Mistral on your own machine without sending any data to an external service. You can switch providers and models through simple config commands.

Configuration is quite flexible. You can set options globally for all your repositories (stored in ~/.opencommit) or per-project using a local .env file. The options cover which model to use, whether to add emoji prefixes from the GitMoji convention, whether to append a short description of what changed and why, what output language to use for the message, and whether to require manual confirmation before committing. A --yes flag skips the confirmation prompt for a fully automatic workflow.

Installing it requires Node.js already on your system. Once installed globally with npm install -g opencommit, you set your API key with one command and the tool is ready to use in any repository. For Ollama, you point the tool at your local Ollama server's URL instead of an API key.

All the commits in the OpenCommit repository itself were generated by OpenCommit, so you can browse the commit history there to see what the output looks like in practice. The project is available on npm and is under active development.

Where it fits