ocommit

Crates.ioocommit
lib.rsocommit
version0.2.0
created_at2025-09-27 17:52:24.015607+00
updated_at2025-10-08 22:46:49.435275+00
descriptionquickly create a git commit message with ollama and commit, locally
homepage
repositoryhttps://github.com/bogzbonny/ocommit
max_upload_size
id1857514
size55,164
(bogzbonny)

documentation

https://docs.rs/ocommit/latest/ocommit/

README

ocommit

ocommit quickly create a git commit message with ollama and commit, locally.

Workflow

  1. ocommit
  2. Shows you the current git status and generates a commit message based off the diff
  3. press [Enter] to accept the message, [Tab]/['r'] to regenerate (or other keys to escape).
  4. ocommit stages the changes and commits them.

The tool also supports dry‑runing (-d / --dry) which doesn't perform actual staging or commits

Installation

Install rust.

cargo install ocommit

Make sure you have ollama installed and pull whatever model you want to use. The default is qwen2.5-coder:3b.

ollama pull qwen2.5-coder:3b

Configuration

The program looks for a YAML configuration file at $HOME/.config/ocommit.yaml

  • it creates it with default values if it doesn't exist.
ollama_model: qwen2.5-coder:3b   # required – name of the model to use. default: qwen2.5-coder:3b
ignore_files:                    # names of files/folders to ignore (in addition
- Cargo.lock                     #   to what's already in the .gitignore)

Facts

  • 1 file (main.rs) with < 250 LOC (EZ to audit)
  • for speed, if the diff is > ~1000 LOC then only file name changes will be sent to ollama
  • llm structured outputs are used to remove llm niceties ("sure I can write you a commit message..." lol why)

Usage

ocommit          # run
ocommit --dry    # show the generated commit message without committing
ocommit -d       # short alias for `--dry`

Contributing

yoo!

Commit count: 0

cargo fmt