Gmail Authentication from shell script

Hello All,
I want my script to accept Gmail user name and password from command line and authenticate that user .Is it possible ?
I heard about doing it using Google API's but not able to find right material on net.

This is possible using gmailshellaccess

Click here for details.