Milestone 4.1: Overview #10

Open
opened 2026-07-24 03:22:36 +00:00 by david · 0 comments
Owner

Overview

Implement /worktree command with interactive picker for switching between linked worktrees.

Acceptance Criteria

  • Registered as pi.registerCommand("worktree", {...})
  • Lists all worktrees using git_worktree_list tool
  • Shows interactive picker with format: {branch} — {path} (current) if applicable
  • Handles empty list case: "No linked worktrees found."
  • Calls git_worktree_switch after selection
  • Canceling (Esc) does not trigger a switch

Implementation Notes

pi.registerCommand("worktree", {
  description: "Switch between linked worktrees interactively.",
  handler: async (args, ctx) => {
    // 1. List all worktrees
    // 2. Parse the structured data and display as picker
    // 3. Show interactive picker using ctx.ui.select()
    // 4. Find the selected worktree and switch to it
  }
});

Validation

  • Run /worktree in a repo with multiple worktrees — verify picker shows all options with correct format
  • Select a worktree — verify pi switches to it and branch display updates
  • Cancel the picker (Esc) — verify no switch occurs
# Overview Implement `/worktree` command with interactive picker for switching between linked worktrees. ## Acceptance Criteria - [ ] Registered as `pi.registerCommand("worktree", {...})` - [ ] Lists all worktrees using `git_worktree_list` tool - [ ] Shows interactive picker with format: `{branch} — {path} (current)` if applicable - [ ] Handles empty list case: "No linked worktrees found." - [ ] Calls `git_worktree_switch` after selection - [ ] Canceling (Esc) does not trigger a switch ## Implementation Notes ```typescript pi.registerCommand("worktree", { description: "Switch between linked worktrees interactively.", handler: async (args, ctx) => { // 1. List all worktrees // 2. Parse the structured data and display as picker // 3. Show interactive picker using ctx.ui.select() // 4. Find the selected worktree and switch to it } }); ``` ## Validation - Run `/worktree` in a repo with multiple worktrees — verify picker shows all options with correct format - Select a worktree — verify pi switches to it and branch display updates - Cancel the picker (Esc) — verify no switch occurs
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: david/pi-worktrees#10
No description provided.