Install
Install with PiG
pig install npm:@aefree/pi-wezterm-toolsInstall with Pi
pi install npm:@aefree/pi-wezterm-toolsPackages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.
Pi manifest JSON
The pi field of package.json.
{
"extensions": [
"./index.ts",
"./extensions/wezterm-tab-flash-notifier.ts"
]
}README
Written by the package's publisher, shown as published in version 0.1.8 (README.md). PiG does not review it.
Pi WezTerm Tools
Pi package that lets Pi manipulate WezTerm sessions, workspaces, layouts, and templates, and marks tabs when Pi finishes a reply.
Tools
wezterm_launchwezterm_attachwezterm_healthwezterm_killwezterm_listwezterm_load_templatewezterm_templatewezterm_workspace
Tab notifications
The bundled notifier marks the target WezTerm tab when Pi finishes a reply and the target pane is not focused.
- Pi's built-in OSC 9;4 support handles in-progress streaming and compaction activity in supporting terminals such as WezTerm.
- The notifier marks the transition back to the user turn with a
READYbadge. - It prefers exact pane targeting via
PI_WEZTERM_PANE_IDorWEZTERM_PANE, then falls back to a cached pane ID and finally a session-title match. - It updates the tab title through
wezterm cli set-tab-title; a companion WezTerm tab formatter can render the stable badge and clear it when the tab becomes active.
Supported notifier environment variables:
PI_WEZTERM_NOTIFY_ENABLEDPI_WEZTERM_EXECUTABLEPI_WEZTERM_NOTIFY_COOLDOWN_MSPI_WEZTERM_NOTIFY_TIMEOUT_MSPI_WEZTERM_NOTIFICATION_TEXTPI_WEZTERM_PANE_IDWEZTERM_PANE
Template locations
Pi-native template lookup order:
- project-local:
.pi/wezterm-templates/(requiresallowProjectTemplate: true) - user-global:
~/.pi/agent/wezterm-templates/ - package examples:
templates/examples/
Project-local templates are executable configuration from the current project, so loading one always requires explicit trust via allowProjectTemplate: true. This also prevents an unapproved project template from silently shadowing a user-global or package template. Template names may contain letters, numbers, dots, underscores, and hyphens, but not path separators or ...
Any variable interpolated into a command field is executable input and is rejected unless the caller explicitly sets allowCommandVariables: true after reviewing the value. Variables used only in non-command fields do not require this opt-in.
Install
Recommended as a global package.
From npm:
pi install npm:@aefree/pi-wezterm-tools
From GitHub for development:
pi install git:git@github.com:aefreedman/pi-wezterm-tools.git
Local development install:
pi install <path-to-pi-wezterm-tools>
Requirements
wezterminstalled and available onPATH(orPI_WEZTERM_EXECUTABLEset to its full path)- WezTerm environment variables available in the target terminal session for best notification pane targeting
jqinstalled and available onPATHbashavailable for running the packaged shell scriptspython3orpythonavailable when substituting template variables; template loading fails with a clear error when neither is installed
On macOS, the tools also fall back to /Applications/WezTerm.app/Contents/MacOS/wezterm when the wezterm command is not on PATH. Set PI_WEZTERM_EXECUTABLE to an executable file path to explicitly select a WezTerm binary; this override takes precedence over PATH.
Pane commands use Bash by default to preserve existing behavior. Set PI_WEZTERM_PANE_SHELL=/bin/zsh (or another executable shell) when pane commands should load that shell's startup environment and continue interactively in it.
Testing
npm test
Notes
- This package includes the tab notification extension; enable only the notification configuration you want Pi to load.
- Package-local shell scripts live under
scripts/wezterm/. - Example templates ship under
templates/examples/.
License
MIT. See LICENSE.