一键导入
manage-pty
Manage interactive or persistent terminal sessions. Must use before running these sessions, like start a dev server, SSH, REPL, ...
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Manage interactive or persistent terminal sessions. Must use before running these sessions, like start a dev server, SSH, REPL, ...
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Standard workflow to implement a plan. Use only when user instructs or other skill references.
Guidelines to help you write code smartly by using workers. Only use
Disciplined diagnosis loop for hard bugs and performance regressions. Use only when user instructs or other skill references.
Workflow to transform vague ideas into validated designs and stepped implementation plans. Use only when user instructs or other skill references.
Review a plan before implementation. Use only when user instructs or other skill references.
Inspect Git history and uncommitted changes to obtain delta in blueprint.
| name | manage-pty |
| description | Manage interactive or persistent terminal sessions. Must use before running these sessions, like start a dev server, SSH, REPL, ... |
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)
pty-bridge --timeout 60000 exec <id> "slow-command" # Override client socket timeout (default: 30000ms)
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)
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 10s
enter, tab, escape, space, backspace, delete, up, down, left, right, home, end, pageup, pagedown, ctrl-a through ctrl-z, ctrl-\, ctrl-]
[key=value ...] format, e.g. [lines=42 alive=true buffer=normal exitCode=0]read returns output on stdout, session metadata on stderr — parse stderr for session stateexec returns command output on stdout — check isAlive and exitCode in the stderr line or JSON responsesnapshot prints a header line [buffer=... cursor=... size=...] then the screen contentstatus output is human-readable text (parse with regex if needed)exec over write + sendkey enter — exec combines write, enter, wait, and read into one call, returning only the new output.read is incremental by default — it returns only output since the last read. Use read <id> --full to get the entire buffer.exec does NOT advance the read cursor — if you call exec then read, the read will include the same output that exec already returned. This is by design: exec is a self-contained operation that doesn't interfere with incremental read state.wait-for for long operations — instead of sleep N && read, use wait-for <id> "pattern" --timeout N to block until specific output appears.write sends text as-is — use sendkey enter afterward to submit (or just use exec).echo -n "password" | pty-bridge write <id> --stdinkill sessions when done to free resources.ctrl-c via sendkey to interrupt stuck commands.--cols/--rows on start or resize for TUI apps that need specific dimensions.--timeout <ms> (global flag, before the command) to override the default 30s client socket timeout for slow operations.