curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -
Example output:
Retrieving speedtest.net configuration...
Testing from WIND (151.48.54.99)...
Retrieving speedtest.net server list...
Selecting best server based on ping...