CommitGenie is an AI-powered CLI that crafts Conventional Commit-style messages from your staged Git diffs using Ollama, with an interactive flow to commit or retry.
Install globally with built-in permissions:
deno install -g --allow-env --allow-write --allow-read --allow-run=git,ollama jsr:@arkgast/commitgeniecommitgenie --intent "fix login redirect"This will:
- Analyze your staged diff.
- Generate a Conventional Commit-style message (e.g. fix: correct login redirect logic).
- Prompt to commit, retry, or abort.
commitgenie --model llama2-13b --intent "add validation for email"- Reads git diff --staged.
- Sends diff + intent to Ollama.
- Generates a commit message following Conventional Commits.
- Shows an interactive prompt:
- commit: runs git commit -m ""
- retry: generates a new message
Default config path: ~/.config/commitgenie/config.toml
Generate a default config file with:
commitgenie --initThis will create a TOML configuration file at $HOME/.config/commitgenie/config.toml with sensible defaults, which you can customize to suit your needs.
Example:
model = "llama3"
prompt_template = """
You are an expert software engineer. Given the following git diff and the initial intent for a commit message,
generate a concise, clear, and descriptive commit message in present tense.
Diff:
{diff}
Intent:
{intent}
Commit message:
"""To make your workflow even smoother, add these handy aliases to your ~/.zshrc (or ~/.bashrc) file:
# Generate a commit message for staged changes
alias gcm='commitgenie --intent --'
# Amend the last commit with a new message
alias gca='commitgenie --amend --intent --'After adding the aliases, reload your shell configuration:
source ~/.zshrcNow you can commit like a pro:
$ gcm "add scope validation for authorization"Or amend your last commit with:
$ gca "fix typo in error message"These aliases keep your commands short while still launching the interactive AI-assisted commit flow.
This tool requires the following permissions:
- --allow-run=git,ollama – To interact with git and ollama
- --allow-read – To read the git diff and config file
- --allow-write – To write config file
Install once with permissions and use freely!