SPOTIFY-PLAYER(1)

NAME

spotify-playerA Spotify player in the terminal with full feature parity

SYNOPSIS

$sudo apt install libssl-dev

INFO

6.6k stars
345 forks
0 views

DESCRIPTION

A Spotify player in the terminal with full feature parity

README

spotify_player

Table of Contents

Introduction

spotify_player is a fast, easy to use, and configurable terminal music player.

Features

Examples

A demo of spotify_player v0.5.0-pre-release on youtube or on asciicast:

Checkout examples/README.md for more examples.

Installation

By default, the application's installed binary is spotify_player.

Requirements

A Spotify Premium account is required.

Dependencies

Windows and MacOS
Linux
  • Rust and cargo as the build dependencies
  • install openssl, alsa-lib (streaming feature), libdbus (media-control feature).
    • For example, on Debian based systems, run the below command to install application's dependencies:

      sudo apt install libssl-dev libasound2-dev libdbus-1-dev
      
    • On RHEL/Fedora based systems, run the below command to install application's dependencies :

      sudo dnf install openssl-devel alsa-lib-devel dbus-devel
      

      or if you're using yum:

      sudo yum install openssl-devel alsa-lib-devel dbus-devel
      

Binaries

Application's prebuilt binaries can be found in the Releases Page.

Note: to run the application, Linux systems need to install additional dependencies as specified in the Dependencies section.

Homebrew

Run brew install spotify_player to install the application.

Scoop

Run scoop install spotify-player to install the application.

Cargo

Install via Cargo:

cargo install spotify_player --locked

Arch Linux

Install via Arch Linux:

pacman -S spotify-player

Note: Defaults to PulseAudio/Pipewire. For a different backend, modify the official PKGBUILD and rebuild manually. See Audio Backends.

Void Linux

Install via Void Linux:

xbps-install -S spotify-player

FreeBSD

Install via FreeBSD:

pkg install spotify-player

NetBSD

Install via NetBSD:

pkgin install spotify-player

Build from source on NetBSD:

cd /usr/pkgsrc/audio/spotify-player
make install

NixOS

spotify-player is available as a Nix package. Install via:

nix-shell -p spotify-player

To build from source locally, run nix-shell in the root of the source checkout. The provided shell.nix will install prerequisites.

Docker

Note: The streaming feature is disabled in the Docker image.

Download the latest Docker image:

docker pull aome510/spotify_player:latest

Run the Docker container:

docker run --rm -it aome510/spotify_player:latest

To use your local config and cache folders:

docker run --rm \
-v $APP_CONFIG_FOLDER:/app/config/ \
-v $APP_CACHE_FOLDER:/app/cache/ \
-it aome510/spotify_player:latest

Features

Spotify Connect

Control Spotify remotely with Spotify Connect. Press D to list devices, then enter to connect.

Streaming

Stream music directly from the terminal. The streaming feature is enabled by default and uses the rodio-backend audio backend unless otherwise specified.

The app uses librespot to create an integrated Spotify client, registering a spotify-player device accessible via Spotify Connect.

Audio backend

Default audio backend is rodio. Available backends:

  • alsa-backend
  • pulseaudio-backend
  • rodio-backend
  • portaudio-backend
  • jackaudio-backend
  • rodiojack-backend
  • sdl-backend
  • gstreamer-backend

To use a different audio backend, specify the --features option when building. For example:

cargo install spotify_player --no-default-features --features pulseaudio-backend

Notes:

  • Use --no-default-features to disable the default rodio-backend.
  • Additional dependencies may be required for some backends. See Librespot documentation.

To disable streaming, build with:

cargo install spotify_player --no-default-features

Media Control

Media control is enabled by default. Set enable_media_control to true in your config to use it. See config docs.

Media control uses MPRIS DBus on Linux and OS window events on Windows and macOS.

Image

To enable image rendering, build with the image feature (disabled by default):

cargo install spotify_player --features image

Full-resolution images are supported in Kitty and iTerm2. Other terminals display images as block characters.

To use sixel graphics, build with the sixel feature (also enables image):

cargo install spotify_player --features sixel

Notes:

  • Not all terminals supported by libsixel are supported by spotify_player (see viuer supported terminals).
  • Sixel images may scale oddly; adjust cover_img_scale for best results.

