osmianski/worktree-manager

Need to maintain multiple working branches simultaneously - whether for long-term parallel development or running AI agents in separate worktrees? Setting up each environment is tedious. This tool creates worktrees with fully working environments in seconds.

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/osmianski/worktree-manager

v0.1.7 2025-12-01 05:41 UTC

This package is auto-updated.

Last update: 2025-12-01 05:42:57 UTC


README

Need to maintain multiple working branches simultaneously - whether for long-term parallel development or running AI agents in separate worktrees? Setting up each environment is tedious.

This tool automates it: create worktrees with fully working environments in seconds, automatically allocate ports, install dependencies, create Docker containers and migrate data.

Installation

Requirements: PHP 8.1 or higher

  1. Install globally via Composer:

    composer global require osmianski/worktree-manager
  2. Make sure Composer's global bin directory is in your PATH. The location varies by system:

    # Most Linux systems
    export PATH="$HOME/.config/composer/vendor/bin:$PATH"
    
    # Or on some systems
    export PATH="$HOME/.composer/vendor/bin:$PATH"

    Add the appropriate line to your ~/.bashrc or ~/.zshrc.

  3. Verify the installation:

    worktree --version

Usage

Navigate to your Git repository and create a new worktree:

cd /path/to/your/project
worktree new

For contributors

To contribute to a project clone it locally:

cd ~
git clone git@github.com:osmianski/worktree-manager.git

cd worktree-manager
composer install

To run the dev version in a terminal session, run the following command:

export PATH="$HOME/worktree-manager/bin:$PATH"

Now if you run worktree, it should show the branch name instead of the version number:

Worktree Manager dev-main

License

This project is licensed under the MIT License. See the LICENSE file for details.