@xynogen/pix-powershell

Pi tool — PowerShell execution with pretty output (renders Pi's built-in powershell tool like pix-bash)

Packages

Package details

extension

Install @xynogen/pix-powershell from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@xynogen/pix-powershell
Package
@xynogen/pix-powershell
Version
0.1.3
Published
Oct 22, 2026
Downloads
530/mo · 83/wk
Author
xynogen
License
MIT
Types
extension
Size
16.8 KB
Dependencies
2 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "src/extension.ts"
  ]
}

Security note

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

README

pix-powershell

Pi tool — PowerShell execution with pretty output.

What it does

Renders Pi's optional built-in powershell tool the same way pix-bash renders bash: a compact call line, a full-width status-colored framed output block, a live five-line tail while the command runs, and an auto-collapsed one-line summary such as ✓ powershell Get-ChildItem -Force · 42 lines · 1.2s. Execution is unchanged — it wraps Pi's own createPowerShellToolDefinition (pwsh.exe, falling back to Windows PowerShell).

Output and compatibility fixes

  • Plain-text output. PowerShell 7.2+ adds ANSI colour to table headers and errors even when output is piped, which wastes tokens and clutters the transcript. Every command starts with if ($PSStyle) { $PSStyle.OutputRendering = 'PlainText' }. Windows PowerShell 5.1 has no $PSStyle, so the line is a no-op there.
  • && / || on Windows PowerShell 5.1. Pi falls back to powershell.exe when pwsh.exe isn't on PATH, and 5.1 rejects chain operators. On 5.1 only, top-level chains are rewritten to $? checks (a && b → a; $__pixOk = $?; if ($__pixOk) { b; … }), and a failed chain at the end of the script still exits non-zero. Operators inside strings, comments, here-strings, and ( [ { blocks are left alone. Whenever a rewrite happens, the output starts with a visible [pix-powershell] … rewrote && / || line.

Opt-in by design

Pi exposes powershell only on native Windows, and only when you enable it. pix-powershell never enables it for you:

  • On non-Windows platforms it does nothing.
  • On Windows it waits for session start and overrides the renderer only if powershell is already an active tool. Otherwise it registers nothing, so no extra tool schema reaches the model.

Enable the tool in ~/.pi/agent/settings.json (see Pi's docs/windows.md):

{
  "defaultTools": ["read", "bash", "powershell", "edit", "write"]
}

Or for one run: pi --tools read,bash,powershell,edit,write.

Auto-collapse

Uses the shared collapse section of ~/.pi/agent/pix.json. Disable for this tool only with:

{ "collapse": { "tools": { "powershell": false } } }

Install

pi install npm:@xynogen/pix-powershell

Bundled in @xynogen/pix-core. Install it alone only if you do not use pix-core.

Full distro

This package is part of Pix. The installer sets up Pi and the full distro. See Install for the notes for each OS.

# Linux / macOS
curl -fsSL https://raw.githubusercontent.com/xynogen/pix-mono/main/scripts/install.sh | sh
# Windows
irm https://raw.githubusercontent.com/xynogen/pix-mono/main/scripts/install.ps1 | iex

License

MIT