Image rendering examples:

  • iTerm2:

iTerm2

  • Kitty:

kitty

  • Sixel (foot terminal, cover_img_scale=1.8):

sixel

  • Others:

others

Pixelate

For a pixelated look, enable the pixelate feature (also enables image):

cargo install spotify_player --features pixelate

Adjust the pixelation with the cover_img_pixels config option.

cover_img_pixels8163264
example8x816x1632x3264x64

To temporarily disable pixelation, set cover_img_pixels to a high value (e.g., 512).

Notify

To enable desktop notifications, build with the notify feature (disabled by default):

cargo install spotify_player --features notify

Note: Notification support is limited on macOS and Windows compared to Linux.

Mouse support

Mouse support: You can seek to a position in the playback by left-clicking the progress bar.

Daemon

To enable daemon mode, build with the daemon feature (disabled by default):

cargo install spotify_player --features daemon

Run as a daemon with -d or --daemon: spotify_player -d.

Notes:

  • Daemon mode is not supported on Windows.

  • Daemon mode requires streaming and an audio backend.

  • On macOS, daemon mode does not work with media control (enabled by default). To use daemon mode on macOS, disable media control:

    cargo install spotify_player --no-default-features --features daemon,rodio-backend
    

Fuzzy search

To enable fuzzy search, build with the fzf feature (disabled by default).

CLI Commands

