Search for music via Brave Search and play it on your Sonos speakers directly from the command line.
--unsafe)npm install
Set your Brave Search API key as an environment variable:
export BRAVE_API_KEY=your-api-key
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
node src/index.js current "Living Room"
node src/index.js list
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' }, ...]
| 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 |
MIT
共 2 个版本