Sonos · One CLI

Sonos in your terminal

A modern Go CLI to discover, group, and control Sonos speakers over your local network — built for terminals, scripts, automations, and coding agents.

Quickstart GitHub
brew install steipete/tap/sonoscli
DiscoveryPlaybackGroupingQueueFavoritesScenesSpotifySMAPILive eventsJSON / TSV

Other install options →

Reliable discovery

SSDP + ZoneGroupTopology + subnet-scan fallback. Names match the Sonos app.

Coordinator-aware

Targets any room; transport commands automatically go to the group coordinator.

Spotify, no creds

Open Spotify URIs and search via SMAPI using the service you already linked in Sonos.

Scenes & grouping

Snapshot grouping plus per-room volume / mute, then re-apply later.

Live events

Subscribe to AVTransport + RenderingControl and stream changes as they arrive.

Scriptable

plain | json | tsv output, predictable exit codes, and a --debug SOAP trace.

sonoscli

sonos is a single binary that talks to your Sonos system the way the Sonos app does — over the local network, using UPnP/SOAP — but from the terminal.

#What you can do

  • Discover every speaker reliably (SSDP + topology + subnet fallback).
  • Control playback on any room — play, pause, stop, next, prev, line-in, TV.
  • Group rooms — join, unjoin, dissolve, party-mode, solo, group volume/mute.
  • Manage the queue — list, play a specific entry, remove, clear.
  • Open Spotify links without Spotify credentials (uses the Spotify service you already linked in the Sonos app).
  • Search linked services via Sonos SMAPI, or Spotify directly via Spotify Web API.
  • Save scenes — capture grouping + per-room volume/mute and re-apply later.
  • Watch live events — subscribe to AVTransport / RenderingControl and stream changes.
  • Pipe to JSON / TSV for scripts and dashboards.

#Why a CLI?

Sonos's IP API is rich, stable, and undocumented in places. The official apps are great for everyday use but painful for automations, kiosks, and AI agents. sonoscli treats your speakers as plain HTTP devices on port 1400 and exposes the most useful actions as composable subcommands.

This is not an official Sonos project.

#At a glance

brew install steipete/tap/sonoscli

sonos discover
sonos status --name "Kitchen"
sonos open --name "Kitchen" "https://open.spotify.com/track/6NmXV4o6bmp704aPGyTVVG"
sonos group party --to "Living Room"
sonos scene save evening
sonos watch --name "Kitchen"

Pick a starting point: