sexpect
« Back to VersTracker
Description:
Expect for shells
Type: Formula  |  Tracked Since: Dec 28, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: automation shell expect scripting cli testing
Install: brew install sexpect
About:
Sexpect is a command-line utility that brings Expect-like automation capabilities to shell scripts. It allows users to automate interactive applications by sending input and parsing output streams, enabling non-interactive control of programs that require user interaction. The tool is particularly valuable for automating tasks like SSH sessions, FTP transfers, or any CLI tool that expects interactive input.
Key Features:
  • Automates interactive shell sessions
  • Pattern matching and response automation
  • Supports spawned processes and PTY handling
  • Lightweight and scriptable
  • Works with standard Unix utilities
Use Cases:
  • Automating SSH logins and remote commands
  • Scripting interactive CLI tools
  • Automating file transfer protocols
  • Testing command-line applications
Alternatives:
  • expect – The classic Tcl-based Expect tool, more feature-rich but requires Tcl
  • pexpect – Python library for Expect-like functionality, better for Python-based automation
  • autoexpect – Generates Expect scripts automatically by recording user sessions
Version History
Detected Version Rev Change Commit