Pi Interactive Shell

Extension

Full PTY and xterm emulation inside Pi for running interactive CLIs, dev servers, and background Pi sessions.

By Nico Bailon · npm:pi-interactive-shell · View source

What it does

Pi's built-in bash tool only handles one-shot, non-interactive commands. Pi Interactive Shell gives the agent and user a real pseudo-terminal with headless xterm emulation so full-screen TUIs, interactive prompts, long-running watchers, and nested coding agents work naturally.

Sessions can run in four modes: interactive overlay, hands-free streaming (where the agent watches live output and detaches with Ctrl+Q), background dispatch (which wakes the agent when the process exits), and event-driven monitors that trigger on regex matches or quiet periods.

When to reach for it

Invocation: The agent calls interactive_shell when a command needs a PTY or background supervision, or you run /spawn, /attach, and /dismiss directly.

Delegating work to background Pi sessions
Spawn isolated Pi processes in dispatch or hands-free mode and let them report back on completion.
Interactive CLIs and dev servers
Run REPLs, database consoles, interactive git/jj flows, or test watchers without blocking the main session.

What it adds

  • interactive_shell tool supporting interactive, hands-free, dispatch, and monitor execution modes.
  • /spawn, /attach, and /dismiss commands plus a footer status widget listing active background sessions.

Commands: /spawn, /attach, /dismiss

How it fits

  • Pi Intercom — Interactive Shell spawns background Pi processes; Pi Intercom lets those processes exchange structured messages with the coordinator.
  • Orchestration Watchdog — The watchdog prompt uses interactive_shell in hands-free mode to launch its periodic background ticker.

Good to know

  • Press Ctrl+Q in an overlay to detach from a running PTY session while keeping it alive in the background, or double-press Escape to kill it.

Source and setup

Loaded via
npm:pi-interactive-shell
Attribution
By Nico Bailon