WhatsApp CLI

python selenium

If you’re fairly new to linux (like me) and fell in love with the terminal (like me), chances are you don’t want to step outside the terminal to accomplish menial tasks. There is a way to do everything from the command line, and this projects exemplifies that belief.

script and project refer to whatsapp web cli. They are used interchangeably throughout this post.

Setting the scene

This belief was the motivation for the project. Being able to use instant messaging from command line was the goal. Not on a brand new platform that is going to disrupt the IM space with its swanky features that makes all other platforms look like measly peasants. This Achilles heel of this new platform is that nobody knows about it. It is what Arya Stark aspires to be. It is No One… It only needs more users, like every other disruptive new product. But that is straying away from the goal. Making a new platform is not the goal. That would be easy. Making an existing platform accessible via command line, that, is the goal. Something everyone uses. WhatsApp.

WhatsApp already has a web interface. But I’m not about to rebuild that. I’m going to leverage the existing web interface to provide a command line interface to WhatsApp.

There’s already a third-party library available that enables comminucation with WhatsApp, albeit through its own API. 1 It also has a command line interface. I’m also not going to build an alternative to that. I’m going to build a way for the user to use WhatsApp from the command line, nothing in between. All the data stays with the user or WhatsApp, unlike third-party solutions.

So, I did exactly that.

Developing WhatsApp Web CLI

The development took place over two days, a few hours each day. The project is built in python, unsurprisingly. At this point, one can say there is no limit for my love for this language.

Key events during development:

There are still crashes every now and then, but those are not related to threading module, as I previously thought. They are related to selenium reusing http connections. Out of the scope of this project. The crashes are few and far between. Normal usage won’t be affected.

In all its glory

Live in action.

WhatsApp Web CLI demo

Source and Docs: github.com/zvovov/whatsapp-web

Back