Workbloom
A Git worktree management tool written in Rust that automates worktree setup, file copying, and port allocation.
Features
- ๐ฒ Easy worktree setup - Create git worktrees with a single command
- ๐ฆ Automatic file copying - Copies essential files (.env, .envrc, etc.) to new worktrees
- ๐ Port allocation - Automatically assigns unique ports based on branch names
- ๐งน Smart cleanup - Remove merged worktrees automatically or interactively
- ๐จ Beautiful output - Colored terminal output with progress indicators
Installation
# Clone the repository
# Build and install
Shell Integration (Recommended)
To automatically change to the worktree directory after setup, add this function to your .bashrc or .zshrc:
# Then use: workbloom-setup feature/my-feature
Usage
Setup a new worktree
# Setup and start a new shell in the worktree directory (default)
# Setup without starting a shell
This will:
- Create a new worktree for the branch (creating the branch if it doesn't exist)
- Copy required files from the main repository (.env, .envrc, etc.)
- Setup direnv if available
- Write port allocations to .env file
- Display allocated ports for the worktree
- Start a new shell in the worktree directory (unless --no-shell is used)
Clean up worktrees
# Remove merged worktrees (default)
# Remove worktrees matching a pattern
# Interactive cleanup
# Show merge status of all worktrees
Configuration
By default, Workbloom copies the following files to new worktrees:
.envrc.env.claude/settings.json.claude/settings.local.json
Port Allocation
Workbloom automatically allocates unique ports for each worktree based on the branch name:
- Frontend: 5173 + hash
- Backend: 8080 + hash
- Database: 5432 + hash
The same branch name will always get the same ports. These port allocations are automatically written to the .env file:
FRONTEND_PORT=6174
BACKEND_PORT=9081
DATABASE_PORT=6433
Development
# Run tests
# Build debug version
# Build release version
# Run with debug output
RUST_LOG=debug
License
MIT