Spotify TUI

terminal writing

Spotify TUI is spotify client for the terminal written it rust. It provides all the features of the desktop spotify app within the comfort of your terminal.

Installation

There are two installation options for Spotify TUI. Either you install just the TUI but in order to play music you will have to either the desktop app running, website open, or some device connected. Second option is to install it alongside spotifyd which is background deamon that acts as a spotify connected device and allows you to play music on you desktop/laptop without anything other running.

Setup spotifyd

spotifyd is an open source Spotify client running as a UNIX daemon. In other words, spotifyd is a deamon that acts as a spotify client allowing you to play music on your device without the need of having the spotify desktop app running or the spotify web app open.

spotifyd can be easily installed using brew: brew install spotifyd.1

There are some additional tweaks that need to be done on MacOS before the deamon can run. First, make sure that you have directory for the spotifyd config file:

mkdir -p ~/.config/spotifyd

Next, create following config file modifying your username as needed:

echo "[global]
username = "[email protected]"
use_keyring = true
backend = "rodio"
" > ~/.config/spotifyd/spotifyd.conf

If you want to learn more about the configuration options see the full reference.

The configuration above takes advantage of the MacOS Keychain to store the password. To add the password to the kaychain, run:

security add-generic-password -s spotifyd -D rust-keyring -a [email protected] -w

This will prompt you for the password for you spotify account. After this step you are all set and ready. Just start up the deamon:

brew services start spotifyd

Setup Spotify TUI

Next step is to install and configure the Spotify TUI. First install it using:

brew install spotify-tui

Next, connect it to the Spotify’s API. This involves a few simple steps that will be displayd when you first run the tui (spt). They go as follows:

🎉 that’s it, you are set and done. Now you can sit back, relax to some chill music and watch your colleagues gaze in envy.


By the way, if you don’t want to keep the spotifyd running in background you can alias spt to this:

alias spt="brew services start spotifyd && spt && brew services stop spotifyd"