@yusukeshib/pi-pr-link

Show the GitHub PR for the current branch as a clickable link in the footer.

Packages

Package details

extension

Install @yusukeshib/pi-pr-link from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@yusukeshib/pi-pr-link
Package
@yusukeshib/pi-pr-link
Version
0.2.2
Published
Oct 31, 2026
Downloads
221/mo · 213/wk
Author
yusukeshib
License
MIT
Types
extension
Size
11.6 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./extensions"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@yusukeshib/pi-pr-link

A pi extension that shows the GitHub PR(s) for the current branch as clickable links in the footer status area.

If the working directory is a git repo, it runs gh pr view to resolve the PR for the checked-out branch. If it's a container directory holding multiple repos, each immediate child repo is checked and every open PR is shown. Links are pinned into the footer via ctx.ui.setStatus() as OSC 8 hyperlinks, so they're clickable in terminals that support it.

What it looks like

When the current branch has an open PR, the footer gains a bold green, clickable repo#number link:

mirage-web#1234

In a container directory of multiple repos, one link per repo with an open PR:

mirage-web#1234 mirage-api#56

Click a link (in a supporting terminal) to open the PR in your browser. When there's no PR — or you're not in or above any repo, or gh isn't installed — the status is simply hidden.

When it refreshes

  • on session start
  • after each agent run settles (agent_settled)
  • on demand via the /pr command (bypasses the cache)

To keep the footer cheap, a gh pr view result is reused for up to 60 seconds while a repo stays on the same branch, overlapping refreshes are coalesced, and at most 4 git/gh processes run at once. Only the interactive TUI shows the link: RPC, print, and JSON sessions (including subagent workers) never run git or gh.

Requirements

The GitHub CLI (gh) must be installed and authenticated:

gh auth status   # should show you're logged in

Install

pi install npm:@yusukeshib/pi-pr-link

Via git (no npm publish required):

pi install git:github.com/yusukeshib/pi-pr-link

Try it without installing:

pi -e npm:@yusukeshib/pi-pr-link

License

MIT