LinuxCommandLibrary

spotify_player

Play Spotify music from terminal

TLDR

Start a daemon that plays music in the background

$ spotify_player [[-d|--daemon]]
copy

Start the TUI (controls the daemon if available, otherwise starts its own client)
$ spotify_player
copy

Use the specified theme
$ spotify_player [[-t|--theme]] [theme_name]
copy

Use configuration files (app.toml, keymap.toml and theme.toml) in the specified directory
$ spotify_player [[-c|--config-folder]] [path/to/directory]
copy

Like the currently playing track
$ spotify_player like
copy

Display a list of keybindings
$ <?>
copy

SYNOPSIS

spotify_player [OPTIONS] [COMMAND] [ARGUMENTS]

PARAMETERS

start
    Launches the interactive TUI (Text User Interface) for browsing your Spotify library, searching, and controlling playback. This is the primary way to use spotify_player interactively.

play [CONTEXT_URI]
    Starts playback of a specified Spotify item. CONTEXT_URI can be a track, album, artist, playlist, or podcast URI (e.g., spotify:track:XXXXXXXXXXXXX).

pause
    Pauses the currently playing track.

toggle-playback
    Toggles the current playback state between playing and paused.

next
    Skips to the next track in the current queue or context.

previous
    Skips to the previous track in the current queue or context.

shuffle [on|off]
    Toggles the shuffle mode. Optionally specify on or off to explicitly set the shuffle state.

volume [VOLUME]
    Sets the playback volume to a specific level (0-100). If VOLUME is omitted, displays the current volume.

connect <DEVICE_ID>
    Connects to a specific Spotify Connect device using its unique DEVICE_ID.

login
    Initiates the authentication process to link spotify_player with your Spotify account. Requires a web browser for authorization.

logout
    Logs out from the current Spotify account, clearing stored credentials.

--config <PATH>
    Specifies an alternative path to the configuration file (default: ~/.config/spotify-player/config.toml).

--theme <NAME>
    Applies a specific theme by name to the TUI. Themes are defined in the configuration file.

--log <LEVEL>
    Sets the logging verbosity level (e.g., debug, info, warn, error).

DESCRIPTION

spotify_player is a powerful and lightweight command-line interface (CLI) application designed to bring the Spotify music experience directly into your terminal. Written in Rust, it provides a TUI (Text User Interface) for interactive browsing, searching, and managing your Spotify library.

Users can control playback (play, pause, skip, shuffle, volume), browse playlists, albums, artists, and tracks, manage their queue, and even connect to different Spotify Connect devices. Its keyboard-driven interface offers a fast and efficient way to interact with Spotify without leaving the terminal, making it ideal for developers and power users who prefer a command-line workflow.

Beyond the interactive TUI, spotify_player also offers a rich set of subcommands for direct control, allowing for scripting and integration into custom workflows.

CAVEATS

Using spotify_player requires a Spotify Premium account for full functionality. Additionally, you must register a Spotify Developer Application to obtain a Client ID and Client Secret, which are essential for authentication with the Spotify API. The command is a third-party application and not part of standard Linux distributions; it needs to be installed separately, typically from source or via package managers like Cargo or community repositories.

CONFIGURATION

The command's behavior, including themes, keybindings, and Spotify API credentials, is extensively customizable via a TOML configuration file, typically located at ~/.config/spotify-player/config.toml. Users are encouraged to modify this file to tailor the experience to their preferences.

KEYBOARD SHORTCUTS AND MOUSE SUPPORT

The TUI is primarily navigated using keyboard shortcuts, offering a highly efficient workflow. Many actions, such as browsing, playing, and queue management, are bound to intuitive keys. Additionally, spotify_player provides optional mouse support, allowing for clicks to interact with UI elements.

HISTORY

spotify_player is a relatively modern open-source project, primarily developed by Rigellian and the community. It emerged from the desire to have a powerful and ergonomic Spotify client within the terminal, leveraging the performance and safety features of the Rust programming language. Its development focuses on providing a feature-rich TUI experience, robust playback control, and continuous integration of Spotify API enhancements.

SEE ALSO

mpv(1), cmus(1), playerctl(1), curl(1)

Copied to clipboard