pty_send_command
Send a command to a live interactive terminal session and capture its output. Handles session creation/reconnection, ideal for TTY-aware programs like REPLs and interactive shells.
Instructions
Send a command to an interactive PTY session and capture its output.
Creates the session if it does not exist (or reconnects if it does), opens
the WebSocket data plane, writes the command, and reads output until the
terminal is quiet for idle_timeout seconds (or max_wait elapses).
Prefer execute_command for non-interactive commands; use this for
TTY-aware programs (REPLs, TUIs, interactive shells).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cols | No | Initial terminal width in character cells (1..1000). | |
| rows | No | Initial terminal height in character cells (1..1000). | |
| command | Yes | The shell command to run inside the PTY. | |
| max_wait | No | Hard cap on total time spent collecting output. | |
| idle_timeout | No | Stop reading after this many seconds of silence. | |
| session_name | Yes | Client-chosen PTY session name (``[A-Za-z0-9_-]``, 1..256). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||