Get the FREE Ultimate OpenClaw Setup Guide →
P

Sonoscli

Verified

@steipete

npx machina-cli add skill @steipete/sonoscli --openclaw
Files (1)
SKILL.md
940 B

Sonos CLI

Use sonos to control Sonos speakers on the local network.

Quick start

  • sonos discover
  • sonos status --name "Kitchen"
  • sonos play|pause|stop --name "Kitchen"
  • sonos volume set 15 --name "Kitchen"

Common tasks

  • Grouping: sonos group status|join|unjoin|party|solo
  • Favorites: sonos favorites list|open
  • Queue: sonos queue list|play|clear
  • Spotify search (via SMAPI): sonos smapi search --service "Spotify" --category tracks "query"

Notes

  • If SSDP fails, specify --ip <speaker-ip>.
  • Spotify Web API search is optional and requires SPOTIFY_CLIENT_ID/SECRET.

Source

git clone https://clawhub.ai/steipete/sonoscliView on GitHub

Overview

SonosCLI is a command-line tool to control Sonos speakers on your local network. It supports discovering devices, checking status, playback commands, volume, grouping, favorites, queue, and Spotify search via SMAPI. It runs locally via SSDP discovery with an IP fallback if needed.

How This Skill Works

The tool uses SSDP to discover Sonos devices on the LAN and then issues commands to the target speaker(s) by name. It covers status, playback (play/pause/stop), volume adjustments, grouping actions (join/party/solo), queue management, favorites, and SMAPI-based Spotify search when credentials are provided.

When to Use It

  • Setting up a new Sonos system and verifying devices on the LAN.
  • Quickly controlling playback and volume in a named room (e.g., Kitchen).
  • Grouping or ungrouping speakers for synchronized or separate playback.
  • Automating queue management, favorites access, and basic playback scripting.
  • Searching and playing Spotify tracks via SMAPI when credentials are available.

Quick Start

  1. Step 1: Install sonoscli (Go) with 'go install github.com/steipete/sonoscli/cmd/sonos@latest' (requires Go).
  2. Step 2: Run quick commands like 'sonos discover', 'sonos status --name Kitchen', 'sonos play|pause|stop --name Kitchen', 'sonos volume set 15 --name Kitchen'.
  3. Step 3: If SSDP discovery fails, re-run commands with 'sonos ... --ip <speaker-ip>' to target a specific device.

Best Practices

  • Target specific speakers with --name to avoid cross-room actions.
  • If SSDP discovery fails, fall back to specifying the speaker IP with --ip <speaker-ip>.
  • Use grouping commands (status, join, party, solo) intentionally to achieve desired playback scope.
  • Keep Spotify credentials (SPOTIFY_CLIENT_ID/SECRET) secure and up to date for SMAPI searches.
  • Save frequently used commands in shell aliases or scripts for automation.

Example Use Cases

  • Discover devices, check the Kitchen status, and start playback in Kitchen.
  • Group Kitchen with Living Room for party-mode synchronized playback.
  • List the current queue, play a track, then clear the queue.
  • List favorites and open a chosen one to play.
  • Search Spotify tracks via SMAPI and start playback (requires SPOTIFY_CLIENT_ID/SECRET).

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers