Loading...
Loading...
Manage interactive terminal sessions (SSH, REPLs, databases, TUI apps) via pty-bridge CLI. Use when the standard Bash tool cannot handle interactive programs that require a PTY.
npx skill4agent add briqt/pty-bridge pty-bridgepty-bridgepty-bridge statuscommand not foundcurl -fsSL https://raw.githubusercontent.com/briqt/pty-bridge/main/skill/install.sh | bashnpm i -g github:briqt/pty-bridgepty-bridge start <command> [args...] # Start a PTY session
pty-bridge read <id> [--full] [--buffer <type>] # Read new output (incremental by default, --full for all)
pty-bridge write <id> <input> # Send input (or pipe via stdin)
pty-bridge exec <id> <command> [--wait <ms>] # Execute command and return new output (default wait: 200ms)
[--wait-for-idle <ms>]
pty-bridge sendkey <id> <key> # Send special key
pty-bridge wait-for <id> <pattern> [--timeout <s>] # Block until pattern appears (default: 30s)
pty-bridge snapshot <id> # Capture current visible screen content
pty-bridge list # List active sessions with uptime, buffer type, and details
pty-bridge kill <id> # Terminate a session
pty-bridge resize <id> <cols> <rows> # Resize terminal
pty-bridge status # Show daemon status (PID, memory, sessions)pty-bridge start ssh user@host --keepalive 30 # Send keepalive every 30s (prevents SSH timeout)
pty-bridge start cmd --wait 1000 # Wait 1000ms before returning initial output (default: 500ms)pty-bridge read <id> --buffer normal # Read from normal buffer (even if alternate is active)
pty-bridge read <id> --buffer alternate # Read from alternate buffer
pty-bridge read <id> --buffer active # Read from whichever buffer is active (default)pty-bridge exec <id> "make build" --wait-for-idle 500 # Poll every 500ms, return when output stabilizes (max 5s)
pty-bridge exec <id> "make build" --wait-for-idle 500 --wait 10000 # Same but max wait 10spty-bridge snapshot <id> # Returns current visible screen: lines, cursor position, buffer type, dimensionspty-bridge start ssh user@host --keepalive 30
pty-bridge read <id>
# If password prompt:
echo -n "password" | pty-bridge write <id> --stdin
pty-bridge sendkey <id> enter
pty-bridge read <id>
# Run commands (exec = write + enter + wait + read, one step):
pty-bridge exec <id> "ls -la"
pty-bridge exec <id> "df -h"
# For slow commands, increase wait time:
pty-bridge exec <id> "apt update" --wait 5000
# Disconnect:
pty-bridge exec <id> "exit"pty-bridge start ssh user@host --keepalive 30
pty-bridge exec <id> "docker compose up -d"
pty-bridge exec <id> "docker logs -f myservice" --wait 1000
# Block until service is ready:
pty-bridge wait-for <id> "Uvicorn running" --timeout 120
# Or wait for model loading:
pty-bridge wait-for <id> "Started" --timeout 300pty-bridge start python3
pty-bridge exec <id> "print('hello')"
pty-bridge exec <id> "2 + 2"
pty-bridge sendkey <id> ctrl-dpty-bridge start some-installer
pty-bridge read <id>
pty-bridge write <id> "yes"
pty-bridge sendkey <id> enter
pty-bridge read <id>[key=value ...][lines=42 alive=true buffer=normal exitCode=0]readexecisAliveexitCodesnapshot[buffer=... cursor=... size=...]status| Symptom | Cause | Action |
|---|---|---|
| Not installed | Run install command above |
| Daemon died or not started | |
| SSH password prompt | Interactive auth required | Use |
| Pattern never appeared | Check the partial output returned; pattern may have typo or command failed silently |
| npm install fails | Missing build tools | Install build-essential + python3 (see Installation section) |
| PTY output is empty/garbled | TUI app in alternate screen | Use |
execwritesendkey enterexecreadread <id> --fullwait-forsleep N && readwait-for <id> "pattern" --timeout Nwritesendkey enterexececho -n "password" | pty-bridge write <id> --stdinkillctrl-cresizePTY_BRIDGE_TIMEOUT