import"../../errors-pXKbCKbL.js";import"../../runner-DYk4q6mP.js";import"../../utils-DMbpVz3Q.js";import"../../pr-DC2iMrPz.js";import"../../view-BZmgL-cB.js";import"../../worktree-DTI5xaFs.js";import"../../create-DiqmyIaU.js";import{t as e}from"../../dispatcher-Ci7OG66P.js";import{Command as t,Flags as n}from"@oclif/core";var r=class r extends t{static summary=`Remove a git worktree`;static description=`
    Remove a git worktree by branch name, directory name, or path.
    Intelligently matches branch or directory names.
    Use --select to pick which worktree to remove from an interactive list.
  `;static examples=[{description:`Remove worktree by branch name`,command:`<%= config.bin %> <%= command.id %> -b main`},{description:`Remove worktree by directory name`,command:`<%= config.bin %> <%= command.id %> -b xling-feature`},{description:`Remove worktree by path`,command:`<%= config.bin %> <%= command.id %> -p ../repo-feature`},{description:`Force remove worktree`,command:`<%= config.bin %> <%= command.id %> -b main -f`},{description:`Pick a worktree to remove interactively`,command:`<%= config.bin %> <%= command.id %> --select`}];static flags={branch:n.string({char:`b`,description:`Branch or worktree directory name`}),path:n.string({char:`p`,description:`Worktree path`}),force:n.boolean({char:`f`,description:`Force removal`,default:!1}),select:n.boolean({description:`Use an interactive selector to choose the worktree to remove`,default:!1})};async run(){let{flags:t}=await this.parse(r),n=new e,i={action:`remove`,branch:t.branch,path:t.path,force:t.force,interactive:t.select};try{let e=await n.execute({command:`worktree`,cwd:process.cwd(),data:i});this.log(`✓ ${e.message}`),e.details?.output&&this.log(`
`+e.details.output)}catch(e){this.error(e.message,{exit:1})}}};export{r as default};