Skip to content

kaufmann-dev/git-wrangler

Repository files navigation

Git Wrangler

Git Wrangler Logo

CI Release License: MIT Documentation GitHub Releases

Git operations, orchestrated at scale.

Cross-platform Go CLI for coordinating dozens of Git repositories in parallel, eliminating the manual overhead of managing large developer workspaces.


Navigation

Why Git Wrangler?

Managing many related Git repositories by hand is repetitive, slow, and easy to mess up. Git Wrangler turns that workspace into one coordinated unit.

It finds repositories below your current directory and runs Git workflows across them in one pass, with parallel execution, stable output, and safe defaults. Use --repo PATH on repository commands when you want to target exactly one repository instead of discovering everything below the current directory.

What it gives you

  • One command, many repositories — run common Git workflows across every repo.
  • Parallel execution, stable output — fast runs without chaotic terminal output.
  • AI-assisted commits — generate Conventional Commit messages from diffs.
  • Safer history rewrites — rewrite metadata or remove secrets with confirmations.
  • GitHub workflows — clone, rename, and manage repositories through gh.
  • Single binary — portable Go executable; GitHub and history workflows use standard tools like gh and git-filter-repo.

Installation & Maintenance

Install

# macOS & Linux
brew install kaufmann-dev/tap/git-wrangler

# Windows
scoop bucket add kaufmann-dev https://github.com/kaufmann-dev/scoop-bucket.git
scoop install kaufmann-dev/git-wrangler

Tip

You can also install manually by downloading a standalone binary from GitHub Releases, extracting it, and adding it to your PATH. You will need to manually install runtime dependencies and set up shell completions, as these are not automatically handled like with Scoop or Homebrew (see Runtime Dependencies and Shell Completions).

Update

# Homebrew
brew update
brew upgrade git-wrangler

# Scoop
scoop update
scoop update git-wrangler

Uninstall

# Homebrew
brew uninstall git-wrangler
brew untap kaufmann-dev/tap

# Scoop
scoop uninstall git-wrangler
scoop bucket rm kaufmann-dev

Quick Start

# 1. Set up GitHub auth and AI credentials
git-wrangler init

# 2. Verify your setup
git-wrangler doctor

# 3. Check state across all repos in the current directory
git-wrangler status

# 4. See the full command list to decide what to do next
git-wrangler help

Commands

Remote Operations

Command What it does
clone Clone multiple GitHub repositories for a user or org.
fetch Fetch origin updates. Use --prune to prune stale refs.
pull Pull latest changes for every discovered repository.
push Push local commits to origin. --force uses lease-based.
rename-repo Rename GitHub repositories through gh.

Local Operations

Command What it does
commit Generate and create one AI Conventional Commit per repo.
fix-gitignore Add missing common generated-file patterns to .gitignore.
license Add or replace MIT license files.
rename-branch Rename a branch across repositories.
reset Reset current branches to their origin counterparts.
review Review unpushed changes across repositories.
untrack Stop tracking files already covered by .gitignore.

History Rewriting

Command What it does
remove-secrets Purge sensitive files from Git history.
rewrite-authors Rewrite author and committer identity.
rewrite-commits Generate AI Conventional Commit messages, then rewrite history.
rewrite-dates Redistribute commit timestamps.

Utility

Command What it does
config Show and edit Git Wrangler configuration.
doctor Check runtime dependencies and local configuration.
info Show detailed repository information.
init Set up GitHub and AI credentials.
status Show clean, dirty, ahead, behind, and remote state.
version Print version metadata.
completion Generate shell completion scripts.
help Show help for Git Wrangler or a specific command.

AI-Powered Workflows

commit and rewrite-commits use any OpenAI-compatible chat completions API to generate Conventional Commit messages from your diffs.

# Set up credentials
git-wrangler init

# Or configure directly
git-wrangler config set ai.base-url https://api.openai.com/v1
git-wrangler config set ai.model gpt-4o
git-wrangler config set ai.api-key

# Optional gateway headers
git-wrangler config set ai.headers.X-Project-ID corp-dev-99
git-wrangler config set ai.headers.api-key

Safety & Guardrails

Git Wrangler is built for bulk Git operations, where small mistakes can affect many repositories at once. Destructive actions are therefore explicit, guarded, and designed to fail safely.

  • Privacy by default — AI commands redact diff content before sending it to the API, including sensitive file contents and common secret patterns. Old commit messages are not sent as context.
  • AI confirmation before stagingcommit prepares context with a temporary index and stages the real index only after valid AI messages are available.
  • Confirmation before mutation — history rewrite commands ask before making destructive changes. Use --yes only for intentional noninteractive runs.
  • Safer force pushespush --force uses --force-with-lease. Raw force push requires the separate --force-unsafe flag.
  • Fail-safe bulk runs — per-repository failures do not stop the whole run. Git Wrangler reports all failures and exits nonzero if anything failed.
  • Origin preservation — history rewrite commands restore the origin remote after git-filter-repo removes it.
  • Warnings on stderr — destructive operations warn clearly without polluting normal command output.

Runtime Dependencies

Tool Required for
git All repository operations (required).
gh GitHub operations: clone, rename-repo.
git-filter-repo History rewrites: remove-secrets, rewrite-*.

Run git-wrangler doctor to check what's available on your system.

Shell Completions

Homebrew and Scoop install completions automatically. For manual installs:

# Bash
git-wrangler completion bash > /etc/bash_completion.d/git-wrangler

# Zsh
git-wrangler completion zsh > "${fpath[1]}/_git-wrangler"

# Fish
git-wrangler completion fish > ~/.config/fish/completions/git-wrangler.fish

# PowerShell
git-wrangler completion powershell > git-wrangler.ps1

Development

Install the local development build without using Homebrew:

scripts/install-dev

The script installs git-wrangler with go install and defaults GOBIN to ~/.local/bin. Put that directory before Homebrew on your PATH:

export PATH="$HOME/.local/bin:$PATH"

Run local checks before opening changes:

scripts/test
scripts/check

After making changes, run the script again and test the command normally:

scripts/install-dev
git-wrangler version
scripts/test

About

Cross-platform Go CLI for coordinating dozens of Git repositories in parallel, eliminating the manual overhead of managing large developer workspaces.

Resources

License

Stars

Watchers

Forks

Contributors