360 Secure SkillHub
360 安全技能中心

Sonos Music Search

该 Skill 是 Node.js 命令行工具,通过 Brave Search 检索曲目后在局域网内指定 Sonos 音箱播放,支持查看当前播放曲目、列出可用音箱;默认开启安全搜索,可用 --unsafe 关闭。运行需配置 BRAVE_API_KEY 环境变量。

terrycarter1985
terrycarter1985
热度 38.27
最近更新 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