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{Args as t,Command as n,Flags as r}from"@oclif/core";var i=class i extends n{static summary=`Checkout a PR branch (PR Read/Retrieve)`;static description=`
    Checkout a pull request branch using GitHub CLI (gh) or git fallback.
    Automatically detects gh availability and falls back to git fetch if needed.
  `;static examples=[{description:`Checkout PR using gh or git fallback`,command:`<%= config.bin %> <%= command.id %> 123`},{description:`Checkout PR to specific branch`,command:`<%= config.bin %> <%= command.id %> 456 --branch my-pr-branch`},{description:`Force git fallback with custom remote`,command:`<%= config.bin %> <%= command.id %> 789 --no-gh --remote upstream`}];static args={id:t.string({description:`PR number or owner:repo#123 format`,required:!0})};static flags={branch:r.string({char:`b`,description:`Branch name (default: pr/<id>)`}),remote:r.string({char:`r`,description:`Remote name`,default:`origin`}),"no-gh":r.boolean({description:`Skip GitHub CLI, use git directly`,default:!1})};async run(){let{args:t,flags:n}=await this.parse(i),r=new e,a={id:t.id,branch:n.branch,strategy:n[`no-gh`]?`git`:`gh`,remote:n.remote};try{let e=await r.execute({command:`prr`,cwd:process.cwd(),data:a});this.log(`✓ ${e.message}`),e.details&&(this.log(`  Strategy: ${e.details.strategy}`),this.log(`  Branch: ${e.details.branch}`))}catch(e){this.error(e.message,{exit:1})}}};export{i as default};