Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

commitme

AI-generated Conventional Commits from your git diff. Point it at your staged and unstaged changes and it writes the commit message, shows it to you, and (with your OK) commits and pushes.

Bring your own AI provider: Gemini, OpenAI, Anthropic, or a local Ollama.

$ commitme
Generating commit message (anthropic/claude-haiku-4-5)...

feat(auth): add token refresh on 401

Retry the request once with a refreshed access token when the API
returns 401, so short-lived sessions no longer surface transient
auth failures to the user.

Commit with this message? [Y/n/e(dit)]

Install

# from a local checkout
cargo install --path .

# or build and copy the binary
cargo build --release
cp target/release/commitme ~/.local/bin/

This installs a commitme command. Requires a Rust toolchain (rustup) to build.

Usage

commitme                 # generate a message, confirm, commit, offer to push
commitme commit          # same as above (explicit subcommand)
commitme providers       # list providers and show the active one

commitme -p openai       # one-off provider override
commitme -m gpt-4o       # one-off model override
commitme -y              # non-interactive: commit and push without prompts
commitme --no-push       # commit only
commitme --no-sign-off   # skip the Signed-off-by trailer
commitme --gpg-sign      # GPG-sign the commit

The flow:

  1. Collects your staged and unstaged diffs plus untracked file names.
  2. Sends them to your configured AI provider to draft a Conventional Commit.
  3. Shows the message; you accept (Y), reject (n), or edit (e) it in $EDITOR.
  4. Stages everything (git add -A), commits (with -s sign-off by default), and offers to push to the current branch's upstream.

Configuration

Precedence (highest wins): CLI flag → environment variable → config file → default.

Config file

~/.config/commitme/config.toml (or $XDG_CONFIG_HOME/commitme/config.toml):

provider = "anthropic"
model = "claude-haiku-4-5"   # optional; omit to use the provider's default

Environment variables

Variable Purpose
commitme_PROVIDER Default provider (gemini/openai/anthropic/ollama)
commitme_MODEL Default model

Providers

Each provider reads its own credentials from the environment.

Provider Default model Credentials / config
gemini gemini-3.6-flash GEMINI_API_KEY or GOOGLE_API_KEY
openai gpt-4o-mini OPENAI_API_KEY; optional OPENAI_BASE_URL (OpenAI-compatible endpoints)
anthropic claude-haiku-4-5 ANTHROPIC_API_KEY
ollama llama3.2 OLLAMA_HOST (default http://localhost:11434) — no key needed

The default provider is gemini. Set one that suits you in the config file.

Commit-message generation is a small, frequent task, so the cloud defaults are the fast, low-cost tiers. Point model at a stronger model (e.g. claude-sonnet-5, gpt-4o) if you want richer messages.

Colour output follows NO_COLOR and is disabled when stdout is not a TTY.

Building from source

cargo build            # debug build -> target/debug/commitme
cargo build --release  # optimized  -> target/release/commitme
cargo clippy           # lints

License

MIT

About

Auto create conventional commit messages with AI

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages