Skip to main content

commitcraft

Smart conventional commit messages — a rule engine decides when AI is even needed.

Demo

CI PyPI Downloads License: MIT

What makes it different

Most "AI commit message" tools blindly send your entire diff to an LLM. commitcraft doesn't.

It first runs a local rule engine on your diff. README-only change? Lockfile bump? Single test file? Those get a conventional commit message generated instantly, locally, with zero AI cost. Only when changes are genuinely complex does it reach out to an LLM — and even then it sends a condensed summary, not the full diff.

The story isn't "I used AI." It's "I built a system that decides when AI should be used."

Pipeline

git diff (staged)
    │
    ▼
Parser → extract changed files, line counts, file types
    │
    ▼
Filter → strip lockfiles, dist/, build/, *.min.js, etc.
    │
    ▼
Rule Engine → simple change? generate commit locally (zero cost)
    │              e.g. README-only → "docs: update README"
    │              lockfile-only → "chore: update lockfile"
    │
    ▼ (complex change only)
Classifier → complexity score 0-100 from:
             • file count and directory spread
             • function/class definition changes (regex)
             • test files alongside source files
             • total line count
    │
    ▼
Context Builder → condensed summary (not the full diff)
    │              ~100-500 tokens instead of thousands
    ▼
Your chosen Provider (Ollama / OpenAI / Gemini / Anthropic)
    │
    ▼
Conventional commit message

Installation

pip install commitcraft-cli
commitcraft init   # one-time setup: choose your provider

Quickstart

# Make some changes, then:
commitcraft commit

# Split staged changes into multiple semantic commits, one per logical change:
commitcraft commit --split

# Starting a brand-new project? Just run `commit` as usual — commitcraft detects
# an all-new-files diff and offers to generate one commit per file/module
# automatically (skip the prompt entirely and go straight to per-file commits
# with --split).
commitcraft commit

# Generate a PR description for the current branch:
commitcraft pr

# Generate release notes between two tags:
commitcraft release-notes v1.0.0..v1.1.0

# Analyze your commit history:
commitcraft history

Provider setup

On first run (commitcraft init), you choose your provider:

Provider Cost Requires
Ollama Free (local) Ollama installed + a model pulled
OpenAI Your API key openai_api_key in config
Anthropic Claude Your API key anthropic_api_key in config
Google Gemini Your API key gemini_api_key in config

Your API key is stored locally at ~/.commitcraft/config.yaml. It never leaves your machine except to call your chosen provider directly.

Contributing

See CONTRIBUTING.md and docs/adding_a_provider.md.

License

MIT © mavesensei

Metadata

Release files for commitcraft-cli 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 commitcraft-cli 0.2.0
File Size Uploaded Provenance Actions
commitcraft_cli-0.2.0.tar.gz 252.5 kB Without provenance Details for commitcraft_cli-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 276.6 kB

Release files / commitcraft_cli-0.2.0.tar.gz

Download URL commitcraft_cli-0.2.0.tar.gz
Size 252.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6d923872d4c73938672e521a94b3f47b94276ab65316672b9d2b72b065af2a2a
BLAKE2b-256 checksum
How to use checksums
5f03d983979c13ecbddb5ae77ff2ec284405707ad1fb15ce95fe4a5460445731
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

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

Download URL commitcraft_cli-0.2.0-py3-none-any.whl
Size 24.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a5396ce6fb4be15a295e09b115c6049967cedc716b61ea704e81e15e1962edc4
BLAKE2b-256 checksum
How to use checksums
87fcf0dd163000d34cf45dd97a8a22f3b7a050d2ed27ec6eaa64527252071ed7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for commitcraft-cli 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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.2.0 This release

2 release files No 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