Commands

sonos play

sonos play

Sends AVTransport.Play to the group coordinator. Has one subcommand for search-and-play through Sonos.

#Synopsis

sonos play --name "<Room>"
sonos play-url --name "<Room>" <url> [flags]
sonos play-url --name "<Room>" --playlist-limit 10 <playlist-url>
sonos play spotify --name "<Room>" <query> [flags]
sonos play youtube --name "<Room>" <url> [flags]

#Examples

sonos play --name "Kitchen"
sonos play-url --name "Kitchen" "https://www.youtube.com/watch?v=-n_rdQIVahw"
sonos play-url --name "Kitchen" "https://music.youtube.com/playlist?list=PL..."
sonos play spotify --name "Kitchen" --category albums "kind of blue"
sonos play youtube --name "Kitchen" "https://www.youtube.com/watch?v=-n_rdQIVahw"

#Subcommands

  • sonos play-url — stream YouTube, YouTube Music playlists, podcasts, radio, and other URLs through a Sonos-safe local proxy.
  • sonos play spotify — search Spotify via SMAPI and play the top result.
  • sonos play youtube — resolve a YouTube URL with yt-dlp and play the direct audio stream.

#How it works

sonos play resolves the target's coordinator and calls AVTransport.Play(InstanceID=0, Speed=1). There must already be something on the queue / current URI; if not, the speaker stays silent.

To start a fresh source, use sonos open (Spotify URI), sonos play-url (web audio), sonos play-uri (exact URI), or sonos favorites open.