Skip to main content

CommitWise

Commit your code Wisely ...

PyPI version Python License: MIT

CommitWise is an AI-powered command-line assistant that turns your Git staged changes into three clear, English Conventional Commit message suggestions.

Choose the AI provider that fits your workflow:

  • Local: run a model on your machine with Ollama.
  • Online: generate suggestions with a model available through OpenRouter.

You stay in control. CommitWise suggests commit messages; it never creates commits or changes your Git repository.

Why CommitWise?

Writing a good commit message takes attention away from the code you're working on. CommitWise reads the changes you've already staged, asks your selected AI provider for three alternatives, validates their format, and lets you choose the one you want.

  • Three suggestions, one staged diff: every suggestion describes the complete staged change set, not an individual file.
  • Your choice of AI: use Ollama locally or OpenRouter online.
  • Conventional Commits: suggestions follow the Conventional Commits header format.
  • Safe by design: Git access is read-only; you decide what gets committed.
  • Global settings: configure providers once and reuse the settings across repositories.
  • Focused changes: a configurable diff-size limit helps keep commits manageable.

Quick start

1. Requirements

  • Python 3.15 or newer
  • Git installed and available on your PATH
  • One configured AI provider:
    • Ollama running locally with a model downloaded, or
    • an OpenRouter API key and model name

2. Install

pip install commitwise

3. Stage your changes and generate suggestions

Stage the files you want to describe:

git add <files>

Then choose one provider:

commitwise --ai-local

or:

commitwise --ai-online

CommitWise displays three suggestions and asks you to select one. The selected message is copied to your clipboard when a clipboard backend is available. Review it, then run the Git commit command yourself.

Choose a provider

Local AI with Ollama

Start Ollama and download a model. For example:

ollama pull llama3.1

The default local endpoint is http://localhost:11434, and the default model is llama3.1.

Run CommitWise:

commitwise --ai-local

Ollama responses are streamed while they are generated. If a stream is interrupted, CommitWise discards the incomplete response and retries the generation from the beginning. It makes up to three total attempts; it does not attempt token-level resume.

Online AI with OpenRouter

Configure your OpenRouter model and API key:

commitwise config set online.model "your-provider/your-model"
commitwise config set online.api_key "YOUR_OPENROUTER_API_KEY"

Then run:

commitwise --ai-online

The API key is stored in your per-user configuration file and masked when configuration is displayed. Treat that file as sensitive and do not share it.

Configuration

Settings are stored globally for your user account, so you do not need to configure every repository separately.

Platform Configuration path
Windows %APPDATA%\\CommitWise\\config.toml
Linux ~/.config/commitwise/config.toml

Show the current configuration (with secrets masked):

commitwise config show

Show the configuration file location:

commitwise config path

Change a setting:

commitwise config set local.model "qwen2.5-coder"
commitwise config set general.max_diff_size 50000

The default staged-diff limit is 50,000 bytes. If the staged diff exceeds the configured limit, CommitWise stops before contacting the AI provider and asks you to split the work into smaller commits.

Safety and behavior

CommitWise is intentionally limited to suggesting messages:

  • It reads staged changes only; unstaged working-tree changes are not included.
  • It does not run git add, git commit, git reset, git checkout, git switch, or git restore.
  • It does not stage, commit, reset, or otherwise modify your working tree, index, refs, or Git history.
  • If nothing is staged or the staged diff is empty, it stops without making an AI request.
  • The local and online flags are mutually exclusive. There is no automatic provider fallback.
  • It requests exactly three single-line Conventional Commit suggestions and rejects structurally invalid output.
  • It does not truncate or automatically split large diffs.

Always review the generated message before using it. AI suggestions can be imperfect, especially when the change itself is ambiguous.

Development

Clone the repository, install the development dependencies, and run the test suite:

git clone https://github.com/hasssan-hasssan/commitwise.git
cd commitwise
python -m pip install -e ".[dev]"
python -m pytest -q

The CI workflow runs the unit tests on Windows and Linux with Python 3.15 and builds the package to smoke-test the installed CLI.


Commit your code Wisely ...

Metadata

Release files for commitwise 0.2.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 commitwise 0.2.0
File Size Uploaded Provenance Actions
commitwise-0.2.0.tar.gz 19.0 kB With provenance Details for commitwise-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 41.3 kB

Release files / commitwise-0.2.0.tar.gz

Download URL commitwise-0.2.0.tar.gz
Size 19.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8282f247a44b81dfa3a3127e03cf643a8fccf1daec402f8674e701df9503c67b
BLAKE2b-256 checksum
How to use checksums
1e6f0fa4416340ad8aab202dbf019b543062d0e68d8965e3947c453b19b9071b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Dec 4, 2026.

Transparency log

Release files / commitwise-0.2.0-py3-none-any.whl

Download URL commitwise-0.2.0-py3-none-any.whl
Size 22.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be80b5f2dd95c865aed1449ee01d1ccddcea0f663b8c580b3fefd8b32199911c
BLAKE2b-256 checksum
How to use checksums
1ee47b509860a8d14b0bc428c36b29cb4d157bea563abe9a39b8740931c6cc82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Dec 4, 2026.

Transparency log

Security for commitwise 0.2.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 commitwise-0.2.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 Dec 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.

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