@noice-tech/pi-work-context

Keep Pi's terminal title and editor widget aligned with the current session, Git worktree, and GitHub pull request.

Packages

Package details

extension

Install @noice-tech/pi-work-context from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@noice-tech/pi-work-context
Package
@noice-tech/pi-work-context
Version
1.2.1
Published
Jul 28, 2026
Downloads
333/mo · 333/wk
Author
samohovets
License
MIT
Types
extension
Size
32.4 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions/work-context/index.ts"
  ]
}

Security note

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

README

@noice-tech/pi-work-context

See each Pi terminal's task, worktree, local Git changes, PR, and CI status at a glance.

#6 — Plan issue · PR #42
Changes 7 · 2 untracked   PR ● #42 ↗   CI ✓ 8/8

Install

pi install npm:@noice-tech/pi-work-context

Restart Pi after installation. The display updates automatically; use /work-context for its optional settings.

Terminal title

Available context Title
Session name and PR [state] <session name> · PR #<number>
PR only [state] #<number> — <PR title>
No PR Session name, then worktree name

Use Pi's /name command to set the session name. PR markers are: none for open, for draft, for merged, and × for closed.

Local changes

The right-aligned widget summarizes the current index and working tree. Changes 7 · 2 untracked means seven unique changed paths in total, two of which are untracked. Renames and copies count as one changed path, ignored files are excluded, and conflicts are shown first with warning emphasis (for example, 1 conflict · Changes 3). Wording and detail compact at narrow terminal widths.

A clean worktree does not show a changes label, keeping the widget quiet. Work-context runs read-only porcelain Git status with optional index locking disabled and parses only its status records.

PR and CI status

An attached PR shares the widget below the editor. Its number is clickable, and its dot shows whether the PR is open, draft, merged, or closed.

CI shows ✓ passed/total, … passed/total, × failed/total, or when no checks are reported.

CI completion bell

Run /work-context and enable CI completion bell to receive a terminal BEL when the current PR's checks finish, whether they pass or fail. It applies immediately, is off by default, and persists across Pi restarts.

The first CI result is a quiet baseline. After that, each observed unfinished → finished transition rings once; repeated results stay quiet, and branch, repository, or PR changes reset the baseline.

Before BEL, the title briefly becomes CI ✓ #42 — PR title or CI × #42 — PR title, then returns to normal. This works only in TUI sessions with TTY output; the terminal decides whether BEL produces sound, a visual bell, or an attention request.

Requirements and fallback

  • Runs only in Pi's interactive TUI
  • Git provides worktree context
  • Authenticated GitHub CLI adds PR and CI context

Without GitHub access or an attached PR, the title falls back to the session or worktree name. Git status and GitHub discovery fail independently and never interrupt Pi.

The title reacts immediately to /name. Git, PR, and CI context refresh after agent runs and branch changes, and once a minute while idle. Local edits made while Pi is idle therefore appear on the next refresh; work-context does not watch the whole worktree.