I really like this but 2 things:
1) I really wish there was a pause button.
2) Please notify the user that it is using their YouTube account to play music. My YT history has now blown up with songs, and it felt kind of invasive.
explain () {
if [ "$#" -eq 0 ]
then
while read -p "Command: " cmd
do
curl -Gs "https://www.mankier.com/api/explain/?cols="$(tput cols) --data-urlencode "q=$cmd"
done
echo "Bye!"
elif [ "$#" -eq 1 ]
then
curl -Gs "https://www.mankier.com/api/explain/?cols="$(tput cols) --data-urlencode "q=$1"
else
echo "Usage"
echo "explain interactive mode."
echo "explain 'cmd -o | ...' one quoted command to explain it."
fi
}