A convenient library for interacting with Cider's RPC.
Tip
Cider is a client for Apple Music that works on all major operating systems.
CiderGo is designed for developers looking to build applications that control your local Cider app. This library simplifies interactions with the Cider RPC, offering easy control over music playback.
This library currently support all functional endpoints.
Install CiderGo via go get
:
go get github.com/klosradieschen/cidergo
Make sure that the Cider RPC client is running under Settings -> Connectivity -> Websocket API.
Important
The library will not work when the API token isn't properly configured
Right under Websocket API option, you can see "Manage External Application Access to Cider". There, you can either create a new token for your application or disable tokens altogether, in which case the functions will work without using SetToken.
Here’s a basic example that retrieves the name of the currently playing song:
package main
import (
"fmt"
"github.com/klosradieschen/cidergo"
)
func main() {
cidergo.SetToken("your-token") // Remove this line if you disabled tokens
song, err := cidergo.CurrentSong()
if err != nil {
panic(err)
}
fmt.Println(song.Name) // Prints the name of the currently playing song
}
Warning
Some functions like SetShuffle do nothing in some cases, like when you are listening to a station. There is no error handling for it because Cider's API responses for these functions are always the same.
The Godoc documentation can be found on https://pkg.go.dev/github.com/klosradieschen/cidergo
The documentation for Cider's API can be found here
We welcome all contributions!
CiderGo is licensed under the MIT License. See the LICENSE file for more information.