@wmaurer/overture-git
v1.0.0
Published
AI-powered git workflow tools — generate conventional commit messages and create worktrees with smart branch names using Claude
Maintainers
Readme
ogit
Git workflow tools powered by AI. ogit generates conventional commit messages from your staged diff using Claude.
Features
- AI-powered commit messages — analyzes your staged diff, branch name, status, and recent commits to generate meaningful conventional commit messages
- Intelligent auto-staging — when nothing is staged, AI triages files by name, filters out binaries and generated files, analyzes diffs for relevance, and lets you exclude unrelated changes
- Interactive workflow — review the generated message, then commit, edit, regenerate (with optional feedback), or cancel
- Non-interactive mode — automate commits in scripts and AI agent workflows with
--non-interactive - Layered configuration — configure via
.ogit.kdlconfig files (global and per-repo), environment variables, and CLI flags - AI-powered worktree creation — creates git worktrees with AI-suggested branch names based on your uncommitted changes
- Model selection — choose any Anthropic model with
--modelor in config
Installation
npm install -g @wmaurer/overture-gitThis installs the ogit command globally. You can also use pnpm or yarn:
pnpm add -g @wmaurer/overture-git
# or
yarn global add @wmaurer/overture-gitFrom source
git clone https://github.com/wmaurer/overture-git.git
cd overture-git
pnpm install
pnpm build
pnpm link --globalUsage
Interactive mode (default)
Just run:
ogit commitIf you have staged changes, ogit generates a commit message from them. If nothing is staged, ogit auto-stages your changes using a two-phase AI workflow:
- Triage — AI classifies unstaged files by name, filtering out generated/output files (e.g.
dist/, lock files) - Analysis — AI reads the diffs of remaining files and groups them by relevance to the current branch
- Review — if some files seem unrelated, ogit lists them and asks whether to exclude them from this commit
You can also stage manually first if you prefer:
git add -p
ogit commitOnce changes are staged, ogit generates a commit message and presents a menu:
- Commit — accept the message and commit
- Edit — open the message in your
$EDITORfor manual tweaks - Regenerate — generate a new message
- Regenerate with feedback — tell the AI what to change and regenerate
- Cancel — abort without committing
Non-interactive mode
ogit commit -nGenerates a commit message and commits immediately without prompting. If nothing is staged, all changes are added (git add -A) before generating. Useful for scripts and AI agent integrations.
Show system prompt
ogit commit --show-promptPrints the default system prompt used for commit message generation. If a custom prompt is configured in .ogit.kdl, both the default and custom prompts are shown. Does not require an API key.
Model selection
ogit commit --model claude-sonnet-4-20250514Defaults to claude-haiku-4-5 (configurable via .ogit.kdl).
Worktree creation
ogit worktree createCreates a new git worktree under .worktrees/ with an AI-suggested branch name.
If your working tree is clean, ogit prompts for a branch name and creates the worktree.
If you have uncommitted changes (staged, unstaged, or untracked), ogit analyzes the diff and suggests a branch name in <type>/<short-description> format (e.g. feat/add-user-auth). It shows the suggestion with reasoning, then presents a menu:
- Accept — use the suggested name
- Edit — tweak the suggested name
- Regenerate — get a different suggestion
- Regenerate with feedback — tell the AI what to change and regenerate
- Cancel — abort without creating a worktree
After choosing a name, ogit:
- Stashes all changes (including untracked files)
- Creates the worktree at
.worktrees/<branch-name>/on a new branch - Pops the stash into the new worktree
ogit automatically adds .worktrees to your .gitignore if it isn't already present.
Configuration
ogit uses KDL config files with a layered resolution order:
- Global config —
~/.config/ogit/config.kdl(Linux),~/Library/Application Support/ogit/config.kdl(macOS),%APPDATA%\ogit\config.kdl(Windows) - Per-repo config —
.ogit.kdlin the current directory or any parent (walks up to find the nearest one) - Environment variables —
OGIT_API_KEY - CLI flags —
--model
Later sources override earlier ones.
Example .ogit.kdl
api-key "sk-ant-..."
model "claude-sonnet-4-20250514"
commit {
system-prompt """
You are a git commit message generator.
Write commit messages in Swiss Standard German.
Never use Eszett (ß), always use Umlauts (ä, ö, ü).
Use conventional commit format: type(scope): short description.
"""
}Config options
| Key | Type | Description |
| -------------------------- | ------ | ---------------------------------------------------- |
| api-key | string | Anthropic API key (also via OGIT_API_KEY env var) |
| model | string | Anthropic model to use (default: claude-haiku-4-5) |
| commit { system-prompt } | string | Custom system prompt that replaces the default |
API key
Set your API key via config file or environment variable:
export OGIT_API_KEY=sk-ant-...Or in .ogit.kdl:
api-key "sk-ant-..."Claude Code Integration
You can configure Claude Code to use ogit commit instead of git commit, so that all commits made by Claude (and its subagents) get AI-generated messages.
1. Add a hook to block git commit
In your project's .claude/settings.json:
{
"hooks": {
"Bash": {
"pre": [
{ "match": "^git commit", "command": "echo 'BLOCKED: Use ogit commit instead of git commit' && exit 1" }
]
}
}
}This intercepts any Bash tool call starting with git commit and returns an error before it executes.
2. Add a CLAUDE.md instruction
Add this to your project's CLAUDE.md so Claude uses ogit from the start (avoiding the hook entirely):
## Committing
Never use `git commit` directly. After staging files with `git add`, always use `ogit commit -n` to create commits. This generates AI-powered commit messages from the staged diff in non-interactive mode.How it works
- Claude stages files with
git addas normal - When it tries
git commit, the hook blocks it with an error - The error message tells Claude to use
ogit commitinstead - Claude runs
ogit commit -n(non-interactive mode) - ogit analyzes the staged diff, generates a commit message, and commits
The CLAUDE.md instruction reduces wasted attempts — Claude will use ogit commit directly without hitting the hook.
Shell Completions
ogit supports tab completions for Bash, Zsh, and Fish.
Bash
ogit --completions bash >> ~/.bashrcZsh
ogit --completions zsh > ~/.zsh/completions/_ogitThen add ~/.zsh/completions to your fpath in ~/.zshrc:
fpath=(~/.zsh/completions $fpath)Fish
ogit --completions fish > ~/.config/fish/completions/ogit.fishBuilt With
- Effect (v4) — typed functional programming for TypeScript
- @effect/ai-anthropic — Anthropic AI integration for Effect
