360 Secure SkillHub
360 安全技能中心

Sonos Music Search

核心功能包括通过Brave搜索Spotify曲目并在指定Sonos音箱播放、查看当前播放曲目、列出网络内可用Sonos音箱,默认开启安全搜索可手动关闭。典型场景为命令行快速点播音乐、查看音箱状态、管理局域网Sonos设备。支持命令行调用与编程API,需Node.js≥18、Brave API密钥及同网Sonos音箱,输入音箱名/关键词,返回操作结果或相关信息。

terrycarter1985
terrycarter1985
热度 38.23
最近更新 2026-05-11 23:11:46
分类:自动化依赖:第三方 API应用场景:自动化脚本 / 推荐

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add sonos-music-search-skill
Metadata
name
sonos-music-search-skill
description
Search for music via Brave Search and play it on Sonos speakers. Supports play, current track, and speaker discovery.
homepage
https://clawhub.com/skills/sonos-music-search-skill
metadata
{"aren":{"emoji":"🎵","requires":{"bins":[],"env":["BRAVE_API_KEY"]},"install":[{"id":"npm","kind":"npm","package":"sonos-music-search-skill@latest","label":"Install Sonos Music Search skill"}]}}

Sonos Music Search Skill

Search for music via Brave Search and play it on your Sonos speakers directly from the command line.

Features

  • Search for Spotify tracks using Brave Search
  • Play found tracks on a specified Sonos speaker
  • View the currently playing track
  • List available Sonos speakers on the network
  • Safe search enabled by default (opt into unrestricted with --unsafe)

Prerequisites

  • Node.js >= 18
  • A Brave Search API key (get one here)
  • At least one Sonos speaker on the same network

Installation

npm install

Configuration

Set your Brave Search API key as an environment variable:

export BRAVE_API_KEY=your-api-key

Usage

Play a track

node src/index.js play "Living Room" "pink floyd comfortably numb"

Add --unsafe to disable safe search:

node src/index.js play "Living Room" "explicit track name" --unsafe

View currently playing track

node src/index.js current "Living Room"

List available speakers

node src/index.js list

Programmatic API

const { searchAndPlay, getCurrentTrack, listSpeakers } = require('sonos-music-search-skill');

// Play a track
const result = await searchAndPlay('Living Room', 'pink floyd comfortably numb');
// { success: true, track: '...', speaker: 'Living Room', uri: 'spotify:track:...' }

// Get current track
const track = await getCurrentTrack('Living Room');
// { title: '...', artist: '...', ... }

// List speakers
const speakers = await listSpeakers();
// [{ name: 'Living Room', host: '192.168.1.50' }, ...]

Scripts

Command Description
npm start Run the CLI
npm run audit Run the skill audit
npm run format Format JS and Markdown files
npm run format:check Check formatting without writing

License

MIT