Control Spotify from your terminal
Installation • Quick Start • Commands • Configuration
[!WARNING] Spotify Developer Account Required
This CLI requires a Spotify Client ID from the Spotify Developer Dashboard. You'll need to create an app to get your credentials.
Note: Spotify has temporarily disabled new developer app registrations (likely in response to the Anna's Archive data breach). If you can't create a new app, you'll need to wait until registration reopens.
[!CAUTION] API Stability
The Spotify Web API is known to change without warning, rhyme, or reason. Endpoints may break, rate limits may shift, and features may disappear overnight. This tool does its best to adapt, but it ultimately sits on top of Spotify's APIs and inherits their quirks.
Features
- Playback Control — Play, pause, skip, seek, volume, shuffle, repeat
- Library Management — Save and organize tracks, albums, podcasts, audiobooks
- Playlist Management — Create, edit, reorder, follow/unfollow playlists
- Advanced Search — Filter by artist, album, year, genre, ISRC, UPC
- Device Control — List devices and transfer playback
- Pin System — Create shortcuts to frequently used resources
- JSON Output — Machine-readable output for scripting
- RPC Daemon — JSON-RPC 2.0 over Unix sockets for external control (macOS/Linux only)
Installation
From crates.io
From source
Pre-built binaries
Download from GitHub Releases.
| Platform | Architecture | Download |
|---|---|---|
| macOS | Intel | spotify-cli-*-x86_64-apple-darwin.tar.gz |
| macOS | Apple Silicon | spotify-cli-*-aarch64-apple-darwin.tar.gz |
| Linux | x86_64 | spotify-cli-*-x86_64-unknown-linux-gnu.tar.gz |
| Linux | ARM64 | spotify-cli-*-aarch64-unknown-linux-gnu.tar.gz |
| Windows | x86_64 | spotify-cli-*-x86_64-pc-windows-msvc.zip |
| Windows | ARM64 | spotify-cli-*-aarch64-pc-windows-msvc.zip |
Requirements
- Spotify Premium (required for playback control)
- Rust 1.85+ (if building from source)
Quick Start
1. Create a Spotify App
- Go to Spotify Developer Dashboard
- Create a new app
- Add
http://127.0.0.1:8888/callbackas a Redirect URI - Copy your Client ID
2. Configure
Create ~/.config/spotify-cli/config.toml:
[]
= "your_client_id_here"
3. Authenticate
4. Play
Commands
Aliases
| Command | Alias | Example |
|---|---|---|
player |
p |
spotify-cli p status |
search |
s |
spotify-cli s "query" |
playlist |
pl |
spotify-cli pl list |
library |
lib |
spotify-cli lib list |
info |
i |
spotify-cli i track |
| Command | Alias | Example |
|---|---|---|
next |
n |
spotify-cli p n |
previous |
prev |
spotify-cli p prev |
toggle |
t |
spotify-cli p t |
status |
st |
spotify-cli p st |
volume |
vol |
spotify-cli p vol 50 |
shuffle |
sh |
spotify-cli p sh on |
repeat |
rep |
spotify-cli p rep track |
recent |
rec |
spotify-cli p rec |
queue |
q |
spotify-cli p q list |
devices |
dev |
spotify-cli p dev list |
Authentication
Player
# Play specific content
Search
Playlists
Library
Devices
Queue
Pins
Create shortcuts to frequently used resources:
Daemon (RPC)
Note: The daemon is only available on macOS and Linux. Windows is not supported due to the use of Unix sockets.
Run a background daemon for external control via JSON-RPC 2.0:
See docs/RPC.md for the full API reference.
Configuration
Config file: ~/.config/spotify-cli/config.toml (Windows: %APPDATA%\spotify-cli\)
[]
= "your_spotify_client_id"
[]
= true # Show fuzzy match scores
= false # Sort by score vs Spotify relevance
File locations
| File | Purpose |
|---|---|
config.toml |
Configuration |
token.json |
OAuth tokens |
pins.json |
Pinned resources |
daemon.sock |
RPC Unix socket (macOS/Linux only) |
Verbose logging
Troubleshooting
| Problem | Solution |
|---|---|
| Config file not found | Create ~/.config/spotify-cli/config.toml with your client_id |
| No active device | Open Spotify on any device to activate it |
| Token expired | Run spotify-cli auth login --force |
| Premium required | Playback control requires Spotify Premium |
License
MIT OR Apache-2.0