A high-performance CLI tool that combines multi-gitter with AI agents (Gemini, Claude Code, Copilot) to perform natural language refactors across one or many repositories.
multi-gitter-agent allows you to orchestrate complex code modifications across your entire organization using AI. It handles the cloning, branching, and Pull Request creation while delegating the logic to your favorite AI agent.
Install the latest binary automatically:
curl -sSL https://raw.githubusercontent.com/juftin/multi-gitter-agent/main/install.sh | bashgo install github.com/juftin/multi-gitter-agent@latest-p, --prompt: The natural language instruction for the agent.--prompt-file: Path to a file containing the instruction.--prompt-template: Path to a custom Go template file for the full agent prompt. Supports.UserPrompt,.Repository,.BaseBranch, and.DryRun.-a, --agent: (Required) The AI agent to use (gemini,claude,copilot). Can also be set viaMULTI_GITTER_AGENTenvironment variable.-y, --yolo: Automatically approve all AI actions.-i, --interactive: Take manual decisions before committing changes.-C, --concurrent: Number of repositories to process simultaneously (Interactive mode requires-C 1).--org, --repo, --user, --topic: Standardmulti-gitterrepository discovery flags.--repo-search, --code-search: GitHub search discovery flags.--repo-include, --repo-exclude: Regex-based repository filtering.--draft: Create Pull Requests as drafts.-t, --token: Your platform access token (e.g.,GITHUB_TOKEN).
Update a specific dependency across all repositories in an organization using Gemini:
multi-gitter-agent run --agent gemini \
--prompt "Update github.com/stretchr/testify to v1.10.0 in go.mod" \
--org my-org --yoloUse GitHub Code Search to find repositories containing a specific pattern and refactor them with Claude:
multi-gitter-agent run --agent claude \
--code-search "filename:package.json lodash" \
--prompt "Replace lodash with native Array methods where possible" \
--interactiveFind repositories by GitHub Topics and exclude legacy projects using Regex:
multi-gitter-agent run --agent gemini \
--topic production --topic microservice \
--repo-exclude "^legacy-.*" \
--prompt "Add a HEALTHCHECK instruction to the Dockerfile" \
--yoloUse GitHub's repository search syntax to target specific languages or metadata:
multi-gitter-agent run --agent gemini \
--repo-search "topic:react language:typescript" \
--prompt "Migrate from TSLint to ESLint" \
--draft --yoloRun a security audit across all repositories and only create PRs for actionable fixes:
multi-gitter-agent run --agent gemini \
--prompt "Check for hardcoded API keys and move them to environment variables" \
--org my-company --concurrent 5 --yoloProvide detailed, multi-step instructions from a Markdown file:
multi-gitter-agent run --agent copilot \
--prompt-file ./docs/refactor-plan.md \
--user my-github-username --branch feature/api-v2-migrationUse your own Go template for the full worker prompt while still injecting the user request:
multi-gitter-agent run --agent claude \
--prompt "Migrate to structured logging" \
--prompt-template ./templates/worker-prompt.tmpl \
--org my-org --yoloIn your template file, include {{ .UserPrompt }} where you want the user prompt injected.
- Integrated Orchestration: Natively wraps
multi-gitterfor seamless multi-repo management. - Agent Support: Built-in support for Gemini CLI, Claude Code, and GitHub Copilot.
- Interactive TUI: A polished Bubble Tea interface for managing per-repository tasks.
- YOLO Mode: Fully automated execution for bulk refactoring.
- Robust TTY Handling: Custom PTY wrapper ensures stability for complex AI CLIs.
- Context-Rich Prompts: Automatically provides agents with repository metadata and safety mandates.
When you execute multi-gitter-agent run, the following orchestration occurs:
- Repository Discovery: The tool uses the provided flags (
--org,--user,--repo, or--code-search) to identify all target repositories. - Cloning:
multi-gitter-agent(via the embeddedmulti-gitterlibrary) creates temporary clones of each repository and checks out a new feature branch. - Agent Invocation: For each repository, the tool launches an Internal Agent Runner. This runner:
- Sets up a stable terminal environment using a Pseudo-Terminal (PTY).
- Renders a rich Markdown prompt containing your instructions and the repository's context.
- Executes your chosen AI agent (Gemini, Claude, or Copilot) within that PTY.
- AI Dialogue: The AI agent analyzes the code and applies modifications. In
--interactivemode, you can review and respond to the agent's thoughts. In--yolomode, all agent actions are automatically approved. - Change Detection: After the agent finishes, the tool checks for file modifications.
- PR Creation: If changes were made, the tool automatically commits the work, pushes the branch, and opens a Pull Request on your target platform (GitHub, GitLab, etc.).
- Dry Run: Use
--dry-runto see what changes the AI would make without pushing anything. - Security Mandates: The tool explicitly instructs agents to never hardcode secrets or modify files outside the requested scope.