spotify_player provides several CLI commands for interacting with Spotify:

  • get: Get Spotify data (playlist/album/artist data, user's data, etc)
  • playback: Interact with the playback (start a playback, play-pause, next, etc)
  • search: Search spotify
  • connect: Connect to a Spotify device
  • like: Like currently playing track
  • authenticate: Authenticate the application
  • playlist: Playlist editing (new, delete, import, fork, etc)

For more details, run spotify_player -h or spotify_player {command} -h.

Notes

  • On first use, run spotify_player authenticate to authenticate the app.
  • CLI commands communicate with a client socket on port client_port (default: 8080). If no instance is running, a new client is started, which may increase latency.

Scripting

The command-line interface is script-friendly. Use the search subcommand to retrieve Spotify data in JSON format, which can be processed with tools like jq.

Example: Start playback for the first track from a search query:

read -p "Search spotify: " query
spotify_player playback start track --id $(spotify_player search "$query" | jq '.tracks.[0].id' | xargs)

Commands

Press ? or C-h to open the shortcut help page (default for OpenCommandHelp).

Tips:

  • Use the Search command to search in the shortcut help page and other pages.
  • RefreshPlayback manually updates playback status.
  • RestartIntegratedClient is useful for switching audio devices without restarting the app.

List of supported commands:

CommandDescriptionDefault shortcuts
NextTracknext trackn
PreviousTrackprevious trackp
ResumePauseresume/pause based on the current playbackspace
PlayRandomplay a random track in the current context.
Repeatcycle the repeat modeC-r
Shuffletoggle the shuffle modeC-s
VolumeChangechange playback volume by an offset (default shortcuts use 5%)+, -
Mutetoggle playback volume between 0% and previous level_
SeekStartseek start of current track^
SeekForwardseek forward by a duration in seconds (defaults to seek_duration_secs)>
SeekBackwardseek backward by a duration in seconds (defaults to seek_duration_secs)<
Quitquit the applicationC-c, q
ClosePopupclose a popupesc
SelectNextOrScrollDownselect the next item in a list/table or scroll down (supports vim-style count: 5j)j, C-n, down
SelectPreviousOrScrollUpselect the previous item in a list/table or scroll up (supports vim-style count: 10k)k, C-p, up
PageSelectNextOrScrollDownselect the next page item in a list/table or scroll a page down (supports vim-style count: 3C-f)page_down, C-f
PageSelectPreviousOrScrollUpselect the previous page item in a list/table or scroll a page up (supports vim-style count: 2C-b)page_up, C-b
SelectFirstOrScrollToTopselect the first item in a list/table or scroll to the topg g, home
SelectLastOrScrollToBottomselect the last item in a list/table or scroll to the bottomG, end
ChooseSelectedchoose the selected itementer
RefreshPlaybackmanually refresh the current playbackr
RestartIntegratedClientrestart the integrated client (streaming feature only)R
ShowActionsOnSelectedItemopen a popup showing actions on a selected itemg a, C-space
ShowActionsOnCurrentTrackopen a popup showing actions on the current tracka
ShowActionsOnCurrentContextopen a popup showing actions on the current contextA
AddSelectedItemToQueueadd the selected item to queueZ, C-z
FocusNextWindowfocus the next focusable window (if any)tab
FocusPreviousWindowfocus the previous focusable window (if any)backtab
SwitchThemeopen a popup for switching themeT
SwitchDeviceopen a popup for switching deviceD
Searchopen a popup for searching in the current page/
BrowseUserPlaylistsopen a popup for browsing user's playlistsu p
BrowseUserFollowedArtistsopen a popup for browsing user's followed artistsu a
BrowseUserSavedAlbumsopen a popup for browsing user's saved albumsu A
CurrentlyPlayingContextPagego to the currently playing context pageg space
TopTrackPagego to the user top track pageg t
RecentlyPlayedTrackPagego to the user recently played track pageg r
LikedTrackPagego to the user liked track pageg y
LyricsPagego to the lyrics page of the current trackg L, l
LibraryPagego to the user library pageg l
SearchPagego to the search pageg s
BrowsePagego to the browse pageg b
Queuego to the queue pagez
OpenCommandHelpgo to the command help page?, C-h
PreviousPagego to the previous pagebackspace, C-q
OpenSpotifyLinkFromClipboardopen a Spotify link from clipboardO
SortTrackByTitlesort the track table (if any) by track's titles t
SortTrackByArtistssort the track table (if any) by track's artistss a
SortTrackByAlbumsort the track table (if any) by track's albums A
SortTrackByAddedDatesort the track table (if any) by track's added dates D
SortTrackByDurationsort the track table (if any) by track's durations d
SortLibraryAlphabeticallysort the library alphabeticallys l a
SortLibraryByRecentsort the library (playlists and albums) by recently added itemss l r
ReverseOrderreverse the order of the track table (if any)s r
MovePlaylistItemUpmove playlist item up one positionC-k
MovePlaylistItemDownmove playlist item down one positionC-j
CreatePlaylistcreate a new playlistN
JumpToCurrentTrackInContextjump to the current track in the contextg c
JumpToHighlightTrackInContextjump to the currently highlighted search result in the contextC-g

To add or modify shortcuts, see the keymaps section.

Actions

Not all actions are available for every Spotify item. To see available actions, use ShowActionsOnCurrentTrack or ShowActionsOnSelectedItem, then press enter to trigger the action. Some actions may not appear in the popup but can be bound to shortcuts.

List of available actions:

  • GoToArtist
  • GoToAlbum
  • GoToRadio
  • AddToLibrary
  • AddToPlaylist
  • AddToQueue
  • AddToLiked
  • DeleteFromLiked
  • DeleteFromLibrary
  • DeleteFromPlaylist
  • ShowActionsOnAlbum
  • ShowActionsOnArtist
  • ShowActionsOnShow
  • ToggleLiked
  • CopyLink
  • Follow
  • Unfollow

Actions can also be bound to shortcuts. To add new shortcuts, see the actions section.

Search Page

When entering the search page, focus is on the search input. Enter text, use backspace to delete, and enter to search.

To move focus from the search input to other windows (track results, album results, etc.), use FocusNextWindow or FocusPreviousWindow.

Configurations

By default, configuration files are located in $HOME/.config/spotify-player. Change this with -c <FOLDER_PATH> or --config-folder <FOLDER_PATH>.

If no configuration file is found, one will be created with default values.

See configuration documentation for details on available options.

Caches

By default, cache files are stored in $HOME/.cache/spotify-player (logs, credentials, audio cache, etc.). Change this with -C <FOLDER_PATH> or --cache-folder <FOLDER_PATH>.

Logging

Logs are stored in $APP_CACHE_FOLDER/spotify-player-*.log. For debugging or issues, check the backtrace file in $APP_CACHE_FOLDER/spotify-player-*.backtrace.

Set the RUST_LOG environment variable to control logging level. Default is spotify_player=INFO.

Acknowledgement

spotify_player is written in Rust and built on top of libraries like ratatui, rspotify, librespot, and more. It is inspired by spotify-tui and ncspot.

SEE ALSO

clihub3/4/2026SPOTIFY-PLAYER(1)