How To Play GIF In Your Terminal

A tutorial on playing GIF in your terminal using gif-for-cli in Linux or Mac OS. ¯\_(ツ)_/¯

Ayush Gupta
Youstart Labs
3 min readJun 27, 2018

--

Make your terminal lit 🔥.

You might have seen ASCII arts on your terminal like the ones below when installing a new module/library in your system. Some developers (or even you might have) configure a static ASCII art which appear when they open their terminal. But have you ever seen a GIF running in your Swiss Army knife like terminal? 👀 That would give life and a personality to your terminal!

ASCII Arts in terminal

Nothing is impossible. Now even playing a GIF on your terminal is possible. GIF has been around us for long 31 years (seriously? 😲) and what better time it is to see GIF in your terminal.

Getting Started

Requires Python 3 (with setuptools and pip), zlib, libjpeg, and ffmpeg, other dependencies are installed by setup.py.

Install dependencies

Your Python environment may need these installation tools -

Install gif-for-cli

Install from PyPI:

Or download this repo and run:

The gif-for-cli command will likely be installed into ~/.local/bin or similar, you may need to put that directory in your $PATH by adding this to your .profile:

GIF in action

I’ll be using my favorite Slackmoji Party Parrot for playing in the terminal.

Party Parrot. (Reddit Party Parrot Community)

Don’t know about Party Parrot? It’s quite an interesting story. Read it out here.

After the installation, run the following command in your terminal and enjoy the party 😉. The following command queries the Tenor’s GIF API and returns the top GIF.

Party Parrot in terminal. (Recorded with Peek)

For exploring more gif-for-cli usage options, check the link below.

What about Windows users? 😕

Currently, this is not supported on Windows platform. Though, there is an open issue on GitHub’s repo for Windows Command Prompt and PowerShell support. You can subscribe to that issue or keep a watch on the repository. Or a much better initiative, switch to Linux 😎 as soon as possible or just wait forever.

Let’s see what GIF you have put up on your terminal. Comment down below your terminal images with GIF in action 📷.

Thank you for reading! Your each 👏 would motivate me to write more helpful articles and make open source contribution. You can further connect with me on LinkedIn, Instagram, GitHub, Twitter and Facebook.

--

--

Ayush Gupta
Youstart Labs

Mobile Frontend Engineer at Razorpay | Developer, Blogger, Amateur Photographer | ayushgupta.tech | Curating scriptified.dev