Look you are calling some tools which act in interactive mode, so as dani-gehtdichnixan mentioned at (passing arguments to an interactive program non interactively) you can use expect
utilities.
Install expect
at debian:
apt-get install expect
Create a script call spi-install.exp
which could look like this:
#!/usr/bin/env expect
set user username
set pass your-pass
spawn spi -rhel7
expect "Enter username"
send "$user\r"
expect "Renter password"
send "$pass\r"
Then call it at your main bash script:
#!/bin/bash
wget https://raw.githubusercontent.com/hidden-refuge/spi/master/spi && ./spi-install.exp && rm spi
Expect is used to automate control of interactive applications such as Telnet, FTP, passwd, fsck, rlogin, tip, SSH, and others. Expect uses pseudo terminals (Unix) or emulates a console (Windows), starts the target program, and then communicates with it, just as a human would, via the terminal or console interface. Tk, another Tcl extension, can be used to provide a GUI.
https://en.wikipedia.org/wiki/Expect
Reference :
[1] passing arguments to an interactive program non interactively
[2] https://askubuntu.com/questions/307067/how-to-execute-sudo-commands-with-expect-send-commands-in-bash-script
[3] https://superuser.com/questions/488713/what-is-the-meaning-of-spawn-linux-shell-commands-centos6