Skip to main content

A small Git wrapper that reviews staged changes with local Ollama and prepares commit messages.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gcommit-0.1.0.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gcommit-0.1.0-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file gcommit-0.1.0.tar.gz.

File metadata

  • Download URL: gcommit-0.1.0.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for gcommit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c3b4f88e04a38b379947eee9ee42339fca7c203f601055a31feff736e444ac66
MD5 7c7588b3b41b69c5c3024c571e772095
BLAKE2b-256 2dfe36e8e16f25eedcd7d6183b4f1d162db53855eb90f51ac9977e947cedc5fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for gcommit-0.1.0.tar.gz:

Publisher: release.yml on ckdarby/gcommit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gcommit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gcommit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for gcommit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa4d3acb48ca870c3da1275f62c2e4fd64464eb54ad8ad3e3c096111d24d69c4
MD5 2047fc1f24bce32507f133da02cd1438
BLAKE2b-256 65a726d97b7b3fde41f3328994b1e0a5953d3d2912690d2db24b3ccaa5f0cef4

See more details on using hashes here.

Provenance

The following attestation bundles were made for gcommit-0.1.0-py3-none-any.whl:

Publisher: release.yml on ckdarby/gcommit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page