Does a gmail terminal chat client exist or anyway one can write it?
Yes. Gmail uses the Jabber chat protocol which has been around for much longer than gchat and is supported by a number of open source command line chatting programs. One of my favorite terminal chat clients is Centericq which supports jabber along with many other chat protocol. It is ncurses based:
To connect to gchat use these settings:
Username: Your Google Talk username (without any @ symbol or domain information) Password: Your password Login Server: Enter the portion of your email address after the @ symbol. For example, firstname.lastname@example.org will enter example.com as the Login Server value. Use SSL: Yes Manually specify connection host: Yes Host: talk.google.com Port: 5223 Keep connection alive: Yes
Part of the Pidgin IM client is a terminal based client called Finch. Take a look at the Using Finch page on the Pidgin wiki.
Bitlbee provides an IRC interface to most of the common chat protocols. Mix with Irssi or your CLI IRC client of choice.
MCabber should also work just fine. It supports OTR also (which is crucial if we talk about Google and nowadays internet).
(MCabber is my favorite by the way. I tried all the alternatives but this seemed to be the best so far. It just works, it's just excellent.)
sudo apt-get install irssi-plugin-xmpp