spotify_player is a fast, easy-to-use, and configurable terminal music player designed to provide a seamless Spotify experience directly from your command line.
Key Features:
Minimalist UI with an intuitive paging and popup system for navigation.
Full feature parity with the official Spotify application, including playlist management and search functionality.
Support for streaming songs directly from the terminal using librespot technology.
Synced lyrics display for enhanced listening experience.
Cross-platform media control support via MPRIS DBus on Linux and OS window event listeners on Windows and macOS.
Image rendering capabilities in terminals like Kitty and iTerm2, with optional sixel support for improved visual quality.
Audience & Benefit:
Ideal for users who value a distraction-free listening experience while maintaining full control over their Spotify library. spotify_player offers an efficient and immersive way to interact with your music directly from the terminal, eliminating the need for additional desktop applications.
The software can be installed via winget on Windows, making it easy to integrate into your workflow.
spotify_player requires a Spotify Premium account and authenticates against the Spotify Web API using the OAuth 2.0 authorization code flow with PKCE. No client secret is stored or required.
The simplest way to authenticate is to just run the application — on first use it prompts for whichever credentials are not yet cached. Each prompt opens the Spotify authorization page in your browser; after you approve access, Spotify redirects to a local loopback address (login_redirect_uri, default http://127.0.0.1:8989/login) where spotify_player captures the authorization code and exchanges it for an access token. Credentials are cached in the application's cache folder, so this is a one-time step per machine.
Alternatively, run the spotify_player authenticate CLI command to authenticate both credentials up front — useful for setting things up ahead of a daemon or headless launch. Unlike a normal launch, authenticate always forces a fresh interactive login for both credentials, ignoring any cached tokens, so it can also be used to re-authenticate from scratch.
How authentication works
Two distinct credentials are involved:
A Web API token, used for all REST calls (playback control, library, search, playlists, etc.). This is obtained through the OAuth flow above.
A librespot session, used for the streaming feature (direct playback and Spotify Connect device registration).
Both authenticate through your Spotify account; the only thing that differs is the client ID presented to Spotify (see below).
Why you may be asked to authenticate twice
With the streaming feature enabled (the default), the first launch can open the Spotify authorization page twice — once for each credential described above, in this order:
The Web API token, presented under the configured client_id (ncspot's by default). This is cached as user_client_token.json.
The librespot session credentials, presented under Spotify's official client ID. These are cached as credentials.json.
These are two independent OAuth flows with two different client IDs, so Spotify requires a separate approval for each, and each token is cached separately in the cache folder. This is a one-time step per machine — once both tokens are cached, subsequent launches reuse and silently refresh them, and you will not be prompted again unless the cache is cleared or a token is revoked.
The spotify_player authenticate command runs both flows in one go (forcing a fresh login for each). If the streaming feature is disabled, the librespot session is not needed, so you are prompted just once (step 1).
Client ID and rate limits
Every request to the Spotify Web API is attributed to a Spotify application, identified by a client ID. The client ID — not your account — determines the API quota you are subject to.
By default, spotify_player uses ncspot's client ID. This is intentional: that client ID is registered in extended quota mode and predates Spotify's November 2024 Web API changes. As a result it has a much higher rate limit and access to endpoints (browse, personalized content, generated playlists, …) that newly-registered applications can no longer use.
> [!IMPORTANT]
> You almost certainly should not configure your own client_id. Any application you register today starts in Spotify's restricted default quota mode. Using such a client ID commonly leads to 429 Too Many Requests and 403 Forbidden errors and missing browse/personalized data. This was the root cause of several reported issues (e.g. #890, #893, #912, #913), and switching to the bundled default client ID (#918) resolved them.
>
> The recommended setup is to leave client_id unset so the bundled default is used.
Using a custom client ID
A custom client ID is only worthwhile if you have a specific reason — for example an application that has been granted extended quota mode by Spotify, or organizational policy requiring your own registered app.
If you do need one, register an application on the Spotify developer dashboard, add your login_redirect_uri (default http://127.0.0.1:8989/login) to the app's allowed redirect URIs, then set client_id (or client_id_command) in app.toml. See the Client id command section of the configuration docs for details.
After changing the client ID, re-run spotify_player authenticate to refresh the cached token.
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:
Real-time audio visualization is displayed in the playback window as a frequency-band bar chart (64 log-scale bands from bass (left) to treble (right)) while music is streamed locally via the integrated librespot player. The visualization area is hidden when playback is on an external Spotify Connect device or when the playback is not playing.
Set enable_audio_visualization to true in your config to enable this feature. See config docs.
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
Image rendering is powered by ratatui-image, which auto-detects the terminal's graphics protocol (Kitty, iTerm2, Sixel) on startup. Terminals without any graphics protocol support fall back to block characters.
Notes:
Protocol detection queries the terminal via stdio. In nested terminals (e.g. Neovim's floating terminal), the query does not reach the outer terminal emulator, so the protocol falls back to block characters.
Image rendering examples:
iTerm2:
Kitty:
Sixel (foot terminal):
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_pixels
8
16
32
64
example
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:
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:
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 or --config-folder .
If no configuration file is found, one will be created with default values.
By default, cache files are stored in $HOME/.cache/spotify-player (logs, credentials, audio cache, etc.). Change this with -C or --cache-folder .
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.