npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pi-terminal-notifier

v1.0.1

Published

macOS native notifications for pi — focus-aware, click-to-activate, with event bus

Readme

pi-terminal-notifier

macOS native notifications for pi — focus-aware, click-to-activate, with a namespaced event bus.

npm version License: GPL v3+

Why

When pi finishes a long turn or needs input, you are often in another app. pi-terminal-notifier posts a native macOS banner with a short sound, skips noise while you are already looking at the terminal, and brings you back on click.

macOS notification example

Install

pi install npm:pi-terminal-notifier

How it works

| Source | Behavior | |--------|----------| | agent_end | ✅ Task Complete / ❌ Task Failed from the last assistant text; suppressed when the pi terminal is frontmost | | Event bus | Other extensions emit pi-terminal-notifier:notify for approvals, plan ready, etc. |

Foreground suppression is skipped when force: true (use when the user must act).

Click-to-activate focuses Ghostty, VS Code, Zed, Terminal, or iTerm2. Inside tmux, it also selects the originating window and pane.

Events

// Approval required
pi.events.emit("pi-terminal-notifier:notify", {
  title: "✏️ Approval Needed",
  body: "$ npm run deploy",
  sound: "question",
  force: true,
  group: "approval",
});

// Plan ready
pi.events.emit("pi-terminal-notifier:notify", {
  title: "📋 Plan Ready",
  body: "Review the implementation plan.",
  sound: "plan-ready",
  force: true,
  group: "plan-ready",
});

Tool Call Integration

Notify when ask_user_question is waiting for user input:

pi.on("tool_call", async (event) => {
  if (event.toolName !== "ask_user_question") return undefined;

  const input = event.input as {
    questions?: Array<{
      header?: string;
      question?: string;
    }>;
  };
  const first = input.questions?.[0];

  pi.events.emit("pi-terminal-notifier:notify", {
    title: "✋ Input Needed",
    body: [first?.header, first?.question]
      .filter(Boolean)
      .join("\n"),
    sound: "question",
  });

  return undefined;
});

| Field | Description | |-------|-------------| | title | Notification title | | body | Message body | | subtitle | Optional; defaults to the current directory basename | | sound | Sound key (filename without extension) | | force | Skip frontmost-terminal suppression | | group | terminal-notifier group id (replace previous in same group) |

Sounds

| Key | File | |-----|------| | task-complete | sounds/task-complete.aiff | | review-complete | sounds/review-complete.aiff | | question | sounds/question.aiff | | plan-ready | sounds/plan-ready.aiff | | error | sounds/error.aiff |

Played via afplay. Source MP3s and full attribution: NOTICE.

Compatibility

| Environment | Notifications | Foreground suppression | Click to activate | |-------------|---------------|------------------------|-------------------| | Ghostty | Supported | Supported | Supported | | VS Code terminal | Supported | Workspace-aware | Supported | | Zed terminal | Supported | Workspace-aware | Supported | | Apple Terminal | Supported | Supported | Supported | | iTerm2 | Supported | Supported | Supported | | tmux | Supported | Active pane/window-aware | Returns to the originating pane | | Other terminals | Supported | Not detected | Not available |

VS Code foreground detection checks the front window's workspace against the current working directory. Zed detection works the same way (its window title is <project> — <file>, the reverse of VS Code's order). In tmux, suppression checks whether the originating pane and window are active; clicking a notification selects that window and pane before focusing the terminal.

Zed and VS Code can focus the window that has the current project open, but neither exposes a way to select a specific terminal tab inside that window. When several tabs share one window, click-to-activate returns to the project window rather than the exact tab. Use tmux for pane-level targeting.

Tested

  • Apple Silicon, macOS 15
  • Ghostty running tmux
  • Native notification delivery and sound playback

Ghostty + tmux is the environment tested by the author. VS Code, Zed, Apple Terminal, and iTerm2 integrations are implemented from their process and bundle identifiers but have not yet been independently verified.

macOS Setup

After the first notification is sent:

  1. Open System Settings → Notifications → pi-terminal-notifier.
  2. Turn on Allow Notifications.
  3. Enable Sounds and choose Banners or Alerts as the notification style.
  4. If notifications are still hidden, check that Focus or Do Not Disturb is not suppressing them.

Requirements / Notes

  • macOS only
  • Bundled notifier is Apple Silicon (arm64) only, ad-hoc signed, not notarized
  • Browser/GitHub downloads may be Gatekeeper-quarantined; a local clone usually works as-is
  • Child processes (pi -p, --no-session) and subagent sessions do not register user-facing notifications

License

GPL-3.0-or-later — see LICENSE.

Third-party components, including the notifier binary and sound assets, are documented in NOTICE.