How to Use Spotify in the Terminal on Linux, Mac, or Windows

Written by

Spotify logo generated in ASCII characters in a Linux terminal.

Have you ever wanted to stream Spotify’s music and podcasts without distracting banners and pushy recommendations? With a tool called Spotify TUI, you can control your Spotify stream in your computer’s terminal. We’ll show you how to set it up.

What Is Spotify TUI?

The Spotify TUI client uses the Spotify API to provide a simplified, text-based interface for your account. That means that you still have to have the Spotify app open and running somewhere, either on your PC or a remote device like your phone or smart TV. Wherever it is, Spotify TUI will allow you to control it right from the terminal on your PC or laptop. It’s fairly easy to install and set up on macOS or Linux, though Windows users will have to jump through a few more hoops.

Hey Spotify, Podcasts Are Ruining the Music Experience

RELATEDHey Spotify, Podcasts Are Ruining the Music Experience

The interface is far cleaner and more streamlined than Spotify’s standard apps. Spotify TUI removes everything but the library, your playlists, and the search function while embuing your fingertips with more keyboard shortcuts. That means no annoying podcast recommendations or distracting features like the friend feed or release alerts. You can also reduce Spotify TUI’s interface to a small “now playing” box. There’s also an “analysis” screen, which shows your music’s tempo, key, and time signature along with live pitch levels.

Another benefit is Spotify TUI’s small footprint compared to the RAM consumption of the desktop or web app. If you’re running the Spotify app on another device, you can control it remotely while saving your PC’s precious resources.

If you’d like to completely remove the need for a full Spotify app, macOS and Linux users can look into spotifyd. It’s a background process (or “daemon”) that streams your Spotify music and podcasts on your PC without a graphical interface. Hook it up to Spotify TUI, and you’ve got a lightweight, minimalist Spotify setup.

Note: Spotify TUI is very limited if you’re using the free version of Spotify. Though you can install and use it without upgrading to Premium, you won’t be able to do much but search for music and see what’s playing.

Installing Spotify TUI

Though you can build from source if you prefer, there are some ready-made install packages available depending on your operating system.

Mac

Mac users can install Spotify TUI through Homebrew using this command in the Mac terminal:

brew install spotify-tui

Windows

While you technically can install Spotify TUI directly on Windows 10 or Windows 11, it involves installing additional software. See the guide to installing it on Windows for details if you’re interested.

Instead, you may want run WSL (the Windows Subsystem for Linux) and install Spotify TUI in that environment as a workaround. However, you’ll need to make sure you install a few dependencies using this command:

sudo apt-get install -y -qq pkg-config libssl-dev libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev

Linux

The easiest and most reliable method to install Spotify TUI on most Linux distributions is with Snap, using the following command.

snap install spt

Fedora or CentOS users can install it with dnf after adding the appropriate repository.

sudo dnf copr enable atim/spotify-tui -y && sudo dnf install spotify-tui

If you run Arch Linux or an Arch-based system, like Manjaro, EndeavourOS, or Garuda, you can get it in the AUR and install it with your preferred AUR helper. If you have access to AUR packages through pacman, simply use this command:

sudo pacman -S spotify-tui

Setting Up Spotify TUI

You have a little bit of work on the front-end to get Spotify TUI set up, so let’s get cracking.

Step 1: Create a Developer Account

Using Spotify TUI requires that you register as a Spotify API developer. If you happen to already be a developer, skip this step. If you aren’t, no need to worry; it just means accepting the developer terms of service.

Go to the Spotify Developer dashboard and log in with the Spotify account you plan to stream with.

You’ll be asked to agree to some terms as a Spotify developer. Review them appropriately, then check the box and click “Accept the Terms.”

Check the box and click "Accept the Terms."

Step 2: Create an App

Your next step is creating a Spotify app. Again, don’t be intimidated; you just need to copy and paste a few lines of text. You’re essentially creating a bridge by which Spotify TUI can communicate with your Spotify account.

In the upper-right corner of the developer dashboard, click “Create an App.”

Click the "Create an App" button.

In the dialog that appears, give your app any name and description you prefer (both are required). Then click “Create.”

Enter a name and description in the "Create App" dialog.

You should be brought to your app overview. Near the top, click the green “Edit Settings” button so we can set the port.

Click "Edit Settings" in the app overview screen.

In the dialog that appears, find the “Redirect URIs” field. Copy and paste this link into that field.

http://localhost:8888/callback

Click “Add” to set the URI.

Add the redirect URI to your Spotify app.

Save the settings, and you’re ready to connect your app.

Step 3: Connect Spotify TUI to Your Spotify App

With your app created, you’re going to input your client ID and client secret in Spotify TUI to connect your account. You should see the client ID near the top of your app overview, with a “Show Client Secret” button below it. Click the button so that both are ready.

Client ID and client secret button in Spotify app overview.

Keep those codes available as you open a terminal and run Spotify TUI by using the spt command.

spt

The first time you run this command, you’ll be prompted to enter your client ID followed by your client secret. Grab them both from the app overview and paste into the terminal when prompted. You’ll also be asked for your redirect URI port. Unless you chose a different port, this will be 8888.

After entering your client information, you’ll be directed to a webpage asking you to give your app permission to control your Spotify account. Click the “Agree” button.

Agree to give permissions to your Spotify app.

Your browser might be redirected to a blank or error page. Don’t worry, you can close it and the developer overview, then reopen your terminal window. It should now show the Spotify TUI interface. Launch the Spotify app on your preferred device, and congratulations, you’re now using Spotify in the terminal!

Using Spotify TUI: Navigation and Keyboard Shortcuts

spotify-tui in a Linux terminal.

Spotify TUI’s interface is divided into a few fields, and you can move between or within fields using the arrow keys. You can also resize the terminal window, and Spotify TUI will automatically accommodate the change.

Tip: Spotify TUI uses whatever theming is applied to your terminal. If you want to change the colors and font you’ll need to customize your terminal settings.

In the Library field, you can find your saved music, listening history, and podcasts. You’ll see some “now playing” stats at the bottom, like the song and artist, the streaming device, and your volume level. The large center field next to the Playlists field will show whatever content you’ve selected or searched for.

Press Enter after highlighting any field so move within it. After highlighting an item you want to access, press Enter again. You can back out of any field with the q key (make sure it’s lowercase). The q key will also quit Spotify TUI if you’ve moved all the way back to the Spotify TUI logo.

You can press space to pause or resume playback, n to skip a track, > to seek forward, and the + and – keys to adjust the volume. Search for anything by hitting the / (forward slash) key, then type in a keyword or phrase and hit Enter.

Search for music in spotify-tui.

If you have several playlists saved on your Spotify account, you’ll notice only a limited number are accessible in the Playlists field. To find your other playlists, you’ll have to search for them.

One neat feature in Spotify TUI is the audio analysis view. It processes the current audio to determine its tempo, key, and time signature. and you can access it by hitting the v (lowercase) key.

The audio analysis screen in spotify-tui.

If you’re tight on screen space, you can also switch to a compact “bar only” view with the key combination Shift+B.

Switch to the compact view on spotify-tui.

At any time you can type “?” to get a complete list of keyboard shortcuts. Happy listening!

As you’re enjoying Spotify in the command prompt, consider some other cool Spotify features you may be missing out on.

RELATED: 6 Awesome Spotify Features You Should Be Using

Article Categories:
Linux

Leave a Reply

Your email address will not be published. Required fields are marked *