expect

Automate interactive CLI applications with scripted input/output

brewmacoslinux
Try with needOr install directly
Source

About

Program that can automate interactive applications

Commands

expectautoexpect

Examples

Automate SSH login with password$ expect -c 'spawn ssh user@host; expect "password:"; send "mypass\r"; interact'
Create expect script file for FTP interaction$ cat > script.exp << 'EOF' spawn ftp ftp.example.com expect "Name" send "user\r" expect "Password" send "pass\r" expect "ftp>" send "quit\r" EOF expect script.exp
Generate expect script from recorded interactive session$ autoexpect ssh user@host