rainbowstream
Rainbowstream: a colourful CLI Twitter Client

The command line remains so incredibly popular because it’s so incredibly versatile.

You can do a lot in a terminal. You can manage your OS, apps and files; you can connect to remote servers, watch movies, play games, fetch the weather forecast, and a whole heap more

Using the CLI can be both fun and educational.

Using Twitter through a command line interface though? Hmm…

Twitter CLI is Pretty Fun

I’ll grant you that using a Twitter CLI sounds a bit crazy, and in many ways it is.

Twitter is a visual platform these days, with avatars, embedded photos, videos, gifs, polls, those new-fangled Twitter Moments — all part-and-parcel of the microblogging service’s reason d’être.

But at it’s core Twitter is a text service — it was initially set up as an SMS-based service — and this means it “just works” when viewed through a text-based tool like a terminal emulator.

Using Twitter in a terminal window can be a great way to harness the value of the tool in a work or study environment, but without distraction of auto-playing gifs and lurid celebrity selfies.

In a way,  Twitter terminal apps allow you zone in on the content of tweets rather than the window dressing that accompanies them; a way to keep Twitter in focus without you losing focus, if you will.

Several Twitter CLI Apps Exist

There are numerous different command line Twitter clients available for Windows, macOS and Linux.

Our favourite is the open-source Python-based Rainbow Stream. It strikes the best balance between looking good and working good, and supports almost every feature you’ll need.

While Rainbow Stream is available for Windows and Mac we are only focusing on how it works on Linux, specifically Ubuntu.

Rainbow Stream: Twitter CLI

rainbow stream terminal

Rainbow Stream is colourful, well structured and can do just about everything that a desktop twitter app or web-based client can.

You can see the most recent tweets from those you follow, and like, retweet or quote-retweet if you need to; you can post your own status updates, send and read direct messages, and even follow, unfollow or block people!

And just because you can’t see images (by default) doesn’t mean you can’t post them as, yup, Rainbow Stream supports picture uploads.

We could wax lyrical all-night about its many, many features but the official website and documentation available on its GitHub page do an ample job of explaining.

Install Rainbow Stream on Ubuntu

screen-shot-2016-10-24-at-18-30-56

Open a new Terminal window and run the following command to install Rainbow Stream using the python package management system:

sudo pip3 install rainbowstream

If you get an error running it’s because pip3 isn’t installed. You’ll need to install it first:

sudo apt install python3-pip

Now re-run the command above.

The python pip will take care of installing most of what you need, but should you encounter any issues about missing dependencies you can run:

sudo apt-get install libsqlite3-dev libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev

Assuming all goes well you can launch the app by running the following command:

rainbowstream

The first time you run Rainbow Stream you will be guided through adding a (valid) Twitter account.

The Twitter authentication page will open in a new tab in your default browser. You’ll need to login with the Twitter account you wish to use in Rainbow Stream, authorise the app, and then type the access PIN you see in your browser back in the terminal.

Once successfully authorised you’re in!

Rainbow Stream: Helpful Commands

There is a giddying array of commands you can run, but some of the most useful commands you’ll be wanting to use follow. Type h and hit enter to view the built-in help documentation.

To send a tweet from Rainbowstream just type t while in interactive mode followed by the content of the tweet you want to send, e.g:

t I'm tweeting from #Rainbowstream, an ace CLI #Twitter Client

Then hit enter to send it.

Other helpful commands:

  • home – show most recent tweets from the home stream
  • me – show your own tweets
  • mentions – see the most recent tweets mentioning you
  • view @username – view an account’s tweets
  • whois @username – view an account’s profile
  • fl @username – follow a user
  • s keyword – search for tweets mentioning a word/phrase
  • fav id – fave the tweet with the matching ID
  • rt id – retweet the tweet with the matching ID

You can also use numbers after many of the commands, e.g., home 5 will only show the five most recent retweets from your home timeline, while s ubuntu 5 will show the five most recent tweets mentioning ‘ubuntu’.

If you take Rainbow Stream for a spin let us know by tweeting us or by using the #rainbowstream hashtag!