Pi Interactive Shell
Lets the Pi coding agent drive interactive CLIs autonomously in an observable overlay, with one-key user takeover.
- Source repo
- nicobailon/pi-interactive-shell
- Stars
- ★ 608
- Last updated
- 28d ago
- FARS reviewed
- Nov 25, 2026
- Primary language
- TypeScript
- FA score
- 58/100 · Major gaps
At a glance
- How it runs
- Works with
- Portable with changes
- Cost
- Free software; you pay for model usage
- Setup effort
- Medium · a few setup steps
- You'll need
- Typical use
- Developers who want Pi to open vim or psql and also be able to type commands into the same session
- Not a fit if
- Teams not using the Pi coding agent
- Users needing stable Linux production support (Linux is experimental)
- Workflows requiring confirmed subprocess termination
- Maintenance
- Commits in the last 30 dayslast commit 2026-10-28
- Source review
- 58/100 · Major gaps
What does this agent do, and when should you use it?
Pi Interactive Shell is an extension for the Pi coding agent that runs interactive subprocesses inside a TUI overlay through the interactive_shell tool. It uses zigpty for full PTY emulation and xterm-headless for terminal emulation, so programs such as vim, psql, htop and ssh behave as if attached to a real terminal. Four modes cover the workflow: interactive for human-driven shells, hands-free for polling, dispatch for fire-and-forget completion callbacks, and monitor for trigger-based wakeups. Users can type to take over, press Ctrl+T to transfer output back to the main agent, or Ctrl+B to background a session, while the agent drives the same shell through a stable sessionId. Headless dispatch and monitor sessions write full output logs under ~/.pi/agent/cache/interactive-shell/ and wake the agent with a compact notification. It is distributed as an npm package for Pi, with no external multiplexer required.
The agent calls interactive_shell({ command }); the extension opens a PTY via zigpty, renders it through xterm-headless into a Pi TUI overlay, and immediately returns a stable sessionId. Later calls reuse that sessionId with input plus submit, inputKeys (such as ctrl+c, down, enter), inputPaste or inputHex to write to the terminal, and with outputLines, incremental or drain to read output. mode: "dispatch" returns at once and later wakes the agent through triggerTurn with a captured tail; mode: "monitor" supports stream, poll-diff and file-watch strategies with literal, regex and threshold triggers, queryable via monitorStatus and monitorEvents. Structured spawn parameters and the /spawn command launch pi, codex, claude, cursor or custom spawn agents, optionally with worktree: true inside a separate git worktree. Optional Jev semantic supervision transmits bounded, redacted terminal text only when the global config enables jev.enabled, TYPESAFE_API_KEY is present in the Pi process environment, and the tool call explicitly supplies monitor.semantic.
- Developers who want Pi to open vim or psql and also be able to type commands into the same session
- Engineers delegating a refactor with /spawn codex --worktree and waiting for a completion notification
- Testers who want Pi to watch npm test -- --watch and wake only when a FAIL line appears
- Teams running several background pi or claude dispatches in parallel and handling each result as it arrives
- Operators who need alerts when a new PDF lands in an uploads folder or a health endpoint changes
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Config files
~/.pi/agent/interactive-shell.json.pi/interactive-shell.json
How do you install or deploy this agent?
Install the extension as a Pi npm package:
pi install npm:pi-interactive-shellNode.js is required; PTY support uses zigpty prebuilt binaries, so no node-gyp toolchain is needed on supported platforms. If you load the extension from a local folder instead of the package, link skills/interactive-shell into ~/.pi/agent/skills/ yourself.
How do you use this agent?
After installation, ask Pi in natural language and let it issue the tool call; users can also use the /spawn, /attach and /dismiss commands. Agent-side examples:
interactive_shell({ command: 'vim package.json' })
interactive_shell({ command: 'npm run dev', mode: 'hands-free', reason: 'Dev server' })
interactive_shell({ sessionId: 'calm-reef', input: 'SELECT * FROM users;', submit: true })
interactive_shell({ spawn: { agent: 'codex' }, mode: 'dispatch' })Global config lives at ~/.pi/agent/interactive-shell.json and project config at .pi/interactive-shell.json:
{
"overlayWidthPercent": 95,
"overlayHeightPercent": 60,
"focusShortcut": "alt+shift+f"
}Overlay keys: Ctrl+T transfers output, Ctrl+B backgrounds the session, Ctrl+Q opens the session menu, and Ctrl+G returns control to the agent after you take over a monitored session.
Safety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
What are this agent's strengths and limitations?
- Full PTY through zigpty with no tmux dependency, so CLIs believe they are in a real terminal
- Four modes (interactive, hands-free, dispatch, monitor) share one stable sessionId model
- Lean tool schema cuts the per-request definition from about 18,644 to about 4,700 characters
- Any keypress lets the user take over, and Ctrl+T hands subagent output straight back to the main agent
- Background dispatch and monitors run concurrently, with optional git worktree isolation for spawns
- Tightly bound to the Pi coding agent; other agents cannot use it directly
- macOS is tested while Linux is labeled experimental, and some TUI apps show rendering quirks
- kill only cancels local supervision; subprocess exit is not confirmed
- Agent queries are rate limited to 60 seconds by default unless reconfigured
- Optional Jev supervision needs a TYPESAFE_API_KEY and sends bounded terminal text to an external provider
How does this agent compare with similar options?
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| Pi Interactive Shell This agent | 58 · Major gaps | Agent plugin / skillFree + model costs | ★ 608 | 28d ago | TypeScript | — |
| Oh My Pi | 68 · Some gaps | CLIFree + model costs | ★ 40k | today | TypeScript | Codex · OpenAI API · Claude API |
| Pi Subagents | 69 · Some gaps | Agent plugin / skill | ★ 4.3k | today | TypeScript | — |
| Cline | 60 · Some gaps | CLIFree + model costs | ★ 72k | today | TypeScript | OpenAI API · Claude API |
How does FollowAgents rate this agent?
Why each dimension lost points
README documents multiple consent gates for Jev/TypeSafe egress (per-launch outputSelection, global jev.enabled, inherited TYPESAFE_API_KEY) plus local raw recovery and fixed retention bounds, so data_flow_transparency scores 2. However the extension lets an agent autonomously run arbitrary CLIs (vim/ssh/psql/pi/claude) in a PTY with no per-command confirmation, so least_privilege and user_confirmation score 1. Dependencies include prebuilt zigpty binaries and a pinned @typesafe-ai/sdk with no audit or integrity note, so dependency_security scores 1. External effects (worktrees, background processes, log writes) are described but rollback relies on best-effort kill and 24h log cleanup, so external_effects and rollback score 1. Author and repo URL are present but publisher is unverified, so source_attribution scores 1.
README and SKILL.md agree on modes, autoExitOnQuiet, and completionReason semantics, and tests cover config merging, background widget, and session selection, so self_consistency scores 2. CI uses npm install --no-package-lock and peerDependencies are '*', weakening reproducibility, so dependency_availability scores 1. Error paths exist (describeShellResolutionError, console.error on invalid config), so failure_messages scores 2.
Covers many interactive CLIs and coding agents with four modes and spawn resolution, so audience_and_scenarios scores 3. SKILL.md states when to use bash vs interactive_shell, so capability_boundaries scores 2. Monitor triggers support literal/regex/threshold, so trigger_precision scores 2. Node>=22.19 and zigpty platform support are stated, so environment_fit scores 2.
README is well structured with clear install and rich examples, so examples_and_faq scores 3. CHANGELOG appears only in the files list with no content in evidence, so versioning_changelog scores 1. package.json says MIT while top-level metadata says unknown, so license scores 2. Maintenance rests on a single author and issues link, so maintenance_responsibility scores 1.
Output is configurable (lines, pagination, drain) and notifications include tail plus log path, so output_usability scores 2. Marginal value over plain bash is PTY coverage and an observable overlay, so marginal_value scores 2. Token efficiency is claimed but Jev selection adds external call cost, so cost_benefit scores 2.
README cites a frozen corpus hash and eval numbers that cannot be checked statically, so claim_traceability scores 1. README, SKILL.md, tests, and package.json corroborate each other on modes and config, so cross_source_corroboration scores 2. Docs separate claims from inference (e.g., 'does not establish universal accuracy'), so fact_inference_separation scores 2.
- The extension lets an agent autonomously run arbitrary commands in a PTY with no per-command confirmation; prefer isolated environments or worktrees.
- Jev/TypeSafe egress depends on global config and an inherited API key; confirm users understand the three consent gates before enabling.
- Dependencies include prebuilt zigpty binaries and a pinned SDK with no stated integrity check or audit.
- CI uses npm install --no-package-lock, weakening dependency reproducibility.
- Publisher identity is unverified and license metadata is unknown at top level while package.json says MIT; verify independently.
FAQ
Does it need tmux or another terminal multiplexer?
Can a user interact with the overlay directly?
When does a dispatch session notify the agent?
Is terminal content sent to an external service?
Which shell do new sessions use?
Is Pi Interactive Shell free?
Is Pi Interactive Shell open source?
Is Pi Interactive Shell safe to use?
Is Pi Interactive Shell still maintained?
Who makes Pi Interactive Shell?
Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.