forkRepo
forkRepo(
input,repoRoot,ghRunner?):Promise<{entry:RepoEntry;ok:true; } | {error:string;ok:false; }>
Defined in: src/repos.ts:668
Fork a GitHub repo under the authenticated user’s account and clone it into
<repoRoot>/<input.name>. Uses gh repo fork <repo> --clone, which sets
origin = the fork and upstream = the original (default remote), so PRs from
the worktrees target upstream automatically. Idempotent: an existing fork is
synced and still cloned.
Returns { ok: true, entry } on success, or { ok: false, error } with a
forkrepo_failed_* code. Forking always requires gh auth, so a not-logged-in
state is reported as forkrepo_failed_auth (not a generic failure).
Parameters
Section titled “Parameters”string
string
repoRoot
Section titled “repoRoot”string
ghRunner?
Section titled “ghRunner?”Injectable async runner for gh CLI calls (default: 120s timeout).
Returns
Section titled “Returns”Promise<{ entry: RepoEntry; ok: true; } | { error: string; ok: false; }>