sonoscli ~ Sonos Command Line Interface


sonoscli is a modern Go CLI to control Sonos speakers over your local network (UPnP/SOAP).

Features:

  • Reliable discovery: SSDP + topology (ZoneGroupTopology.GetZoneGroupState) with subnet scan fallback.
  • Coordinator-aware control: target any room; commands go to the group coordinator automatically.
  • Playback controls: play/pause/stop/next/prev, plus play-uri, linein, and tv.
  • Grouping: inspect groups, join/unjoin, party mode, dissolve groups, and solo a room.
  • Queue: list/play/remove/clear queue entries.
  • Favorites: list and play Sonos Favorites by index or title.
  • Scenes: save/apply presets (grouping + per-room volume/mute).
  • Spotify:
    • Enqueue/play Spotify share links or canonical URIs (no Spotify credentials required).
    • Search Spotify via SMAPI (Sonos Music API; uses your linked service in Sonos).
    • Optional Spotify Web API search (client credentials) if you want it.
  • YouTube handoff: resolve a YouTube URL with yt-dlp and hand the direct audio stream to Sonos.
  • Smart URL streaming: play-url runs a short-lived local MP3 proxy for YouTube, YouTube Music playlists, podcasts, radio streams, SoundCloud-style pages, and other URLs.
  • Live events: watch subscribes to AVTransport + RenderingControl and prints changes.
  • Scriptable output: --format plain|json|tsv plus --debug tracing.

This is not an official Sonos project.

github.com/steipete/sonoscli
sourceforge.net/projects/sonoscli.mirror

Comments welcome