← All projects

Tools

Spotify CLI

A menu-driven terminal interface for your Spotify account. Check what’s playing, search, see your top songs and artists, build playlists from your favorites and spot new releases without leaving the command line.

Spotify CLI terminal menu with options for search, favorites, playlists and new music
Type
Solo project
Category
Tools
Stack
Python · Spotipy · Spotify Web API

How it fits together

Architecture diagram: Terminal and main.py (choice); main.py to menu/ modules (run()); menu/ modules to Spotipy client; Spotipy client and Spotify Web API; main.py to auth.py (at start); auth.py to Spotipy client

On start, auth.py runs the Spotify sign-in and returns one authenticated client. The menu loop then hands that client to whichever module the user picks.

The problem

Most small Spotify tasks (checking what’s playing, building a playlist from your favorites, seeing whether artists you follow have new music) shouldn’t need the full desktop app. This puts them behind a simple numbered menu in the terminal.

Approach

  • Authenticates with the Spotify Web API through the Spotipy library, reading developer credentials from environment variables
  • An eight-option text menu: currently playing, search, favorite songs, favorite artists, playlist from artists, playlist from favorite songs, check for new music, and add a song to a playlist
  • Organized with one module per menu action, and shared playlist-creation and UI code kept in a separate source folder
  • Needs a Spotify Premium account and developer credentials to control playback

Highlights

  • Playlists generated from your favorite artists or top tracks
  • New-release checks across artists you follow
  • Search for songs, artists and albums from the terminal
  • Modular design: one file per feature