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!
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.
Requires Python 3 (with setuptools and pip), zlib, libjpeg, and ffmpeg, other dependencies are installed by
1# Debian based distros2sudo apt-get install ffmpeg zlib* libjpeg* python3-setuptools34# Mac5brew install ffmpeg zlib libjpeg python
Your Python environment may need these installation tools -
1sudo easy_install3 pip23# This should enable a pre-built Pillow wheel to be installed, otherwise4# you may need to install Python, zlib, and libjpeg development libraries5# so Pillow can compile from source.67pip3 install --user wheel
1pip3 install --user gif-for-cli
Or download this repo and run:
1python3 setup.py install --user
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
1# Linux2if [ -d "$HOME/.local/bin" ] ; then3 PATH="$HOME/.local/bin:$PATH"4fi56# Mac, adjust for Python version7if [ -d "$HOME/Library/Python/3.6/bin/" ] ; then8 PATH="$HOME/Library/Python/3.6/bin/:$PATH"9fi
GIF in action
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.
1gif-for-cli "party parrot"
For exploring more gif-for-cli usage options, check the gif-for-cli repo.
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 📷.