ocommit quickly create a git commit message with ollama and commit,
locally.
ocommit- Shows you the current
git statusand generates a commit message based off the diff - press [Enter] to accept the message, [Tab]/['r'] to regenerate (or other keys to escape).
ocommitstages the changes and commits them.
The tool also supports dry‑runing (-d / --dry) which doesn't perform actual
staging or commits
Install rust.
cargo install ocommitMake 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
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)- 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)
ocommit # run
ocommit --dry # show the generated commit message without committing
ocommit -d # short alias for `--dry`yoo!