Manage pty
Blueprint-based agentic coding harness.
npx -y skills add hesprs/harness --skill manage-ptyAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Manage interactive or persistent terminal sessions. Must use before running these sessions, like start a dev server, SSH, REPL, ...
SKILL.md
4.2 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it
Commands
pty-bridge [--timeout <ms>] <command> [options]
pty-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>] [--wait-for-idle <ms>] # Execute command and return new output (default wait: 200ms)
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)
Global Options
pty-bridge --timeout 60000 exec <id> "slow-command" # Override client socket timeout (default: 30000ms)
Start Options
pty-bridge start ssh user@host --keepalive 30 # Send keepalive every 30s (prevents SSH timeout)
pty-bridge start pnpm dev --wait 1000 # Wait 1000ms before returning initial output (default: 500ms)
pty-bridge start cmd --cols 200 --rows 50 # Custom terminal dimensions (default: 120x40)
Read Options
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)
Exec Options
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 10s
Special Keys
enter, tab, escape, space, backspace, delete, up, down, left, right, home, end, pageup, pagedown, ctrl-a through ctrl-z, ctrl-\, ctrl-]
Output Format Convention
- stdout: command output (the actual PTY content)
- stderr: metadata line in
[key=value ...]format, e.g.[lines=42 alive=true buffer=normal exitCode=0] readreturns output on stdout, session metadata on stderr — parse stderr for session stateexecreturns command output on stdout — checkisAliveandexitCodein the stderr line or JSON responsesnapshotprints a header line[buffer=... cursor=... size=...]then the screen contentstatusoutput is human-readable text (parse with regex if needed)
Important Notes
- Prefer
execoverwrite+sendkey enter—execcombines write, enter, wait, and read into one call, returning only the new output. readis incremental by default — it returns only output since the last read. Useread <id> --fullto get the entire buffer.execdoes NOT advance thereadcursor — if you callexecthenread, thereadwill include the same output thatexecalready returned. This is by design:execis a self-contained operation that doesn't interfere with incrementalreadstate.- Use
wait-forfor long operations — instead ofsleep N && read, usewait-for <id> "pattern" --timeout Nto block until specific output appears. writesends text as-is — usesendkey enterafterward to submit (or just useexec).- For secrets, pipe via stdin:
echo -n "password" | pty-bridge write <id> --stdin - Always
killsessions when done to free resources. - The daemon auto-exits after 5 minutes when no alive sessions remain.
- Use
ctrl-cvia sendkey to interrupt stuck commands. - Terminal defaults to 120x40. Use
--cols/--rowsonstartorresizefor TUI apps that need specific dimensions. - Use
--timeout <ms>(global flag, before the command) to override the default 30s client socket timeout for slow operations.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.