pi-pwsh-notify

Foreground-first PowerShell 7 for pi on Windows with session-scoped background jobs, regex ready/wait, retryable steer notifications, complete logs, and persistent cd

Packages

Package details

extension

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

$ pi install npm:pi-pwsh-notify
Package
pi-pwsh-notify
Version
0.5.0
Published
Sep 1, 2026
Downloads
294/mo · 26/wk
Author
oversk7
License
MIT
Types
extension
Size
76.4 KB
Dependencies
0 dependencies · 3 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-pwsh-notify

npm license

English | 简体中文

A foreground-first PowerShell 7 extension for pi on Windows.

pi install npm:pi-pwsh-notify

Why

Pi already has a simple foreground powershell tool. This extension adds session-scoped background jobs, automatic notifications, persistent cd, and a compact job viewer, without turning shell execution into a separate task platform.

Tools

Tool Use
pwsh Run a foreground command or start a background job
pwsh_job Read output, wait, list, or kill jobs

pwsh

Foreground is the default. Commands stream live, cd persists across calls, and each call starts in a fresh PowerShell process.

Use background mode for work that should keep running after the current tool call:

pwsh {
  command: "npm run dev",
  run_in_background: true,
  name: "vite",
  notify_on: "Local:.*http"
}

notify_on is a JavaScript regular expression. The first match sends a ready notification; process exit sends a completion notification.

pwsh_job

Use pwsh_job when the next step depends on a running background job:

pwsh_job { action: "wait", id: "bg-1", pattern: "ready|listening", timeout: 120 }

A timeout leaves the job running.

Job UI

Active jobs appear below the editor. At an empty prompt, use Right or Tab to focus, Up and Down to move, Enter to open live output, x twice to kill, and Esc to return.

Why this instead of others

Pi powershell pi-pwsh-notify @4fu/pi-pwsh
Foreground output Live Live Task snapshot
Background work No Session-scoped Always-on
Ready / wait No Regex over unseen output Persistent task state
Output view Current result Incremental reads + full log Repeatable snapshot + log
Reload / restart No No Yes
Interactive ConPTY No No Yes

Use Pi's built-in tool for simple foreground commands. Use this extension when foreground work is still the default, but you also want managed background jobs, regex waits, persistent cd, and automatic cleanup. Use @4fu/pi-pwsh for long-lived or interactive workloads.

Reliability

  • Requires PowerShell Core 7+. If unavailable, pwsh is disabled and Pi's built-in bash stays active.
  • Sends commands through BOM-less UTF-8 stdin.
  • Preserves native exit codes.
  • Keeps a full UTF-8 log for every background job.
  • Exposes PI_SESSION_ID, PI_SESSION_FILE, PI_PROVIDER, PI_MODEL, and PI_REASONING_LEVEL to child commands.

Requirements

  • Windows
  • Node.js 22.19+
  • PowerShell Core 7+
  • Pi 0.84+

Logs

Complete logs are stored in a pi-pwsh-notify-* directory under the system temporary directory. Older directories are pruned on later startup.

Development

npm ci
npm run check
npm pack --dry-run

License

MIT