Overview
Worktrunk is a revolutionary Command Line Interface (CLI) tool designed to streamline Git worktree management, specifically engineered to empower parallel AI agent workflows. It transforms the often cumbersome process of managing multiple Git worktrees into an experience as simple and intuitive as working with branches. With Worktrunk, you can effortlessly handle numerous parallel changes, automate local workflows with hooks, and even leverage copy-on-write build caches for significant efficiency gains.
Key Features
- Effortless Worktree Management: Core commands like
wt switch,wt list, andwt removemake creating, navigating, and cleaning up worktrees as straightforward as branch operations. - AI Agent Workflow Optimization: Built with parallel AI agent execution in mind, Worktrunk ensures each agent has its own isolated working directory, preventing conflicts and maximizing productivity.
- Automated Workflows with Hooks: Integrate custom scripts and commands to trigger automatically on events like worktree creation, pre-merge, and post-merge, streamlining your development pipeline.
- Intelligent Merge Workflow: Consolidate complex merge operations into a single command, including squashing, rebasing onto a base branch, fast-forwarding, and cleanup.
- Enhanced Code Review: Features like LLM-generated commit messages and interactive pickers that display CI status, diffs, logs, and PR previews significantly improve code review efficiency.
- Build Cache Sharing: With support for APFS, Btrfs, and XFS, Worktrunk enables multiple worktrees to share build artifacts like
target/andnode_modules/, eliminating redundant builds and copies. - PR Checkout: Seamlessly switch to the branch of any Pull Request or Merge Request using a simple command like
wt switch pr:123. - Cross-Platform Compatibility: Available via Homebrew, Cargo, Winget (with Windows Terminal alias handling), Arch Linux, and Conda/Pixi, ensuring broad accessibility.
Typical Use Cases
- Running Multiple AI Agents in Parallel: Launching and managing numerous AI agents (e.g., for code generation, bug fixing, or testing) concurrently, each within its own dedicated worktree.
- Rapid Feature Development & Experimentation: Quickly spin up isolated worktrees for new features, experiments, or bug fixes without interfering with the main development branch.
- Streamlined Code Review Process: Leverage Worktrunk's integrated features to simplify the review of changes from multiple contributors or agents, including automated commit message generation and PR previews.
- CI/CD Pipeline Integration: Utilize hooks to automate setup tasks, dependency installations, or build processes whenever a worktree is created or a merge operation is initiated.
- Managing Complex Git Workflows: Simplify intricate Git operations such as multi-branch development, experimental feature integration, and collaborative code reviews through a unified and intuitive interface.
