Skip to content

Commit 534e306

Browse files
committed
Prepare public release
- Add MIT LICENSE and THIRD_PARTY_NOTICES.md with the SoCo license - Add CI: install, typecheck, build, run --help - package.json: license, author, repository, homepage, keywords - README: requirements, install from GitHub, disclaimer, license
1 parent 5f97378 commit 534e306

6 files changed

Lines changed: 126 additions & 14 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
check:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: oven-sh/setup-bun@v2
14+
with:
15+
bun-version: latest
16+
- run: bun install --frozen-lockfile
17+
- run: bun run typecheck
18+
- run: bun run build
19+
- run: ./dist/sonos --help

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Bun CLI for Sonos speakers in the local network, ported from SoCo.
44

55
## Live speakers
66

7-
The office speakers are live: people listen to them all day. Every command
8-
reaches real hardware.
7+
The speakers are live: people listen to them. Every command reaches real
8+
hardware.
99

1010
- Verify a change with read commands (`status`, `track`, `raw … Get…`,
1111
`ws … get…`) and `--dry-run`.

‎LICENSE‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Erik May
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎README.md‎

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,27 @@ with commands like [soco-cli](https://github.com/avantrec/soco-cli). It also
66
uses the local Sonos Control API (WebSocket) for favorites and live events.
77

88
No cloud account, no Python and no runtime dependencies are necessary.
9-
XML parsing uses `Bun.XML` (Bun 1.4 or newer).
109

1110
See [docs/PROTOCOL.md](docs/PROTOCOL.md) for how the protocols work.
1211

12+
## Requirements
13+
14+
- [Bun](https://bun.com) 1.4 or newer (uses `Bun.XML`)
15+
- The computer and the speakers in the same network
16+
- `say` (text to speech) needs macOS
17+
1318
## Install
1419

20+
```sh
21+
bun install -g github:erikmay/sonos-cli # installs the "sonos" command
22+
```
23+
24+
From a clone:
25+
1526
```sh
1627
bun install
1728
bun link # installs the "sonos" command
18-
# or build a single binary:
19-
bun run build # -> dist/sonos
29+
bun run build # or: a single binary in dist/sonos
2030
```
2131

2232
## Usage
@@ -87,3 +97,14 @@ Music library search, music service browsing (SMAPI), playlist editing,
8797
alarm editing, stereo pairs and home theater setup, playlists of local
8898
files (m3u, directories), and GENA event subscriptions (replaced by `watch`).
8999
Use `sonos raw` for UPnP actions without a command.
100+
101+
## Disclaimer
102+
103+
This project is not affiliated with or endorsed by Sonos, Inc. It uses the
104+
UPnP interface and the undocumented local Control API of the speakers. Sonos
105+
can change or close these interfaces with a firmware update.
106+
107+
## License
108+
109+
MIT, see [LICENSE](LICENSE). Parts are ported from SoCo (MIT), see
110+
[THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).

‎THIRD_PARTY_NOTICES.md‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Third-party notices
2+
3+
sonos-cli ports logic from [SoCo](https://github.com/SoCo/SoCo): the play
4+
mode and music source tables, the radio metadata template, the snapshot
5+
procedure, and the order of UPnP calls for playback, queue and grouping.
6+
SoCo is distributed under the following license:
7+
8+
```
9+
The MIT License (MIT)
10+
11+
Copyright (c) Rahim Sonawalla and individual contributors (see AUTHORS)
12+
13+
Permission is hereby granted, free of charge, to any person obtaining a copy
14+
of this software and associated documentation files (the "Software"), to deal
15+
in the Software without restriction, including without limitation the rights
16+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17+
copies of the Software, and to permit persons to whom the Software is
18+
furnished to do so, subject to the following conditions:
19+
20+
The above copyright notice and this permission notice shall be included in
21+
all copies or substantial portions of the Software.
22+
23+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29+
THE SOFTWARE.
30+
```
31+
32+
The command set follows [soco-cli](https://github.com/avantrec/soco-cli)
33+
(Apache License 2.0). No soco-cli code is included.

‎package.json‎

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,42 @@
11
{
22
"name": "sonos-cli",
33
"version": "0.1.0",
4-
"devDependencies": {
5-
"@types/bun": "latest"
4+
"description": "Control Sonos speakers in the local network (UPnP/SOAP and local Control API). A Bun port of the SoCo logic.",
5+
"keywords": [
6+
"sonos",
7+
"cli",
8+
"upnp",
9+
"soco",
10+
"bun",
11+
"smart-speaker"
12+
],
13+
"license": "MIT",
14+
"author": "Erik May",
15+
"homepage": "https://github.com/erikmay/sonos-cli#readme",
16+
"repository": {
17+
"type": "git",
18+
"url": "git+https://github.com/erikmay/sonos-cli.git"
619
},
7-
"peerDependencies": {
8-
"typescript": "^7"
20+
"bugs": {
21+
"url": "https://github.com/erikmay/sonos-cli/issues"
22+
},
23+
"type": "module",
24+
"private": true,
25+
"engines": {
26+
"bun": ">=1.4.0"
927
},
1028
"bin": {
1129
"sonos": "./src/cli.ts"
1230
},
13-
"description": "Control Sonos speakers in the local network (UPnP/SOAP and local Control API). A Bun port of the SoCo logic.",
14-
"private": true,
1531
"scripts": {
1632
"start": "bun src/cli.ts",
1733
"typecheck": "tsc --noEmit",
1834
"build": "bun build src/cli.ts --compile --outfile dist/sonos"
1935
},
20-
"type": "module",
21-
"engines": {
22-
"bun": ">=1.4.0"
36+
"devDependencies": {
37+
"@types/bun": "latest"
38+
},
39+
"peerDependencies": {
40+
"typescript": "^7"
2341
}
2442
}

0 commit comments

Comments
 (0)