Commands

sonos play spotify

sonos play spotify

Uses Sonos's own SMAPI search (no Spotify Web API credentials) to find Spotify content, then enqueues and plays it on the target room's coordinator. Spotify must already be linked in the Sonos app.

#Synopsis

sonos play spotify <query> --name "<Room>" [flags]

#Flags

FlagDefaultWhat it does
--service stringSpotifyMusic service name (as shown in sonos smapi services).
--category stringtracksSMAPI search category — try tracks, albums, playlists.
--index int0Result index to play (0-based).
--enqueueoffOnly enqueue; don't start playback.
--title stringTitle override for the queued item.

#Examples

sonos play spotify --name "Kitchen" --category albums "kind of blue"
sonos play spotify --name "Kitchen" --category tracks "miles davis"
sonos play spotify --name "Kitchen" --category playlists "deep focus"

# Pick the second result instead of the top one
sonos play spotify --name "Kitchen" --category albums --index 1 "blue train"

# Enqueue only
sonos play spotify --name "Kitchen" --enqueue --category albums "kind of blue"

#Prerequisites

For Spotify, you'll likely need to do a one-time DeviceLink the first time:

sonos auth smapi begin    --service "Spotify"
sonos auth smapi complete --service "Spotify" --wait 2m

#See also