{"id":28754208,"url":"https://github.com/zeroasterisk/sonos-simple-cli","last_synced_at":"2025-08-16T23:10:14.084Z","repository":{"id":29725346,"uuid":"33268551","full_name":"zeroasterisk/sonos-simple-cli","owner":"zeroasterisk","description":"Control Sonos from CLI with pause|play and Alfred support","archived":false,"fork":false,"pushed_at":"2015-04-02T18:49:35.000Z","size":200,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-24T10:31:32.297Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeroasterisk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-01T19:39:38.000Z","updated_at":"2017-02-28T18:51:08.000Z","dependencies_parsed_at":"2022-08-23T19:01:04.881Z","dependency_job_id":null,"html_url":"https://github.com/zeroasterisk/sonos-simple-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zeroasterisk/sonos-simple-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroasterisk%2Fsonos-simple-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroasterisk%2Fsonos-simple-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroasterisk%2Fsonos-simple-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroasterisk%2Fsonos-simple-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeroasterisk","download_url":"https://codeload.github.com/zeroasterisk/sonos-simple-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroasterisk%2Fsonos-simple-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270781393,"owners_count":24643820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-17T01:07:54.151Z","updated_at":"2025-08-16T23:10:14.057Z","avatar_url":"https://github.com/zeroasterisk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sonos Simple CLI\n\nThere are many better projects out there.\n\nBut this is one I am working on to play with Node CLI\nand to use personally for the control of my own Sonos speakers.\n\n## Features\n\n- [x] acts only only the configured device via `roomName` config file `~/.sonos.json`\n- [x] caches a found/configured device (faster startup)\n- [x] supports pause/play toggle, and prev/next, vol +/-\n- [x] built in support for Alfred Workflow (and thus a global hotkey shortcut)\n- [x] configuration file `~/.sonos.json` to setup which `roomName` you want to use\n- [ ] fix Alfred path so we don't need the `~/bin/` symlink\n- [ ] TODO allow `roomName:*` all vs. configured `roomName`\n- [ ] TODO allow `roomName:first` \"get first\" vs. configured `roomName`\n- [ ] TODO autoconfigure: look for all, prompt selection, cache\n\n## Thanks\n\nA big thanks to the Sonos API implementation Lib I'm using:\n\nhttps://github.com/bencevans/node-sonos\n\n## Install\n\n```\n$ npm install sonos-simple-cli -g\n```\n\nIf you want to use Alfred Workflow - it has path problems which I'm currently\nsolving with an explicit symlink *(something more elegant coming)*\n\n```\ncd ~\nmkdir bin\ncd bin\nln -s $(which sonos-simple-cli) sonos-simple-cli\n```\n\n### Development / Manual Install\n\nif for some reason, you want to develop on this and play with it,\nhere's a guide which shuld get you setup and functional pretty easily.\n\n```\ncd ~\nmkdir bin\ngit clone https://github.com/zeroasterisk/sonos-simple-cli.git sonos-simple-cli-repo\nln -s sonos-simple-cli-repo/sonos.js sonos-simple-cli\ncd sonos-simple-cli-repo\nnpm install\n```\n\n## Configure\n\nYou must specify a `roomName` for this to work.\n\n*The theory being that you could use control different `roomName` \"groups\" in\nisolation.  It's also useful to only pause/play the music playing where you are\nvs. the whole network.*\n\nAll we need is the `roomName` as a string:\n\n```\necho '{\"roomName\": \"My Controller Room Here\"}' \u003e ~/.sonos.json\n```\n\neg: `cat ~/.sonos.json` should look like `{\"roomName\":\"Living Room\"}`\n\n\n## Manual Script Running\n\n```\n$ node ~/bin/sonos.js help\n-----------------------------\n----- Sonos Simple CLI ------\n-----------------------------\nsonos-simple-cli playpause\nsonos-simple-cli play\nsonos-simple-cli pause\nsonos-simple-cli next\nsonos-simple-cli prev\nsonos-simple-cli volup\nsonos-simple-cli voldown\nsonos-simple-cli mute\nsonos-simple-cli unmute\nsonos-simple-cli mutetoggle\nsonos-simple-cli clearCache\n-----------------------------\n\n$ ~/bin/sonos-simple-cli playpause\n  \u003e SONOS set to PAUSED\n  Beastie Boys \"I Don't Know\"\n    @ 58/180 sec\n```\n\n## Configure for Alfred\n\nInstall [Alfred](http://www.alfredapp.com/) *if not already installed*.\n\nTo get the workflow, just double-click on `sonos-simple-cli.alfredworkflow` and\ninstall it.\n\n\u003e You will recognise Alfred workflows by their .alfredworkflow file extension and their icon.\n\u003e\n\u003e To install a workflow, simply double-click the workflow file on your Mac. Alfred will show you a preview of the name and description of the workflow as well as the details for the developer, if available. Click the \"Import\" button to add the workflow to the sidebar on the left.\n\nhttp://support.alfredapp.com/workflows:installing/\n\n* CMD+F7 -\u003e prev\n* CMD+F8 -\u003e play/pause\n* CMD+F9 -\u003e next\n* CMD+F10 -\u003e mutetoggle\n* CMD+F11 -\u003e volume down\n* CMD+F12 -\u003e volume up\n\n### Manual Setup in Alfred\n\n*here's how I created the Alfred Worflow*\n\nAlfred \u003e Workflows\n\nClick `+` (bottom left) to add a new Workflow\n\nClick `+` (top right) to add an `trigger \u003e hotkey`\n\nThen choose your hotkey and save.\n\nClick `+` (top right) to add an `action -\u003e run script`\n\nselect `/bin/bash` at the top, then enter the following\n\n    source ~/.profile\n    /usr/local/bin/node ~/bin/sonos.js pauseplay\n\n![ss](http://puu.sh/gY1g3/6b3971535b.png)\n\nthen click save.\n\nFinally, drag a line between them.\n\n![ss](http://puu.sh/gY1hB/33dd7b1162.png)\n\nBonus Points, output when done\n\nAdd an `output \u003e notification` and setup as follows\n\n![ss](http://puu.sh/gY211/4eaa413cdf.png)\n\nthen connect and you're all set\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroasterisk%2Fsonos-simple-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeroasterisk%2Fsonos-simple-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroasterisk%2Fsonos-simple-cli/lists"}