YOUR TERMINAL AGENT's BEST COUPLE !
Just as Terminal Agents use Playwright to control browsers, pty-repeater enables them to control CLI tools, REPLs, and debuggers. It minimizes LLM token consumption and allows seamless session sharing across multiple terminal instances.
brew install pty-repeaternpm install -g @zzwz2049/pty-repeater1. Install via NPM
npm install -g @zzwz2049/pty-repeater2. Configure MCP Server
{
"mcpServers": {
"terminalcp": {
"command": "pty-repeater",
"args": ["--mcp"]
}
}
}This screenshot demonstrates a PM Agent (ShellAgent-Master) orchestrating multiple Worker Agents (Claude and Codex) through pty-repeater. The left sidebar shows task execution flow, while the right panels display live terminal sessions with token usage tracking and real-time collaboration between agents.

PM-Agent programmatically controls any CLI tool, AI agents, REPLs, and debuggers through PTY forwarding
Unix socket IPC communication enables cross-client session sharing. Humans can attach/detach anytime while AI agents run continuously
stdout for rendered terminal screens (TUI/interactive), stream for ANSI-stripped text (logs/builds)
Independent write queues prevent race conditions, 200ms CR delay for TUI compatibility, auto-spawn server on demand
PTY + ANSI rendering core layer
node-ptyxterm.js\r delayed 200ms for TUIPersistent daemon service
IPC communicationUniversal communication abstraction
start actionCLI + MCP dual interface
CLI: tmux-style syntax ::EnterMCP: JSON commands (\r, \u001b)