pi-nudge

Native terminal notifications for pi.

Package details

extension

Install pi-nudge from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-nudge
Package
pi-nudge
Version
1.0.0
Published
Mar 15, 2026
Downloads
20/mo · 6/wk
Author
jdiamond
License
MIT
Types
extension
Size
6.1 KB
Dependencies
0 dependencies · 0 peers
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

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

README

pi-nudge

Native terminal notifications for pi.

When pi finishes a turn, pi-nudge sends a native terminal notification.

Install

pi install pi-nudge

Notes

Supported terminals for notifications:

  • Ghostty, iTerm2 (OSC 9)
  • Kitty (OSC 99)
  • WezTerm, rxvt-unicode (OSC 777)
  • tmux (passthrough wrapper)

Ghostty appears to have its own focus awareness: in testing, it did not show a notification when the notification was sent from the currently focused tab. We couldn't find documentation for that behavior, so treat it as an observed detail rather than a documented guarantee.

There is also optional support for ctx.ui.isTerminalFocused(), but that method came from a private pi fork we were testing against and is not required when using Ghostty.

Without isTerminalFocused(), pi-nudge still sends notifications normally. On Ghostty, the terminal itself may already suppress notifications from the focused tab.

Inter-extension API

Other extensions can trigger notifications via the shared event bus:

pi.events.emit("nudge", { title: "Pi", body: "Needs your approval" });

If ctx.ui.isTerminalFocused() is available, pi-nudge will use it for these event-driven notifications too.

An emitting extension can still check focus itself if it wants to avoid emitting the event in the first place:

if (!ctx.ui.isTerminalFocused?.()) {
  pi.events.emit("nudge", { title: "Pi", body: "Needs your approval" });
}

That method is not part of stock pi, and Ghostty users may not need it.

License

MIT