Commit your code Wisely ...
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.
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.
- 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
pip install commitwiseStage the files you want to describe:
git add <files>Then choose one provider:
commitwise --ai-localor:
commitwise --ai-onlineCommitWise 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.
Start Ollama and download a model. For example:
ollama pull llama3.1The default local endpoint is http://localhost:11434, and the default model is llama3.1.
Run CommitWise:
commitwise --ai-localOllama 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.
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-onlineThe 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.
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 showShow the configuration file location:
commitwise config pathChange a setting:
commitwise config set local.model "qwen2.5-coder"
commitwise config set general.max_diff_size 50000The 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.
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, orgit 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.
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 -qThe 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 ...