Reviewing a PR can require the following repetitive setup:
- Locate (or clone) the repo
- Stash any local changes
- Determine the corresponding branch name
- Create a worktree or checkout the branch
- Initialise submodules, fetch the default branch, etc.
- Start reviewing
prt compresses that into one command by handling those steps automatically:
prt https://github.com/OWNER/REPO/pull/123which completes the above efficiently and opens a new terminal tab in the configured state.
gitgh(GitHub CLI, authenticated)- macOS with iTerm2 or Terminal.app for tab opening (other OSes print the path)
go install github.com/BradyPlanden/prt/cmd/prt@latestHomebrew tap:
brew tap BradyPlanden/prt https://github.com/BradyPlanden/prt
brew install BradyPlanden/prt/prtInstall the specific version's:
brew install BradyPlanden/prt/prt@0.1specific versions are keg-only. Run them directly:
$(brew --prefix)/opt/prt@0.1/bin/prt --versionOr make it your active prt:
brew unlink prt
brew link --force prt@0.1Note: tap installs are pinned to tagged releases and build from source.
prt https://github.com/OWNER/REPO/pull/123
prt https://github.com/OWNER/REPO/pull/123 --temp
prt https://github.com/OWNER/REPO/pull/123 --no-tab
prt https://github.com/OWNER/REPO/pull/123 --terminal iterm2
prt clean --dry-run
prt clean --allGenerate shell completion scripts:
# bash
prt completion bash > /etc/bash_completion.d/prt
# zsh
prt completion zsh > "${fpath[1]}/_prt"
# fish
prt completion fish > ~/.config/fish/completions/prt.fishCreate ~/.config/prt/config.yaml:
projects_dir: ~/Projects
temp_dir: /tmp/prt
temp_ttl: 24h
terminal: auto # auto | iterm2 | terminalConfiguration precedence (lowest to highest): config file, environment variables, CLI flags.
Notes:
PRT_TEMP_TTL,temp_ttlin config, and--temp-ttlall fail with an error when given an invalid duration.PRT_VERBOSEaccepts1,true,yes, oron.
prtaccepts PR URLs fromgithub.comand*.github.comhosts.
- On macOS,
terminal: autodetects fromTERM_PROGRAMand opens a new tab only when launched from iTerm2 (iTerm.app) or Terminal.app (Apple_Terminal). - If auto detection cannot identify either app,
prtprints the resolved path instead. - Use
--terminalorPRT_TERMINALto forceiterm2orterminalwhen needed.
- Upstream tracking: The local branch is set to track the remote PR branch, so
git pull/git pushwork out of the box. - Fork remotes: For cross-repo (fork) PRs, a remote named
prt/<owner>/<repo>is added pointing to the fork. Existing remote URLs are never overwritten — if you've configured SSH or custom URL rewriting, your settings are preserved. - Per-worktree push config: Cross-repo worktrees get
push.default=upstreamscoped to the worktree, so pushes go to the correct fork branch without affecting other worktrees. - Stale branch recovery: If a local branch exists from a previous worktree that was manually removed,
prtautomatically resets it rather than failing. - Offline resilience: When reusing an existing worktree, fetch failures produce a warning instead of blocking access to the local checkout.
Environment overrides:
PRT_PROJECTS_DIR(default~/Projects)PRT_TEMP_DIR(default/tmp/prt)PRT_TEMP_TTL(default24h)PRT_TERMINAL(defaultauto;auto | iterm2 | terminal)PRT_VERBOSE(set to1to enable verbose logging)

