nicobailon/pi-interactive-shell

Pi coding agent extension that allows Pi to autonomously control interactive CLIs in an observable overlay. Full PTY emulation, no tmux, token efficient. User can take over anytime.

What it solves

Pi Interactive Shell allows AI coding agents to run and manage interactive command-line interfaces (CLIs) within an observable terminal user interface (TUI) overlay. It bridges the gap between static command execution and interactive tools like text editors (Vim), REPLs, database shells (psql), and long-running processes (npm run dev), allowing an agent to control the process while a user can watch in real-time and intervene when necessary.

How it works

The project provides a tool that the AI agent can invoke to spawn subprocesses. It supports four distinct operational modes:

  • Interactive: The agent and user can both send input and monitor status.
  • Hands-free: Designed for long-running builds or servers where the agent polls for updates and the user can watch progress.
  • Hands-free/Dispatch: The agent is notified upon completion of the task (via triggerTurn), allowing for "fire-and-forget" delegation to subagents.
  • Monitor: An event-driven mode that wakes the agent when specific triggers (regex, literal strings, or file changes) are detected in the output stream.

Users can take over control of any session by typing, and return control to the agent using specific hotkeys (Ctrl+G).

Who it’s for

Developers using the Pi coding agent who need their AI assistant to handle complex CLI tasks, manage subagents, or monitor system logs and tests without blocking the main chat interface.

Highlights

  • TUI Overlay: Real-time observability of CLI processes with the ability for users to take over control instantly.
  • Subagent Delegation: Ability to spawn other agents (like Codex, Claude, or Cursor) in isolated worktrees to perform parallel tasks.
  • Event-Driven Monitoring: Advanced triggers for stream, poll-diff, and file-watching strategies to alert the agent to specific events.
  • Flexible Input: Supports raw text, named keys (Ctrl+C), bracketed paste for multiline input, and hex bytes for escape sequences.
  • Output Transfer: A "Transfer & Close" feature (Ctrl+T) that captures the final output of a sub-session and sends it directly back to the main agent's context.

Related

  • Project
  • Project
  • Project
  • Project
  • Project