expect
Send an optional command, then match incoming session output against regex or substring patterns to synchronize prompts and automate multi-step authentication, SSH logins, and U-Boot interception.
Instructions
Atomically send an optional command and match incoming stream against prompt patterns. Ideal for multi-step authentication (SSH login/password), prompts, and U-Boot interception.
Args: patterns: List of regex/substring patterns to expect (e.g. ['password:', '# ']). command: Optional command/response to send before waiting. timeout: Maximum seconds to wait. Defaults to 10.0s. poll_cmd: Characters to repeatedly send during wait (e.g. ' ' for autoboot intercept). poll_interval: Interval between repeating poll_cmd. Defaults to 0.05s. session_id: Target session ID (defaults to currently active session).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | No | ||
| timeout | No | ||
| patterns | Yes | ||
| poll_cmd | No | ||
| session_id | No | ||
| poll_interval | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||