返回技能中心
📋

Sonoscli

Control Sonos speakers from the command line — discover devices, manage playback, adjust volume, and organize groups.

作者 Peter Steinberger
效率與任務效率開源自動化CLI開發者工具API

# Sonoscli Control Sonos speakers from the command line — discover devices, manage playback, adjust volume, and organize groups. Discover speakers — Automatically finds all Sonos devices on the local network via SSDP.Playback control — Play, pause, or stop any speaker by name.Volume management — Set precise volume levels on individual speakers.Group control — Join, unjoin, party-mode, or solo speakers with simple commands.Favorites and queue — Browse and play Sonos favorites, and manage the playback queue.Spotify search — Search Spotify tracks via SMAPI (requires optional Spotify credentials). ## How It Works Install the CLI — The sonos binary is installed via Go and communicates directly with Sonos speakers over the local network.Discover devices — Run sonos discover to find all speakers using SSDP multicast. If SSDP fails, specify a speaker IP directly with --ip.Run commands — Target a speaker by name using --name and issue playback, volume, or group commands.Optional Spotify integration — Provide SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET environment variables to enable Spotify search via the SMAPI protocol. ## Key Features Zero cloud dependency — Communicates directly with Sonos speakers on the local network; no Sonos account required for basic use.Named speaker targeting — Use --name "Room Name" to target any speaker by its Sonos room label.Group management — Full group lifecycle: check status, join, unjoin, party mode, and solo.Queue control — List, play from, and clear the playback queue.Favorites playback — List and open Sonos favorites from the CLI.Spotify SMAPI search — Search Spotify content without leaving the terminal (optional credentials required). ## Requirements Sonos speakers — One or more Sonos devices on the same local network as the machine running the CLI.Go toolchain — Required to install the sonos binary via go install.Network access — SSDP multicast must be reachable; if not, use --ip as a fallback.Spotify credentials (optional) — SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET are needed only for Spotify SMAPI search. ## Use Cases Home automation scripts — Trigger music playback, adjust volume, or mute speakers as part of shell scripts or cron jobs.AI assistant integration — Let Clawdbot control your Sonos speakers via natural language commands.Morning/evening routines — Automate speaker grouping and volume levels at set times.Developer environments — Quickly mute or control speakers without leaving the terminal during focused work sessions. ## Installation Install via: `npx clawhub@latest install sonoscli`

安裝

1

在終端機中執行

npx clawhub@latest install sonoscli
2

點擊本頁頂部的安裝按鈕進行一鍵安裝