Skip to main content

gcommit

gcommit is a small Git wrapper that reviews staged changes with a local Ollama model and prepares a commit message.

Only commit and doctor are custom. Other commands are delegated directly to git.

Install

Install Ollama first: https://ollama.com/download

ollama pull qwen2.5-coder:1.5b
pipx install gcommit
gcommit doctor

Until the PyPI release is live, install from GitHub:

pipx install git+https://github.com/ckdarby/gcommit.git@v0.1.0

Requires Python 3.10+, Git, Ollama, and pipx.

Privacy

gcommit sends staged diff excerpts to the configured Ollama endpoint. The default endpoint is local:

GCOMMIT_OLLAMA_URL=http://127.0.0.1:11434

If you set GCOMMIT_OLLAMA_URL to a remote server, staged code may be sent to that server.

Use

git add <files>
gcommit commit
gcommit commit --print
gcommit commit --yes
gcommit commit --edit
gcommit commit --model small
gcommit commit --model large
gcommit commit --fast
gcommit commit --review

Optional short alias:

alias g=gcommit
g commit

--print shows the generated subject without committing. --yes commits without prompting. --edit opens the generated subject in Git's editor.

By default, gcommit commit runs in auto mode: it uses an instant deterministic subject for obvious changes, then falls back to one structured model call. --review uses the slower chunked review path for deeper feedback. --fast skips the deterministic path and uses one model call.

Model output is rejected if it does not cover every staged file.

Manual message flows are left to Git. If you pass flags like -m, --message, -F, --amend, --fixup, or --squash, gcommit delegates to git commit.

Common safe commit flags are passed through, including --author, --date, --cleanup, --trailer, --signoff, --no-verify, --gpg-sign, --no-gpg-sign, --status, --no-status, --verbose, --quiet, and --allow-empty.

Config

Pick a model preset:

gcommit commit --model tiny
gcommit commit --model small
gcommit commit --model medium
gcommit commit --model large
gcommit commit --model xlarge
gcommit commit --model huge

Or pass any Ollama model tag:

gcommit commit --model qwen2.5-coder:14b
GCOMMIT_MODEL=qwen2.5-coder:7b gcommit commit
  • GCOMMIT_MODEL: Ollama model name.
  • GCOMMIT_MODE: auto, fast, or review.
  • GCOMMIT_OLLAMA_URL: Ollama base URL.
  • GCOMMIT_OLLAMA_TIMEOUT: request timeout in seconds.
  • GCOMMIT_FAST_CHARS: maximum staged patch characters for fast mode.
  • GCOMMIT_REVIEW_CHARS: maximum characters per review chunk.
  • GCOMMIT_REVIEW_MAX_CHUNKS: maximum review chunks before combining overflow.

Defaults:

GCOMMIT_MODEL=qwen2.5-coder:1.5b
GCOMMIT_MODE=auto
GCOMMIT_OLLAMA_URL=http://127.0.0.1:11434

Troubleshooting

Run:

gcommit doctor

Common fixes:

ollama pull qwen2.5-coder:1.5b
pipx ensurepath
pipx upgrade gcommit

Project

Develop

python3 -m pip install --require-hashes -r requirements-build.txt
python3 -m pip install --no-build-isolation --no-deps -e .
python3 -m compileall g gcommit tests
python3 -m unittest discover

Build a release package:

python3 -m pip install --require-hashes -r requirements-build.txt
python3 -m build --no-isolation

Metadata

Release files for gcommit 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gcommit 0.1.0
File Size Uploaded Provenance Actions
gcommit-0.1.0.tar.gz 22.7 kB With provenance Details for gcommit-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gcommit 0.1.0
File Interpreter ABI Platform Actions
gcommit-0.1.0-py3-none-any.whl Python 3 none any Details for gcommit-0.1.0-py3-none-any.whl

Total release size: 43.9 kB

Release files / gcommit-0.1.0.tar.gz

Download URL gcommit-0.1.0.tar.gz
Size 22.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c3b4f88e04a38b379947eee9ee42339fca7c203f601055a31feff736e444ac66
BLAKE2b-256 checksum
How to use checksums
2dfe36e8e16f25eedcd7d6183b4f1d162db53855eb90f51ac9977e947cedc5fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 4, 2026.

Transparency log

Release files / gcommit-0.1.0-py3-none-any.whl

Download URL gcommit-0.1.0-py3-none-any.whl
Size 21.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa4d3acb48ca870c3da1275f62c2e4fd64464eb54ad8ad3e3c096111d24d69c4
BLAKE2b-256 checksum
How to use checksums
65a726d97b7b3fde41f3328994b1e0a5953d3d2912690d2db24b3ccaa5f0cef4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 4, 2026.

Transparency log

Security for gcommit 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for gcommit-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page