[% pageicon = 'help' %] [% pagetitle = 'Command Line Interface' %] [% techinfo = '1' %] [% lefttoright = '1' %] [% PROCESS helpheader.html %]

Experts, jump directly to the command index

## Introduction

The SlimServer provides a command-line interface to the players via TCP/IP. After starting the server, commands and queries may be sent by connecting to a specific TCP/IP port. The server will reply echoing the request (for commands) or by returning the requested data (for queries). By default, the SlimServer will listen for connections on TCP/IP port 9090. This format is designed for ease of integration into AMX, Crestron and other automation systems.

The end of line separator is line feed (<LF> ASCII decimal 10, hexadecimal 0x0A). The server accepts LF, CR or 0x00 (or any combination thereof) as end of line, and replies with whatever was used for the command. For strings, SlimServer uses the UTF-8 charset. Some extended queries allow to return data in a different charset.

To use the command line interface interactively, use the telnet command from your system's command prompt: telnet localhost 9090 and when it connects, you can start typing commands. Beware that the server expects parameters to be encoded using percent-style escaping (see below); " and \ are not supported as in shell-like environments.

For debugging purposes, CLI formatted commands can be sent using standard in and out. This support is only available on Unix platforms (MacOS X included), and must be enabled by launching the server with the "--stdio" command line option.

#### Changes starting from SlimServer 6.5

The following syntax changes apply to the CLI in SlimServer 6.5. These changes may impact CLI clients.

- The Command Line Interface is now a plugin. It can be disabled if not used.
- The charset parameter now applies only to field values, and no longer to tags as well. See the charset notes.
- Changed "sync ?" to return "-" instead of nothing if the player is not synced. This is coherent with using "-" to unsync the player.
- Changed "sync" and "status" queries to return their list of synced players as comma-separated (instead of space-separated).
- Updated the "status" query to only return bass, treble and/or pitch information for players that supports it.
- Updated the "status" query to return the current song title for remote sources and to return the stored playlist information if appropriate.
- Command "mode <play|pause|stop>" is deprecated. Please use commands "play", "stop" and "pause". The query "mode ?" is not affected by this change.
- Query "playlisttracks" is deprecated and replaced by the "playlists tracks" query.

The following changes or new commands & queries are available starting with SlimServer 6.5. These changes should not have any impact on existing clients:

- Added the ability for plugins to define CLI commands and queries. In particular, all Internet Radio plugins now have CLI support, along with a convienent "radios" query. Please refer to Plugins section.
- Added the "can" query, useful to determine if a certain command or query is available
- Added the "client forget" command.
- Added the "alarms" extended query and its companion the "alarm" extended command.
- Added the "shutdown" command.
- Added the "subscribe" command.
- Added the "remote" and "playlist remote" queries. Likewise, added the "remote" field to the status", titles", playlists tracks" and songinfo" queries.
- Added the "current_title" query. Likewise, added the "current_title" field to the status" query.
- Added the "show" command.
- Added the "search" query.
- Added the "subscribe" parameter to the "status" query.
- Added the "playlists edit", "playlists rename", and "playlists delete" command to manipulate stored playlists.
- Added the "playlist playlistsinfo" query to return information on the stored playlist currently playing, including its id.
- Updated command "playlistcontrol" to accept a list of comma-separated track_ids as parameter as well as a playlist name. Tracks are played in the given order.
- Updated query "albums" to return additional information about albums (year, artwork_track, etc), including the ability to sort the list by "new" (to replicate the "New Music" web GUI browse mode). Also added the ability to filter the list by "year" and "track_id".
- Updated query "artists" to return the "Various Artists" pseudo-artist. Also added the ability to filter the list by "year" and "track_id".
- Updated queries status", titles", playlists tracks" and songinfo" to return lyrics.
- Updates queries "titles" and "genres" to accept a year as a filter criteria.
- Updated the CLI for the latest player model, Transporter. Queries "player model ?" and "players" return "transporter" for Transporters.
  See also the notes for information about management of Transporter digital inputs.
- 0x00 is now a valid end of line / command separator. In addition, the server replies with whatever combination of CR, LF and 0x00 was used in the query.
- Documented correctly system support for "mixer bass", "mixer treble" and "mixer pitch". These 3 options are not (yet) supported on the most recent players. Pitch is only supported by Squeezebox1 players; bass and treble are supported by SliMP3 and Squeezebox1 players.
- Changed "mixer muting" to be coherent with other commands. There is now a query mode "mixer muting ?", and parameters 1 or 0 are accepted.
- Added a note about paths and urls being double URL encoded and in the filesystem character set.
- Added a Deprecated commands section.
- Added a Notifications section to describe some echoed commands available when using commands "listen" or "subscribe".
- Updated the "status" query to return correct information in case the player is a remote streaming connection.

#### Changes starting from SlimServer 6.2

The following changes or new commands are available starting with SlimServer 6.2:

- Changed "playlists" command to return IDs for playlists. The new "playlists tracks" query returns the playlist tracks. Finally, command "playlistcontrol" now accepts a playlist_id parameter.
- Added optional "charset" parameter to all extended queries, allowing them to return data in something different than utf8. See the charset notes.
- Changed "rescan" command to enable rescanning only the playlists.
- "listen" now supports a query mode: "listen ?".

### Command format

#### General command and query format

The format of the commands, queries and server replies is as follows:

> `[<playerid>] <p0> <p1> ... <pN> <LF>`

where:

> `<playerid>` is the unique identifier for the player, usually (but not guaranteed to be) the MAC address of the player. Some commands are global to the SlimServer and do not require a `<playerid>`. For commands requiring it, a random player will be selected by the SlimServer if the `<playerid>` is omitted, and returned in the server reply. `<playerid>` may be obtained by using the "player id" or "players" queries.

> `<p0>` through `<pN>` are positional parameters. Pass a "?" to obtain a value for that parameter in the SlimServer response (i.e. send a query). Details of the parameters vary for each command as described below.

Each parameter needs to be encoded using percent-style escaping, the same method as is used in URLs; for example, "The Clash?" would be encoded as "The%20Clash%3F". This also applies to `<playerid>`. In the examples below, the escaping is not show for readability (except %20 for space).

#### Extended query format

A few extended queries are defined, to regroup multiple queries and allow browsing the server database. These queries return multiple items. Overall however, their format is compliant with the general command format above:

> `[<playerid>] <command> <start> <itemsPerResponse> <p3> ... <pN> <LF>`

where:

> `<playerid>` is the unique identifier for the player, as above.

> `<command>` is the query name.

> `<start>` and `<itemsPerResponse>` are positional parameters that control the response chunking. `<start>` is a zero-based index of the first item to return, and `<itemsPerResponse>` is the number of items to return, if possible.

> `<p3>` through `<pN>` are tagged parameters. Tags consist of a name followed by ":". For example, "artist:Abba". The tag and the ":" are URL escaped with the field value. Tag names cannot contain ":" but the data can.

to which the server replies:

> `[<playerid>] <command> <start> <itemsPerResponse> <p3> ... <pN> <pN+1> ... <pM> <LF>`

where:

> The entire query is repeated.

> `<pN+1>` through `<pM>` is the tagged returned data. A special tag value is defined in each command to separate the multiple returned items. Data is only returned when applicable, that is, all possible tags are not always returned.

Example: The "players" command returns data on all players known by the server. It is a shortcut call compared to the general CLI API "player count ?" followed by a number of calls to get the players name, ID, etc. The command must be called with the chunking parameters. For example, the following returns information on the first 10 players known by the server (if so many exist), starting from the first one:

> Request: "players 0 2<LF>"
> Response: "players 0 2 count:2 playerindex:0 playerid:a5:41:d2:cd:cd:05 ip:127.0.0.1:60488 name:127.0.0.1 model:softsqueeze displaytype:graphic-280x16 connected:1 playerindex:1 playerid:00:04:20:02:00:c8 ip:192.168.1.22:3483 name:Movy model:slimp3 displaytype:noritake-katakana connected:1<LF>"

#### Extended command format

Extended commands are commands that reuse the general principle of tagged parameters as introduced by extended queries:

> `[<playerid>] <command> <p1> ... <pN> <LF>`

where:

> `<playerid>` is the unique identifier for the player, as above.

> `<command>` is the command name.

> `<p1>` through `<pN>` are tagged parameters as defined above.

The server performs the command and returns:

> `[<playerid>] <command> <p1> ... <pN> <pN+1> ... <pM> <LF>`

where:

> The entire query is repeated.

> `<pN+1>` through `<pM>` is the tagged returned data. See the command description for definitions. In general commands do return some information about the command performed.

### Notes

- The Security settings of the SlimServer preferences apply to CLI connections when they are established. A change in security settings do not affect established connections. The connection is only accepted from allowed hosts. If password protection is enabled, the "login" command must be the first command sent after the connection. Any error in the user and/or password, or using any other command as the first one, results in the server disconnecting.

- All SlimServer preferences apply to the CLI data. For examples, the preference about composers appearing in the artists list applies to the data returned by the "artists" query.

- Commands that use paths to songs or playlists (`<item>` parameters below) can use relative paths from the root of the Music Library folder to specify songs. For example, if the Music Library is specified as "D:\mymusic" and you'd like to refer to a song in that folder named "foo.mp3" you can specify just "foo.mp3" in the command parameter. Likewise, to refer to items in the Saved Playlist folder, you can use a prefix of "__playlists/" before the path. For example, to refer to the saved playlist "bar.m3u" in the Saved Playlists folder, you can specify a path of "__playlists/bar.m3u".

- The HTTP server can return cover art for songs using the track ID as returned by the CLI functions. If no cover art exists for the given song, the server returns special "no artwork" image. Please refer to the Artwork Setup documentation for more details on artwork management in SlimServer. Use the following URLs:

  > `http://<server>:<port>/music/<track_id>/cover.jpg`
  > `http://<server>:<port>/music/<track_id>/thumb.jpg`

  where:

  > `<server>` is the ip address or name of the server.
  > `<port>` is the HTTP port of the server (not the same as the CLI port).
  > `<track_id>` is the track ID as returned by the CLI functions.

  In addition, there is a shortcut URL to return the artwork of the currently playing song for a player:

  > `http://<server>:<port>/music/current/cover.jpg?player=<playerid>`
  > `http://<server>:<port>/music/current/thumb.jpg?player=<playerid>`

  where:

  > `<server>` is the ip address or name of the server.
  > `<port>` is the HTTP port of the server (not the same as the CLI port).
  > `<playerid>` is the unique identifier for the player, as above. If omitted, the server will use a random player.

- For commands using positional parameters, any extra parameters (after all required ones) will be returned. For commands using tagged parameters, parameters using unknown tags will be returned as well. This allows the client to add to commands and queries some context information. For example:

  > Request: "04:20:00:12:23:45 mixer bass ? context<LF>"
  > Response: "04:20:00:12:23:45 mixer bass 98 context<LF>"

  > Request: "players 0 2 context:1<LF>"
  > Response: "players 0 2 context:1 count:2 id:00:04:20:02:00:c8 ...(same as above)"

- Extended queries accepting the "charset" parameter normally return field values in utf8, Perl's lenient version of UTF-8. The value of this parameter is sent as is to Perl's Encode plumbing. As a consequence, any encoding known to Perl is valid, for example "iso-8859-1" (the web standard), "cp437" (MS-DOS), etc. More exotic choices like "UTF-16" or "shiftjis" are possible. Note that the server will crash if the encoding is unknown.
- All paths and URLs, for example the ones returned by the query "songinfo" are double URL escaped. To get a useable path (that you can use with your file system), you will need to unescape the field twice. Also note the URLs are not translated into Unicode (or into any other charset requested).
- Transporter Digital Inputs
  Transporter Digital Inputs are handled as remote streams, with a URL starting with `source:` followed by "aes-ebu", "bnc-spdif", "toslink" or "rca-spdif".
  To set Transporter to the TOSLINK input, use "<playerid> playlist play source:toslink<LF>".
  When set to a digital input, Transporter reports the URL scheme above to the various path, url or status queries.

### Supported Commands

The supported commands are listed below, grouped by their scope:

- General: commands for general management of the server.
- Players: commands to manage and get information on players.
- Database: commands to manage and browse the music database.
- Playlist: commands to get information on and manage the playlist for each player.
- Notifications: internal server commands echoed to the CLI by using the "listen" or "subscribe" commands.
- Plugins: commands and queries proposed by various SlimServer plugins. These are only available if the plugin is enabled in the SlimServer configuration. The query "can" can be used to determine if a command or query is available.
- Deprecated: commands which are still available but not for much longer...

## General commands and queries

- `login`
- `can`
- `version`
- `listen`
- `subscribe`
- `pref`
- `debug`
- `exit`
- `shutdown`

`login <user> <password>`

The "login" command allows the caller to authenticate itself on the server, as defined in the Security pane of the SlimServer preferences. Like any other command, the user and password must be escaped. If successful, the server replaces the password with 6 star characters. If unsuccessful, the server disconnects. If security is off this command is always successful.

Examples:

> Request: "login user correctpassword<LF>"
> Response: "login user ******<LF>"

> Request: "login user wrongpassword<LF>"
> Response: (Connection terminated)

`can <request terms> ?`

The "can" query allows the caller to determine if the command or query indicated by <request terms> is available.

Examples:

> Request: "can info total genres ?<LF>"
> Response: "can info total genres 1<LF>"

> Request: "can smurf ?<LF>"
> Response: "can smurf 0<LF>"

`version`

The "version" query returns the server version number.<

Examples:

> Request: "version ?<LF>"
> Response: "version 6.5<LF>"

`listen <0|1|?>`

The "listen" command enables to receive asynchronously internal server commands (notifications) on the CLI connection. Notifications concern all activity in the SlimServer, not just the activity triggered by the command-line. Use 0 to clear, 1 to set, ? to query, and no parameter to toggle the listen state of the command-line connection.
If only certain notifications are of interrest, consider using the "subscribe" command below. The "listen" command shares some of its internal plumbing with "subscribe" so using "subscribe xxx" changes the list of echoed notifications from nothing or everything to only xxx.
Please consult section Notifications for a list of possible notifications.

Examples:

> Request: "listen 1<LF>"
> Response: "listen 1<LF>"
> "04:20:00:12:23:45 mixer volume 25<LF>"
> "04:20:00:12:23:45 pause<LF>"
> ...

`subscribe <comma_separated_notification_list>`

The "subscribe" command is similar to "listen" but echoes only a subset of the notifications, indicated by a comma separated list. If no list is provided, the notifications are turned off. This command shares some of its internal plumbing with "listen" so using "listen 0" or "listen 1" changes the list of echoed notifications (to nothing and everything, respectively).
Please consult section Notifications for a list of possible notifications.

Examples:

> Request: "subscribe mixer,pause<LF>"
> Response: "subscribe mixer,pause<LF>"
> "04:20:00:12:23:45 mixer volume 25<LF>"
> "04:20:00:12:23:45 pause<LF>"
> ...

`pref <prefname> <prefvalue|?>`

The "pref" command allows the caller to set and query the SlimServer's internal preference values. The following affect the behaviour of CLI queries and commands:

- authorize: Security enabled or not. If enabled, usage of the "login" command is required.
- groupdiscs: handling of multiple disc sets. Affects the "albums" query.
- variousArtistAutoIdentification: compilation artists are listed as "Various Artists". Affects the "artists" query.
- splitList: delimiter for multiple items in tags. Affects the "genres" query.
- composerInArtists, conductorInArtists, bandInArtists: contributors considered artists. Affects the "info total artists ?" query.

Examples:

> Request: "pref audiodir ?<LF>"
> Response: "pref audiodir %2fUsers%2fdean%2fDesktop%2ftest%20music<LF>"

> Request: "pref playlistdir %2fUsers%2fdean%2fplaylists<LF>"
> Response: "pref playlistdir %2fUsers%2fdean%2fplaylists<LF>"

`debug <debugflag> <0|1|?|>`

The "debug" command allows the caller to query, clear, set or toggle the server's internal debug flags. Use 0 to clear, 1 to set, ? to query and no parameter to toggle the debug flag value.

Examples:

> Request: "debug d_files ?<LF>"
> Response: "debug d_files 0<LF>"

> Request: "debug d_itunes 0<LF>"
> Response: "debug d_itunes 0<LF>"

> Request: "debug d_stream 1<LF>"
> Response: "debug d_stream 1<LF>"

> Request: "debug d_stream<LF>"
> Response: "debug d_stream 0<LF>"

`exit`

The "exit" command closes the TCP connection with the server.

Example:

> Request: "exit<LF>"
> Response: "exit<LF>"
> (Connection terminated)

`shutdown`

The "shutdown" command shuts down the server. The CLI connection is terminated. Note that, obviously, there is no symmetrical command to restart the server.

Example:

> Request: "shutdown<LF>"
> Response: "shutdown<LF>"
> (Connection terminated)

## Players commands and queries

- `player count ?`
- `player id ?`
- `player name ?`
- `player ip ?`
- `player model ?`
- `player displaytype ?`
- `signalstrength ?`
- `connected ?`
- `sleep`
- `sync`
- `power`
- `mixer volume`
- `mixer muting`
- `mixer bass`
- `mixer treble`
- `mixer pitch`
- `rate`
- `show`
- `display`
- `linesperscreen`
- `display ? ?`
- `displaynow ? ?`
- `playerpref`
- `button`
- `ir`
- `client forget`
- `players`
- `alarm`
- `alarms`

`player count ?`

The "player count ?" query returns the number of players connected to the server.

Example:

> Request: "player count ?<LF>"
> Response: "player count 2<LF>"

`player id <playerindex> ?`

The "player id ?" query returns the unique identifier of a player, (<playerid> parameter of many CLI commands). For physical players this is generally the MAC address. The IP address is used for remote streams.

Example:

> Request: "player id 0 ?<LF>"
> Response: "player id 0 04:20:00:12:23:45<LF>"

`player name <playerindex|playerid> ?`

The "player name ?" query returns the human-readable name for the specified player. If the name has not been specified by the user in the Player Settings, then a default name will be used, usually the IP address.

Example:

> Request: "player name 0 ?<LF>"
> Response: "player name 0 Living Room<LF>"

`player ip <playerindex|playerid> ?`

The "player ip ?" query returns the IP address (along with port number) of the specified player.

Example:

> Request: "player ip 0 ?<LF>"
> Response: "player ip 0 192.168.1.22:3483<LF>"

`player model <playerindex|playerid> ?`

The "player model ?" query returns the model of the player, currently one of "transporter", "squeezebox2", "squeezebox", "slimp3", "softsqueeze", or "http" (for remote streaming connections).

Example:

> Request: "player model 0 ?<LF>"
> Response: "player model squeezebox<LF>"

`player displaytype <playerindex|playerid> ?`

The "player displaytype ?" query returns the display model of the player. Graphical display types start with "graphic-", non-graphical display type with "noritake-".

Example:

> Request: "player displaytype 0 ?<LF>"
> Response: "player displaytype 0 noritake-katakana<LF>"

`<playerid> signalstrength ?`

Returns the wireless signal strength for the player, range is 1 to 100. Returns 0 if not connected wirelessly.

Example:

> Request: "04:20:00:12:23:45 signalstrength ?<LF>"
> Response: "04:20:00:12:23:45 signalstrength 76<LF>"

`<playerid> connected ?`

Returns the connected state of the player, 1 or 0 depending on the state of the TCP connection to the player. SLIMP3 players, since they use UDP, always return 1.

Examples:

> Request: "04:20:00:12:23:45 connected ?<LF>"
> Response: "04:20:00:12:23:45 connected 1<LF>"

`<playerid> sleep <number|?>`

The "sleep" command specifies a number of seconds to continue playing before powering off the player. You may query the amount of time until the player sleeps by passing in "?".

Examples:

> Request: "04:20:00:12:23:45 sleep ?<LF>"
> Response: "04:20:00:12:23:45 sleep 105.3<LF>"

> Request: "04:20:00:12:23:45 sleep 300<LF>"
> Response: "04:20:00:12:23:45 sleep 300<LF>"

`<playerid> sync <playerindex|playerid|-|?>`

The "sync" command specifies the player to synchronise with the given playerid. The command accepts only one playerindex or playerid. To unsync the player, use the "-" parameter.
You may query which players are already synced with this player by passing in a "?" parameter. Multiple playerids are separated by a comma. If the player is not synced, "-" is returned.

Examples:

> Request: "04:20:00:12:23:45 sync 1<LF>"
> Response: "04:20:00:12:23:45 sync 1<LF>"

> Request: "04:20:00:12:23:45 sync ?<LF>"
> Response: "04:20:00:12:23:45 sync 04:20:00:12:23:21<LF>"

> Request: "04:20:00:12:23:45 sync -<LF>"
> Response: "04:20:00:12:23:45 sync -<LF>"

`<playerid> power <0|1|?|>`

The "power" command turns the player on or off. Use 0 to turn off, 1 to turn on, ? to query and no parameter to toggle the power state of the player.
For remote streaming connections, the command does nothing and the query always returns 1.

Examples:

> Request: "04:20:00:12:23:45 power 1<LF>"
> Response: "04:20:00:12:23:45 power 1<LF>"

> Request: "04:20:00:12:23:45 power ?<LF>"
> Response: "04:20:00:12:23:45 power 1<LF>"

`<playerid> mixer volume <0 .. 100|-100 .. +100|?>`

The "mixer volume" command returns or sets the current volume setting for the player. The scale is 0 to 100, in real numbers (i.e. 34.5 is valid). If the player is muted, the volume is returned as a negative value. Note that players display a 0 to 40 scale, that is, the 0..100 volume divided by 2,5. Likewise, using the "button" command with "volume_up" or "volume_down" parameters increases or decreases the volume by 2,5.

Examples:

> Request: "04:20:00:12:23:45 mixer volume ?<LF>"
> Response: "04:20:00:12:23:45 mixer volume 98<LF>"

> Request: "04:20:00:12:23:45 mixer volume 25<LF>"
> Response: "04:20:00:12:23:45 mixer volume 25<LF>"

> Request: "04:20:00:12:23:45 mixer volume +10<LF>"
> Response: "04:20:00:12:23:45 mixer volume +10<LF>"

`<playerid> mixer muting <0|1|?|>`

The "mixer muting" command mutes or unmutes the player. Use 0 to unmute, 1 to mute, ? to query and no parameter to toggle the muting state of the player. Note also the "mixer volume" command returns a negative value if the player is muted.

Example:

> Request: "04:20:00:12:23:45 mixer muting<LF>"
> Response: "04:20:00:12:23:45 mixer muting<LF>"

`<playerid> mixer bass <0 .. 100|-100 .. +100|?>`

The "mixer bass" command returns or sets the current bass setting for the player. This is only supported by SliMP3 and SqueezeBox (SB1) players. For more information on the 0 to 100 scale, please refer to the "mixer volume" command.

Example:

> Request: "04:20:00:12:23:45 mixer bass ?<LF>"
> Response: "04:20:00:12:23:45 mixer bass 98<LF>"

> Request: "04:20:00:12:23:45 mixer bass 25<LF>"
> Response: "04:20:00:12:23:45 mixer bass 25<LF>"

> Request: "04:20:00:12:23:45 mixer bass +10<LF>"
> Response: "04:20:00:12:23:45 mixer bass +10<LF>"

`<playerid> mixer treble <0 .. 100|-100 .. +100|?>`

The "mixer treble" command returns or sets the current treble setting for the player. This is only supported by SliMP3 and SqueezeBox (SB1) players. For more information on the 0 to 100 scale, please refer to the "mixer volume" command.

Example:

> Request: "04:20:00:12:23:45 mixer treble ?<LF>"
> Response: "04:20:00:12:23:45 mixer treble 98<LF>"

> Request: "04:20:00:12:23:45 mixer treble 25<LF>"
> Response: "04:20:00:12:23:45 mixer treble 25<LF>"

> Request: "04:20:00:12:23:45 mixer treble +10<LF>"
> Response: "04:20:00:12:23:45 mixer treble +10<LF>"

`<playerid> mixer pitch <80 .. 120|-40 .. +40|?>`

The "mixer pitch" command returns or sets the current pitch setting for the player (only supported by SqueezeBox (SB1) players).

Example:

> Request: "04:20:00:12:23:45 mixer pitch ?<LF>"
> Response: "04:20:00:12:23:45 mixer pitch 98<LF>"

> Request: "04:20:00:12:23:45 mixer pitch 80<LF>"
> Response: "04:20:00:12:23:45 mixer pitch 80<LF>"

> Request: "04:20:00:12:23:45 mixer pitch +10<LF>"
> Response: "04:20:00:12:23:45 mixer pitch +10<LF>"

`<playerid> rate <rate|?>`

The "rate" command returns or sets the current play rate for the player. 1 is normal, 2 is 2x fast forward, 0 is paused, -1 is rewind, etc.

Example:

> Request: "04:20:00:12:23:45 rate ?<LF>"
> Response: "04:20:00:12:23:45 rate 1<LF>"

> Request: "04:20:00:12:23:45 rate -4<LF>"
> Response: "04:20:00:12:23:45 rate -4<LF>"

`<playerid> show <taggedParameters>`

The "show" command displays a message on the player display for a given duration. Various options are provided to customize the appearance of the message (font size, centering). If the mesage is too long to fit on the display, it scrolls.
This command is designed to display the message, and by default temporarily cancels any screensaver and increases the brightness to the maximum value.
This command is only echoed once the message display is done.
Please note the CLI expects parameters to be encoded using percent-style escaping (see above): space is represented by "%20". See the examples.

Accepted tagged parameters:

Tag | Description
line1 | First line of the display.
line2 | Second line of the display. This is the line used for single line display mode (font = huge).
duration | Time in seconds to display the message; this time does not take into account any scrolling time necessary, which will be performed to its completion. The default is 3 seconds.
brightness | Brightness to use to display the message, either 'powerOn', 'powerOff', 'idle' or a value from 0 to 4. The default value is 4. The display brightness is reset to its configured value after the message.
font | Use value "huge" to have line2 displayed on a large font using the entire display. The actual font used depends on the player model. Otherwise the command uses the standard, 2 lines display font.
centered | Use value "1" to center the lines on the display. There is no scrolling in centered mode.
charset | Character set to use for the data. See charset notes above.

Examples:

> Request: "04:20:00:12:23:45 show line1:Hello%20World line2:Second%20line duration:1 centered:1<LF>"
> Response: "04:20:00:12:23:45 show line1:Hello%20World line2:Second%20line duration:1 centered:1<LF>"

`<playerid> display <line1> <line2> <duration>`

The "display" command specifies some text to be displayed on the player screen for a specified amount of time (in seconds). Please note the CLI expects parameters to be encoded using percent-style escaping (see above): space is represented by "%20". See the examples.

Examples:

> Request: "04:20:00:12:23:45 display Hello World 5<LF>"
> Response: "04:20:00:12:23:45 display Hello World 5<LF>"

> Request: "04:20:00:12:23:45 display Hello%20World Second%20Line 5<LF>"
> Response: "04:20:00:12:23:45 display Hello%20World Second%20Line 5<LF>"

`<playerid> linesperscreen ?`

The "linesperscreen" command returns how many lines of text can fit in the display, depending on its current setting or font.

Examples:

> Request: "04:20:00:12:23:45 linesperscreen ?<LF>"
> Response: "04:20:00:12:23:45 linesperscreen 1<LF>"

`<playerid> display ? ?`

The "display ? ?" command may be used to obtain the text that is currently displayed on the screen.

Examples:

> Request: "04:20:00:12:23:45 display ? ?<LF>"
> Response: "04:20:00:12:23:45 display Hello World<LF>"

`<playerid> displaynow ? ?`

The "displaynow" command provides access to the data currently on the display. This differs from the "display ? ?" command in that it returns the latest data sent to the display, including any animation, double-size fonts, etc...

Examples:

> Request: "04:20:00:12:23:45 displaynow ? ?<LF>"
> Response: "04:20:00:12:23:45 display Hello World<LF>"

`<playerid> playerpref <prefname> <prefvalue|?>`

The "playerpref" command allows the caller to set and query the SlimServer's internal player-specific preferences values.

Examples:

> Request: "04:20:00:12:23:45 playerpref doublesize ?"
> Response: "04:20:00:12:23:45 playerpref doublesize 1"

> Request: "04:20:00:12:23:45 playerpref doublesize 0"
> Response: "04:20:00:12:23:45 playerpref doublesize 0"

`<playerid> button <buttoncode>`

The "button" command simulates a button press. Valid button codes correspond to the functions defined in the Default.map file.

Example:

> Request: "04:20:00:12:23:45 button stop<LF>"
> Response: "04:20:00:12:23:45 button stop<LF>"

`<playerid> ir <ircode> <time>`

The "ir" command simulates an IR code. Valid IR codes are defined in the Default.map file.

Example:

> Request: "bd:a5:a9:9b:9d:df ir 768910ef 11073.575<LF>"
> Response: "bd:a5:a9:9b:9d:df ir 768910ef 11073.575<LF>"

`<playerid> client forget`

The "client forget" command deletes the client/player from the server database.

Example:

> Request: "bd:a5:a9:9b:9d:df client forget<LF>"
> Response: "bd:a5:a9:9b:9d:df client forget<LF>"

`players <start> <itemsPerResponse>`

The "players" query returns information about all "players" (physical players as well as streaming clients) known by the SlimServer.

Accepted tagged parameters:

Tag | Description
charset | Character set to use to return data. See charset notes above.

Returned tagged parameters:

Tag | Description
count | Number of players known by SlimServer. Equivalent to "player count ?".
For each player: |
playerindex | Player index. Item delimiter.
playerid | Player unique identifier. Equivalent to "player id ?".
ip | Player IP and port. Equivalent to "player ip ?".
name | Player name. Equivalent to "player name ?".
model | Player model. Equivalent to "player model ?".
displaytype | Player display type. Not returned for streaming connections. Equivalent to "player displaytype <playerindex> ?".
connected | Connected state. Equivalent to "<playerid> connected ?".

Example:

> Request: "players 0 2<LF>"
> Response: "players 0 2 count:2 playerindex:0 playerid:a5:41:d2:cd:cd:05 ip:127.0.0.1:60488 name:127.0.0.1 model:softsqueeze displaytype:graphic-280x16 connected:1 playerindex:1 playerid:00:04:20:02:00:c8 ip:192.168.1.22:3483 name:Movy model:slimp3 displaytype:noritake-katakana connected:1 <LF>"

`<playerid> alarm <taggedParameters>`

The "alarm" command allows to manipulate player alarms.

Accepted tagged parameters:

Tag | Description

cmd

Mandatory parameter, one of "clear", "set" or "update". Use "clear" to reset all parameters of the alarm for the day "dow" to their standard values (disabled alarm, no playlist, volume 50, 12:00AM). Use "set" to change the parameters of the alarm, starting from a standard one as defined above. Use "update" to change the parameters of the alarm, starting from the alarm as currently defined. If all alarm parameters are provided, there is no difference between "set" and "update". But if the caller just wants to enable or disable an alarm already defined, using "update" allows to provide just the "enable" parameter, the other parameters being taken from the currently defined alarm (see the example below).

dow | Mandatory. Day Of Week to "clear", "set" or "update". 0 is every day, 1 is Monday, etc. up to 7 being Sunday.
enabled | Optional, 1 if the alarm is enabled.
time | Optional, time of the alarm, in seconds from midnight.
volume | Optional, mixer volume of the alarm.
url | Optional, URL of the alarm playlist, or one of "CURRENT_PLAYLIST", "PLUGIN_RANDOM_TRACK", "PLUGIN_RANDOM_ALBUM", or "PLUGIN_RANDOM_CONTRIBUTOR". This takes precedence over "playlist_id" if both are provided; the recommended procedure is to use "url" or "playlist_id". when defining alarms.
playlist_id | Optional, Playlist ID of the alarm playlist (use the "url" parameter to set a special playlist).
fade | Optional. If set to 1, the alarms fade in. This is a global setting for all alarms. The parameter can only be changed along with an alarm "set" or "update".

Returned tagged parameters:

Tag | Description
count | 1 if the command succeeded changing the alarm.

Examples:

> Defining a new alarm
> Request: "bd:a5:a9:9b:9d:df alarm cmd:set dow:1 enabled:1 playlist_id:22 time:9000<LF>"
> Response: "bd:a5:a9:9b:9d:df alarm cmd:update dow:1 enabled:1 playlist_id:22 time:9000 count:1<LF>"

> Clearing an alarm
> Request: "bd:a5:a9:9b:9d:df alarm cmd:clear dow:1<LF>"
> Response: "bd:a5:a9:9b:9d:df alarm cmd:update dow:1 count:1 <LF>"

> Enabling a previously defined alarm
> Request: "bd:a5:a9:9b:9d:df alarm cmd:update dow:1 enabled:1<LF>"
> Response: "bd:a5:a9:9b:9d:df alarm cmd:update dow:1 enabled:1 count:1 <LF>"

`<playerid> alarms <start> <itemsPerResponse> <taggedParameters>`

The "alarms" query returns information about player alarms.

Accepted tagged parameters:

Tag | Description
dow | If present, the query returns information about this Day Of Week only. Note this takes precedence over any "filter" parameter. 0 is every day, 1 is Monday, etc. up to 7 being Sunday.
filter | One of "all", "defined" or "enabled" (the default). To get all 8 possible alarms, use "all". To get only alarms with defined values (different than the default values), use "defined". To get only enabled alarms, use "enabled"
charset | Character set to use to return data. See charset notes above.

Returned tagged parameters:

Tag | Description
fade | 1 if the alarms fade in.
count | Number of alarms returned, based on the filters above.
For each alarm: |
dow | Day Of Week of this alarm. Item delimiter.
enabled | 1 if the alarm is enabled.
time | Time of the alarm, in seconds from midnight.
volume | Mixer volume of the alarm.
url | URL of the alarm playlist, or one of "CURRENT_PLAYLIST", "PLUGIN_RANDOM_TRACK", "PLUGIN_RANDOM_ALBUM", or "PLUGIN_RANDOM_ARTIST".
playlist_id | Playlist ID of the alarm playlist or -1, -2, -3 or -4 for the special playlists (respectively as defined in the "url" parameter).

Example:

> Request: "bd:a5:a9:9b:9d:df alarms 0 3<LF>"
> Response: "bd:a5:a9:9b:9d:df alarms 0 3 count:2 fade:0 dow:1 enabled:1 time:3600 volume:50 playlist url:PLUGIN_RANDOM_TRACK dow:5 enabled:1 time:81000 volume:77 playlist url:file:///Volumes/Smurf/playlists/Playlists/AAA.m3u <LF>"

## Database commands and queries

- `rescan`
- `wipecache`
- `info total genres ?`
- `info total artists ?`
- `info total albums ?`
- `info total songs ?`
- `genres`
- `artists`
- `albums`
- `playlists`
- `playlists tracks`
- `playlists rename`
- `playlists delete`
- `playlists edit`
- `songinfo`
- `titles`
- `search`
- Favorites

`rescan <|playlists|?>`

The "rescan" command causes SlimServer to rescan the entire music library, reloading the music file information. If "playlists" is indicated ("rescan playlists"), only the playlist directory is rescanned. Issued with a "?", "rescan ?" returns if the SlimServer is currently scanning. Scanning occurs when SlimServer starts and following "rescan" and "wipecache" commands.

Examples:

> Request: "rescan<LF>"
> Response: "rescan<LF>"

> Request: "rescan ?<LF>"
> Response: "rescan 1<LF>"

`wipecache`

The "wipecache" command allows the caller to have the SlimServer rescan its music library, reloading the music file information. This differs from the "rescan" command in that it first clears the tag database. During a rescan triggered by "wipecache", "rescan ?" returns true.

Examples:

> Request: "wipecache<LF>"
> Response: "wipecache<LF>"

`info total genres ?`

The "info total genres ?" query returns the number of unique genres in the server music database.

Examples:

> Request: "info total genres ?<LF>"
> Response: "info total genres 18<LF>"

`info total artists ?`

The "info total artists ?" query returns the number of unique artists in the server music database. The "Composer, band and orchestra in artists" preference (Server Settings, Behavior) determines which contributors are considered artists.

Examples:

> Request: "info total artists ?<LF>"
> Response: "info total artists 18<LF>"

`info total albums ?`

The "info total albums ?" query returns the number of unique albums in the server music database.

Examples:

> Request: "info total albums ?<LF>"
> Response: "info total albums 18<LF>"

`info total songs ?`

The "info total songs ?" query returns the number of unique songs in the server music database.

Examples:

> Request: "info total songs ?<LF>"
> Response: "info total songs 18<LF>"

`genres <start> <itemsPerResponse> <taggedParameters>`

The "genres" query returns all genres known by the server.
Note that the server supports multiple genres per track, depending on the "Multiple items in tags" preference (Server Settings, Behavior).

Accepted tagged parameters:

Tag | Description
search | Search string. The search is case insensitive and obeys the "Search Within Words" server parameter.
artist_id | Limit results to those genres proposed by the artist identified by "artist_id".
album_id | Limit results to those genres available on the album identified by "album_id".
track_id | Limit results to the genres of the track identified by "track_id". If present, other filters are ignored.
year | Limit results to the genres of the tracks of the given "year".
charset | Character set to use to return data. See charset notes above.

Returned tagged parameters:

Tag | Description
rescan | Returned with value 1 if the server is still scanning the database. The results may therefore be incomplete. Not returned if no scan is in progress.
count | Number of results returned by the query. If no filter parameter is present, this is the same value as returned by "info total genres ?".
For each genre: |
id | Genre ID. Item delimiter.
genre | Genre name.

Example:

> Request: "genres 0 5<LF>"
> Response: "genres 0 5 rescan:1 count:6 id:3 genre:Acid%20Jazz id:4 genre:Alternative%20&%20Punk id:5 genre:French id:6 genre:No%20Genre id:7 genre:Pop <LF>"

> Request: "genres 0 5 search:unk<LF>"
> Response: "genres 0 5 search:unk count:1 id:4 genre:Alternative%20&%20Punk<LF>"

`artists <start> <itemsPerResponse> <taggedParameters>`

The "artists" query returns all artists known by the server. The results of this query depend in part on the "Compilations" preference (Server Settings, Behavior). The "Various Artists" pseudo-artist appears if the server groups compilations.

Accepted tagged parameters:

Tag | Description
search | Search substring. The search is case insensitive and obeys the "Search Within Words" server parameter.
genre_id | Genre ID, to restrict the results to those artists with songs of that genre.
album_id | Album ID, to restrict the results to those artists with songs of that album.
charset | Character set to use to return data. See charset notes above.

Returned tagged parameters:

Tag | Description
rescan | Returned with value 1 if the SlimServer is still scanning the database. The results may therefore be incomplete. Not returned if no scan is in progress.
count | Number of results returned by the query. If no search string is present, this is the same value as returned by "info total artists ?"
For each artist: |
id | Artist ID. Item delimiter.
artist | Artist name.

Example:

> Request: "artists 0 5<LF>"
> Response: "artists 0 5 count:7 id:2 artist:Anastacia id:3 artist:Calogero id:4 artist:Evanescence id:5 artist:Leftfield%20%26%20Lydon id:18 artist:Llorca <LF>"

> Request: "artists 0 5 genre_id:7<LF>"
> Response: "artists 0 5 genre_id:7 count:2 id:2 artist:Anastacia id:19 artist:Sarah%20Connor <LF>"

`albums <start> <itemsPerResponse> <taggedParameters>`

The "albums" query returns all albums known by the server. The results of this query depend in part on the "Group discs" preference (Server Settings, Behavior).

Accepted tagged parameters:

Tag | Description
search | Search substring. The search is case insensitive and obeys the "Search Within Words" server parameter.
genre_id | Genre ID, to restrict the results to those albums with songs of that genre.
artist_id | Artist ID, to restrict the results to those albums by "artist_id".
track_id | Track ID, to restrict the results to the album of "track_id". If specified, all other filters are ignored.
year | Year, to restrict the results to those albums of that year.
compilation | Compilation, to restrict the results to those albums that are (1) or aren't (0) compilations.
sort | Sort order of the returned list of albums. One of "album", (the default) or "new" (which enables to replicate the "New Music" browse mode of the web interface).
tags | Determines which tags are returned. Each returned tag is identified by a letter (see below). The default value is "l".
charset | Character set to use to return data. See charset notes above.

Returned tagged parameters:

| Tag | Description
| rescan | Returned with value 1 if the SlimServer is still scanning the database. The results may therefore be incomplete. Not returned if no scan is in progress.
| count | Number of results returned by the query. If no filter is present, this is the same value as returned by "info total albums ?"
| For each album: |
| id | Album ID. Item delimiter.
l | album | Album name, including SlimServer's added "(N of M)" if the server is set to group multi disc albums together. See tag "title" for the unmodified value.
y | year | Album year. This is determined by SlimServer based on the album tracks.
j | artwork_track_id | Identifier of one of the album tracks, used by the server to display the album's artwork.
t | title | "Raw" album title as found in the album tracks ID3 tags, as opposed to "album". Note that "title" and "album" are identical if the server is set to group discs together.
i | disc | Disc number of this album. Only if the server is not set to group multi-disc albums together.
q | disccount | Number of discs for this album. Only if known.
w | compilation | 1 if this album is a compilation.

Examples:

> Request: "albums 0 4<LF>"
> Response: "albums 0 4 count:14 id:1 album:Amadeus%20(Disc%201%20of%202) id:4 album:Anastacia id:5 album:Bounce%20[Single] id:6 album:Fallen<LF>"

> Request: "albums 0 5 genre_id:7<LF>"
> Response: "albums 0 5 genre_id:7 count:2 id:4 album:Anastacia id:5 album:Bounce%20[Single]<LF>"

> Request: "albums 0 5 artist_id:19<LF>"
> Response: "albums 0 5 artist_id:19 count:1 id:5 album:Bounce%20[Single]<LF>"

`playlists <start> <itemsPerResponse> <taggedParameters>`

The "playlists" query returns all playlists known by the server.

Accepted tagged parameters:

Tag | Description
search | Search substring. The search is case insensitive and obeys the "Search Within Words" server parameter.
tags | Determines which tags are returned. Each returned tag is identified by a letter (see below). The default value is empty.
charset | Character set to use to return data. See charset notes above.

Returned tagged parameters:

| Tag | Description
| rescan | Returned with value 1 if the SlimServer is still scanning the database. The results may therefore be incomplete. Not returned if no scan is in progress.
| count | Number of results returned by the query.
| For each playlist: |
| id | Playlist ID. Item delimiter.
| playlist | Playlist name
u | url | Playlist file url

Example:

> Request: "playlists 0 2<LF>"
> Response: "playlists 0 2 count:5 id:37 name:Funky%20Beats id:57 name:SUPER<LF>"

> Request: "playlists 0 2 search:SUPER tags:u<LF>"
> Response: "playlists 0 2 search:SUPER tags:u count:1 id:57 name:SUPER url:playlist:///Volume/path/file.m3u<LF>"

`playlists tracks <start> <itemsPerResponse> <taggedParameters>`

The "playlists tracks" query returns the tracks of a given playlist.

Accepted tagged parameters:

Tag | Description
playlist_id | Playlist ID as returned by the "playlists" query. This is a mandatory parameter.
tags | Determines which tags are returned. Each returned tag is identified by a letter (see command "songinfo" for a list of possible fields and their identifying letter). The default tags value for this command is "gald".
charset | Character set to use to return data. See charset notes above.

Returned tagged parameters:

Tag | Description
rescan | Returned with value 1 if the SlimServer is still scanning the database. The results may therefore be incomplete. Not returned if no scan is in progress.
count | Number of tracks in the playlist.
For each track: |
playlist index | Index (first item is 0) of the track in the playlist. The first returned instance of this field is equal to start. Item seperator.
Tags | Same tags as defined in command "songinfo".

`playlists rename <taggedParameters>`

This command renames a saved playlist.

Accepted tagged parameters:

Tag | Description
playlist_id | The id of the playlist to rename.
newname | The new name of the playlist.
dry_run | Used to check if the new name is already used by another playlist. The command performs the name check but does not overwrite the existing playlist. If a name conflict occurs, the command will return a "overwritten_playlist_id" parameter.
charset | Character set to use to return data. See charset notes above.

Returned tagged parameters:

Tag | Description
overwritten_playlist_id | This returns the playlist id of the playlist overwritten (if "dry_run" is 0 or not present) by renaming the playlist. Only present if a playlist is overwritten.

Examples:

> Request: "playlists rename playlist_id:22 newname:Hello<LF>"
> Response: "playlists rename playlist_id:22 newname:Hello<LF>"

`playlists delete <taggedParameters>`

This command deletes a saved playlist.

Accepted tagged parameters:

Tag | Description
playlist_id | The id of the playlist to delete.

Examples:

> Request: "playlists delete playlist_id:22<LF>"
> Response: "playlists delete playlist_id:22<LF>"

`playlists edit <taggedParameters>`

This command manipulates the track content of a saved playlist.

Accepted tagged parameters:

Tag | Description
playlist_id | The id of the playlist to manipulate.
cmd | One of "up", "down", "delete" or "add", in order to move up, down, delete or add a track.
index | For "cmd:up", "cmd:down" and "cmd:delete" the index of the track to edit.
title | For "cmd:add", the title of the track to add.
url | For "cmd:add", the url of the track to add.

Examples:

> Request: "playlists edit cmd:up playlist_id:22 index:3<LF>"
> Response: "playlists edit cmd:up playlist_id:22 index:3<LF>"

> Request: "playlists edit cmd:add playlist_id:22 title:Song url:file://...<LF>"
> Response: "playlists edit cmd:add playlist_id:22 title:Song url:file://...<LF>"

`songinfo <start> <itemsPerResponse> <taggedParameters>`

The "songinfo" command returns all the information on a song known by the server. Please note that the <start> and <itemsPerResponse> parameters apply to the individual data fields below and not, as they do in other extended CLI queries, to the number or songs (or artists, genres, etc.) returned; the "songinfo" only ever returns information about a single song.

Accepted tagged parameters:

Tag | Description
url | Song path as returned by other CLI commands. This is a mandatory parameter, except if "track_id" is provided.
track_id | Track ID as returned by other CLI commands. This is a mandatory parameter, except if "url" is provided.
tags | Determines which tags are returned. Each returned tag is identified by a letter (see below). The default value is all info except the url, depending on the given parameter.
charset | Character set to use to return data. See charset notes above.

Returned tagged parameters:

| Tag | Description
| rescan | Returned with value 1 if the SlimServer is still scanning the database. The results may therefore be incomplete. Not returned if no scan is in progress.
| count | Number of results returned by the query, that is, total number of elements to return for this song.
| id | Track ID.
| title | Song title
g | genre | Genre name. Only if known.
p | genre_id | Genre ID. Only if known.
a | artist | Artist name. Only if known.
s | artist_id | Artist ID. Only if known.
c | composer | Composer name. Only if known.
b | band | Band name. Only if known.
h | conductor | Conductor name. Only if known.
l | album | Album name. Only if known.
e | album_id | Album ID. Only if known.
d | duration | Song duration in seconds.
i | disc | Disc number. Only if known.
q | disccount | Number of discs. Only if known.
t | tracknum | Track number. Only if known.
y | year | Song year. Only if known.
m | bpm | Beats per minute. Only if known.
k | comment | Song comments, if any.
o | type | Content type. Only if known.
v | tagversion | Version of tag information in song file. Only if known.
r | bitrate | Song bitrate. Only if known.
f | filesize | Song file length in bytes. Only if known.
z | drm | Digital rights information. Only if known.
j | coverart | 1 if coverart is available for this song. Not listed otherwise.
n | modificationTime | Date and time song file was last changed.
u | url | Song file url.
w | lyrics | Lyrics. Only if known.
x | remote | Remote track.

Example:

> Request: "songinfo 0 6 url:file:///Users/dean/slimp3/Music/Anastacia/Anastacia/Left%2520Outside%2520Alone.mp3<LF>"
> Response: "songinfo 0 6 url:file:///Users/dean/slimp3/Music/Anastacia/Anastacia/Left%2520Outside%2520Alone.mp3 count:6 id:483 title:Left%20Outside%20Alone genre:Pop artist:Anastacia composer:D.%20Austin/G.%20Ballard album:Anastacia<LF>"

`titles|songs|tracks <start> <itemsPerResponse> <taggedParameters>`

The "titles" command returns all titles known by the SlimServer.

Accepted tagged parameters:

Tag | Description
genre_id | Genre ID, to restrict the results to the titles of that genre.
artist_id | Artist ID, to restrict the results to the titles of that artist.
album_id | Album ID, to restrict the results to the titles of that album.
year | Year, to restrict the results to the titles of that year.
search | Search substring. The search is case insensitive and obeys the "Search Within Words" server parameter.
tags | Determines which tags are returned. Each returned tag is identified by a letter (see command "songinfo" for a list of possible fields and their identifying letter). The default tags value for this command is "gald".
sort | Sorting, one of "title" (the default) or "tracknum" (in which case the track field ("t") is added automatically to the response). Sorting by tracks is possible only if tracks are defined and for a single album.
charset | Character set to use for the data. See charset notes above.

Returned tagged parameters:

Tag | Description
rescan | Returned with value 1 if the SlimServer is still scanning the database. The results may therefore be incomplete. Not returned if no scan is in progress.
count | Number of results returned by the query. If no search string or album/artist/genre filter is present, this is the same value as returned by "info total songs ?".
For each title: |
Tags | Same tags as defined in command "songinfo".

Example:

> Request: "titles 0 2<LF>"
> Response: "titles 0 2 count:100 id:55 title:Ancestral%20Aid genre:Soundtrack artist:Various%20Artists album:The%20Hunt%20For%20Red%20October duration:136.93387755102 disc:1 track:5 year:1990 url:file://Disk/The%20Hunt%20For%20Red%20October/Ancestral%20Aid.mp3 id:1 title:Any%20How genre:Acid%20Jazz artist:Llorca album:New%20Comer duration:340.297142857143 track:5 year:2001 url:...<LF>"

> Request: "titles 0 12 album:Anastacia tags:p<LF>"
> Response: "titles 0 12 album:Anastacia tags:p count:12 id:4 title:Heavy%20On%20My%20Heart url:... id:1 title:I%20Do url:... id:2 title:Left%20Outside%20Alone url:...<LF>"

`search <start> <itemsPerResponse> <taggedParameters>`

The "search" command returns artists, albums and tracks matching a search string.

Accepted tagged parameters:

Tag | Description
term | Search string
charset | Character set to use for the data. See charset notes above.

Returned tagged parameters:

Tag | Description
rescan | Returned with value 1 if the SlimServer is still scanning the database. The results may therefore be incomplete. Not returned if no scan is in progress.
count | Total number of results returned by the query. This is the sum of "artists_count", "albums_count" and "tracks_count".
artists_count | Total number of artists found.
albums_count | Total number of albums found.
tracks_count | Total number of tracks found.
For each artist: |
artist_id | Artist ID.
artist | Artist name.
For each album: |
album_id | Album ID.
album | Album title.
For each track: |
track_id | Track ID.
track | Track title.

Example:

> Request: "search 0 20 term:al<LF>"
> Response: "search 0 20 term:al count:9 artists_count:2 albums_count:1 tracks_count:6 artist_id:2 artist:Alanis%20Morissette artist_id:37 artist:Alphaville album_id:10 album:All%20Time%20Greatest%20Hits%20%5BBarry%20White%5D%20MMM track_id:11 track:All%20I%20Really%20Want track_id:68 track:The%20Sun%20Always%20Shines%20On%20TV track_id:185 track:All%20Around%20The%20World track_id:189 track:Give%20Me%20All%20Your%20Love%20%5BSingle%20Cut%5D track_id:245 track:Better%20All%20The%20Time track_id:306 track:Fuck%20Them%20All<LF>"

### Favorites

- `favorites`
- `favorites add`
- `favorites move`
- `favorites delete`

`favorites <start> <itemsPerResponse>`

The "favorites" query returns all server favorites.

Returned tagged parameters:

Tag | Description
count | Number of favorites defined.
For each favorite: |
id | Favorite ID. Item delimiter.
title | Favorite title.
url | URL of the favorite. The favorite can be played using the "playlist play" command.

Example:

> Request: "favorites 0 1<LF>"
> Response: "favorites 0 1 count:2 id:0 title:Un%20Monde%20Sans%20Frime url:file://Music/Hotel/Un%2520Monde%2520Sans%2520Frime.mp3 <LF>"

`favorites add <url> <title>`

The "favorites add" command adds a favorite.

Example:

> Request: "favorites add file:///... BestSong<LF>"
> Response: "favorites add file:///... BestSong<LF>"

`favorites move <fromindex> <toindex>`

The "favorites move" command moves the favorite at the specified index to a new index. The first favorite has index 0.

Example:

> Request: "favorites move 0 1<LF>"
> Response: "favorites move 0 1<LF>"

`favorites delete <index>`

The "favorites delete" command deletes the favorite at the specified index (that is, empties the favorite slot). The first favorite has index 0.

Example:

> Request: "favorites delete 0<LF>"
> Response: "favorites delete 0<LF>"

## Playlist commands and queries

- `play`
- `stop`
- `pause`
- `mode ?`
- `time`
- `genre ?`
- `artist ?`
- `album ?`
- `title ?`
- `duration ?`
- `remote ?`
- `current_title ?`
- `path ?`
- `playlist play`
- `playlist add`
- `playlist insert`
- `playlist deleteitem`
- `playlist move`
- `playlist delete`
- `playlist resume`
- `playlist save`
- `playlist loadalbum`
- `playlist addalbum`
- `playlist insertalbum`
- `playlist deletealbum`
- `playlist clear`
- `playlist zap`
- `playlist name ?`
- `playlist url ?`
- `playlist modified ?`
- `playlist playlistsinfo`
- `playlist index`
- `playlist genre ?`
- `playlist artist ?`
- `playlist album ?`
- `playlist title ?`
- `playlist path ?`
- `playlist remote ?`
- `playlist duration ?`
- `playlist tracks ?`
- `playlist shuffle`
- `playlist repeat`
- `playlistcontrol`
- `status`

`<playerid> play`

The "play" command allows to start playing the current playlist.

Example:

> Request: "04:20:00:12:23:45 play<LF>"
> Response: "04:20:00:12:23:45 play<LF>"

`<playerid> stop`

The "stop" command allows to stop playing the current playlist.

Example:

> Request: "04:20:00:12:23:45 stop<LF>"
> Response: "04:20:00:12:23:45 stop<LF>"

`<playerid> pause <0|1|>`

Example:

You may use "pause 1" to force the player to pause, "pause 0" to force the player to unpause and "pause" to toggle the pause state.

> Request: "04:20:00:12:23:45 pause<LF>"
> Response: "04:20:00:12:23:45 pause<LF>"

`<playerid> mode ?`

The "mode" command allows to query the player state and returns one of "play", "stop" or "pause". If the player is off, "mode ?" returned value is undefined.

Example:

> Request: "04:20:00:12:23:45 mode ?<LF>"
> Response: "04:20:00:12:23:45 mode stop<LF>"

`<playerid> time <number|-number|+number|?>`

The "time" command allows you to query the current number of seconds that the current song has been playing by passing in a "?". You may jump to a particular position in a song by specifying a number of seconds to seek to. You may also jump to a relative position within a song by putting an explicit "-" or "+" character before a number of second you would like to seek.

Examples:

> Request: "04:20:00:12:23:45 time ?<LF>"
> Response: "04:20:00:12:23:45 time 12.55<LF>"

> Request: "04:20:00:12:23:45 time 5<LF>"
> Response: "04:20:00:12:23:45 time 5<LF>"

> Request: "04:20:00:12:23:45 time -5<LF>"
> Response: "04:20:00:12:23:45 time -5<LF>"

`<playerid> genre ?
<playerid> artist ?
<playerid> album ?
<playerid> title ?
<playerid> duration ?
<playerid> remote ?
<playerid> current_title ?
<playerid> path ?`

The "genre", "artist", "album", "title" "duration", "remote", "current_title" and "path" commands allow for querying information about the song currently playing. "remote" returns 1 if the current song is a remote stream. "current_title" returns the current title for remote streams or the song title as formatted for the player.

Examples:

> Request: "04:20:00:12:23:45 genre ?<LF>"
> Response: "04:20:00:12:23:45 genre Rock<LF>"

> Request: "04:20:00:12:23:45 artist ?<LF>"
> Response: "04:20:00:12:23:45 artist Abba<LF>"

> Request: "04:20:00:12:23:45 album ?<LF>"
> Response: "04:20:00:12:23:45 album Greatest%20Hits<LF>"

> Request: "04:20:00:12:23:45 title ?<LF>"
> Response: "04:20:00:12:23:45 title Voulez%20vous<LF>"

> Request: "04:20:00:12:23:45 duration ?<LF>"
> Response: "04:20:00:12:23:45 duration 103.2<LF>"

> Request: "04:20:00:12:23:45 remote ?<LF>"
> Response: "04:20:00:12:23:45 remote 0<LF>"

> Request: "04:20:00:12:23:45 current_title ?<LF>"
> Response: "04:20:00:12:23:45 current_title 1-Voulez%20vous%20(ABBA)<LF>"

> Request: "04:20:00:12:23:45 path ?<LF>"
> Response: "04:20:00:12:23:45 path pathtofile<LF>"

`<playerid> playlist play <item>`

The "playlist play" command puts the specified song URL, playlist or directory contents into the current playlist and plays starting at the first item. Any songs previously in the playlist are discarded.

Examples:

> Request: "04:20:00:12:23:45 playlist play /music/abba/01_Voulez_Vous.mp3<LF>"
> Response: "04:20:00:12:23:45 playlist play /music/abba/01_Voulez_Vous.mp3<LF>"

`<playerid> playlist add <item>`

The "playlist add" command adds the specified song URL, playlist or directory contents to the end of the current playlist. Songs currently playing or already on the playlist are not affected.

Examples:

> Request: "04:20:00:12:23:45 playlist add /music/abba/01_Voulez_Vous.mp3<LF>"
> Response: "04:20:00:12:23:45 playlist add /music/abba/01_Voulez_Vous.mp3<LF>"

> Request: "04:20:00:12:23:45 playlist add /playlists/abba.m3u<LF>"
> Response: "04:20:00:12:23:45 playlist add /playlists/abba.m3u<LF>"

`<playerid> playlist insert <item>`

The "playlist insert" command inserts the specified song URL, playlist or directory contents to be played immediately after the current song in the current playlist. Any songs currently playing or already on the playlist are not affected.

Examples:

> Request: "04:20:00:12:23:45 playlist insert /music/abba/01_Voulez_Vous.mp3<LF>"
> Response: "04:20:00:12:23:45 playlist insert /music/abba/01_Voulez_Vous.mp3<LF>"

> Request: "04:20:00:12:23:45 playlist insert /playlists/abba.m3u<LF>"
> Response: "04:20:00:12:23:45 playlist insert /playlists/abba.m3u<LF>"

`<playerid> playlist deleteitem <item>`

The "playlist deleteitem" command removes the specified song URL, playlist or directory contents from the current playlist.

Examples:

> Request: "04:20:00:12:23:45 playlist deleteitem /music/abba/01_Voulez_Vous.mp3<LF>"
> Response: "04:20:00:12:23:45 playlist deleteitem /music/abba/01_Voulez_Vous.mp3<LF>"

`<playerid> playlist move <fromindex> <toindex>`

The "playlist move" command moves the song at the specified index to a new index in the playlist. An offset of zero is the first song in the playlist.

Examples:

> Request: "04:20:00:12:23:45 playlist move 0 5<LF>"
> Response: "04:20:00:12:23:45 playlist move 0 5<LF>"

`<playerid> playlist delete <songindex>`

The "playlist delete" command deletes the song at the specified index from the current playlist.

Examples:

> Request: "04:20:00:12:23:45 playlist delete 5<LF>"
> Response: "04:20:00:12:23:45 playlist delete 5<LF>"

`<playerid> playlist resume <playlist>`

Replace the current playlist with the playlist specified by p2, starting at the song that was playing when the file was saved. (Resuming works only with M3U files saved with the "playlist save" command below.) Shortcut: use a bare playlist name (without leading directories or trailing .m3u suffix) to load a playlist in the saved playlists folder.

Examples:

> Request: "04:20:00:12:23:45 playlist resume abba<LF>"
> Response: "04:20:00:12:23:45 playlist resume abba<LF>"

`<playerid> playlist save <filename>`

Saves a playlist file in the saved playlists directory. Accepts a playlist filename (without .m3u suffix) and saves in the top level of the playlists directory.

Examples:

> Request: "04:20:00:12:23:45 playlist save abba<LF>"
> Response: "04:20:00:12:23:45 playlist save abba<LF>"

`<playerid> playlist loadalbum <genre> <artist> <album>`

The "playlist loadalbum" command puts songs matching the specified genre artist and album criteria on the playlist. Songs previously in the playlist are discarded.

Examples:

> Request: "04:20:00:12:23:45 playlist loadalbum Rock Abba *<LF>"
> Response: "04:20:00:12:23:45 playlist loadalbum Rock Abba *<LF>"

`<playerid> playlist addalbum <genre> <artist> <album>`

The "playlist addalbum" command appends all songs matching the specified criteria onto the end of the playlist. Songs currently playing or already on the playlist are not affected.

Examples:

> Request: "04:20:00:12:23:45 playlist addalbum Rock Abba *<LF>"
> Response: "04:20:00:12:23:45 playlist addalbum Rock Abba *<LF>"

`<playerid> playlist insertalbum <genre> <artist> <album>`

The "playlist insertalbum" command inserts all songs matching the specified criteria at the top of the playlist. Songs already on the playlist are not affected.

Examples:

> Request: "04:20:00:12:23:45 playlist addalbum Rock Abba *<LF>"
> Response: "04:20:00:12:23:45 playlist addalbum Rock Abba *<LF>"

`<playerid> playlist deletealbum <genre> <artist> <album>`

The "playlist deletealbum" command removes songs matching the specified genre artist and album criteria from the playlist.

Examples:

> Request: "04:20:00:12:23:45 playlist deletealbum Rock Abba *<LF>"
> Response: "04:20:00:12:23:45 playlist deletealbum Rock Abba *<LF>"

`<playerid> playlist clear`

The "playlist clear" command removes any song that is on the playlist. The player is stopped.

Examples:

> Request: "04:20:00:12:23:45 playlist clear<LF>"
> Response: "04:20:00:12:23:45 playlist clear<LF>"

`<playerid> playlist zap <songindex>`

The "playlist zap" command adds the song at index songindex into the zapped song playlist.

Examples:

> Request: "04:20:00:12:23:45 playlist zap 3<LF>"
> Response: "04:20:00:12:23:45 playlist zap 3<LF>"

`<playerid> playlist name ?`

The "playlist name" command returns the name of the saved playlist last loaded into the Now Playing playlist, if any.

Examples:

> Request: "04:20:00:12:23:45 playlist name ?<LF>"
> Response: "04:20:00:12:23:45 playlist name Jazz%20Favorites <LF>"

`<playerid> playlist url ?`

The "playlist url" command returns the URL of the saved playlist last loaded into the Now Playing playlist, if any.

Examples:

> Request: "04:20:00:12:23:45 playlist url ?<LF>"
> Response: "04:20:00:12:23:45 playlist url file:///Users/dean/Music/testmusic/Zapped%20Songs.m3u<LF>"

`<playerid> playlist modified ?`

The "playlist modified" returns the modification state of the saved playlist last loaded into the Now Playing playlist, if any. If "1", the playlist has been modified since it was loaded.

Examples:

> Request: "04:20:00:12:23:45 playlist modified ?<LF>"
> Response: "04:20:00:12:23:45 playlist modified 0<LF>"

`<playerid> playlist playlistsinfo <taggedParameters>`

The "playlist playlistsinfo" query returns information on the saved playlist last loaded into the Now Playing playlist, if any.

Accepted tagged parameters:

Tag | Description
charset | Character set to use to return data. See charset notes above.

Returned tagged parameters:

Tag | Description
id | Playlist id.
name | Playlist name. Equivalent to "playlist name ?".
modified | Modification state of the saved playlist. Equivalent to "playlist modified ?".
url | Playlist url. Equivalent to "playlist url ?".

Example:

> Request: "a5:41:d2:cd:cd:05 playlist playlistsinfo <LF>"
> Response: "a5:41:d2:cd:cd:05 playlist playlistsinfo id:267 name:A98 modified:0 url:file://Volumes/... <LF>"

`<playerid> playlist index <index|+index|-index|?>`

The "playlist index" command sets or queries the song that is currently playing by index. When setting, a zero-based value may be used to indicate which song to play. An explicitly positive or negative number may be used to jump to a song relative to the currently playing song. The value of the current song index may be obtained by passing in "?" as a parameter.

Examples:

> Request: "04:20:00:12:23:45 playlist index +1<LF>"
> Response: "04:20:00:12:23:45 playlist index +1<LF>"

> Request: "04:20:00:12:23:45 playlist index 5<LF>"
> Response: "04:20:00:12:23:45 playlist index 5<LF>"

> Request: "04:20:00:12:23:45 playlist index ?<LF>"
> Response: "04:20:00:12:23:45 playlist index 5<LF>"

`<playerid> playlist genre <index> ?
<playerid> playlist artist <index> ?
<playerid> playlist album <index> ?
<playerid> playlist title <index> ?
<playerid> playlist path <index> ?
<playerid> playlist remote <index> ?
<playerid> playlist duration <index> ?`

The "playlist genre", "playlist artist", "playlist album", "playlist title", "playlist path", "playlist remote" and "playlist duration" queries return the requested information for a given song at an index position in the current playlist. "playlist remote" returns 1 if the "song" is a remote stream.

Examples:

> Request: "04:20:00:12:23:45 playlist genre 3 ?<LF>"
> Response: "04:20:00:12:23:45 playlist genre 3 Rock<LF>"

> Request: "04:20:00:12:23:45 playlist artist 3 ?<LF>"
> Response: "04:20:00:12:23:45 playlist artist 3 Abba<LF>"

> Request: "04:20:00:12:23:45 playlist album 3 ?<LF>"
> Response: "04:20:00:12:23:45 playlist album 3 Greatest Hits<LF>"

> Request: "04:20:00:12:23:45 playlist title 3 ?<LF>"
> Response: "04:20:00:12:23:45 playlist title 3 Voulez Vous<LF>"

> Request: "04:20:00:12:23:45 playlist path 3 ?<LF>"
> Response: "04:20:00:12:23:45 playlist path 3 file:///Volumes/Music/ABBA/...<LF>"

> Request: "04:20:00:12:23:45 playlist remote 3 ?<LF>"
> Response: "04:20:00:12:23:45 playlist remote 3 0<LF>"

> Request: "04:20:00:12:23:45 playlist duration 3 ?<LF>"
> Response: "04:20:00:12:23:45 playlist duration 3 103.2<LF>"

`<playerid> playlist tracks ?`

The "playlist tracks" command returns the the total number of tracks in the current playlist

Example:

> Request: "04:20:00:12:23:45 playlist tracks ?<LF>"
> Response: "04:20:00:12:23:45 playlist tracks 7<LF>"

`<playerid> playlist shuffle <0|1|2|?|>`

The "playlist shuffle" command is used to shuffle, unshuffle or query the shuffle state for the current playlist. A value of "0" indicates that the playlist is not shuffled, "1" indicates that the playlist is shuffled by song, and "2" indicates that the playlist is shuffled by album. Used with no parameter, the command toggles the shuffling state.

Example:

> Request: "04:20:00:12:23:45 playlist shuffle ?<LF>"
> Response: "04:20:00:12:23:45 playlist shuffle 1<LF>"

> Request: "04:20:00:12:23:45 playlist shuffle 0<LF>"
> Response: "04:20:00:12:23:45 playlist shuffle 0<LF>"

`<playerid> playlist repeat <0|1|2|?|>`

The "playlist repeat" command is used to indicate or query if the player will stop playing at the end of the playlist, repeat the current song indefinitely, or repeat the current playlist indefinitely. A value of "0" indicates that the player will stop at the end of the playlist, "1" indicates that the player will repeat the current song indefinitely and a value of "2" indicates that the player will repeat the entire playlist indefinitely. Used with no parameter, the command toggles the repeat state.

Example:

> Request: "04:20:00:12:23:45 playlist repeat ?<LF>"
> Response: "04:20:00:12:23:45 playlist repeat 2<LF>"

> Request: "04:20:00:12:23:45 playlist repeat 0<LF>"
> Response: "04:20:00:12:23:45 playlist repeat 0<LF>"

`<playerid> playlistcontrol <taggedParameters>`

The "playlistcontrol" command enables playlist operations using IDs as returned by extended CLI queries (titles, artists, playlists, etc).

Accepted tagged parameters:

Tag | Description
cmd | Command to perform on the playlist, one of "load", "add", "insert" or "delete". This parameter is mandatory. If no additional parameter is provided, the entire DB is loaded/added/inserted/deleted.
genre_id | Genre ID, to restrict the results to the titles of that genre.
artist_id | Artist ID, to restrict the results to the titles of that artist.
album_id | Album ID, to restrict the results to the titles of that album.
track_id | Comma-separated list of track IDs, to restrict the results to these track_ids. If this parameter is provided, then any genre_id, artist_id and/or album_id parameter is ignored.
year_id | Year ID, to restrict the results to the given year.
playlist_id | Playlist ID, to restrict the results to this playlist_id. If this parameter is provided, then any genre_id, artist_id, album_id and/or track_id parameter is ignored. The tracks are added to the playlist in the given order.
playlist_name | Playlist name, to restrict the results to this playlist_name. If this parameter is provided, then any genre_id, artist_id, album_id, track_id and/or playlist_id parameter is ignored.

Returned tagged parameters:

Tag | Description
rescan | Returned with value 1 if the SlimServer is still scanning the database. The command may therefore have missed items. Not returned if no scan is in progress.
count | Number of elements loaded/added/inserted or max number of elements deleted

Example:

> Request: "a5:41:d2:cd:cd:05 playlistcontrol cmd:add genre_id:9<LF>"
> Response: "a5:41:d2:cd:cd:05 playlistcontrol cmd:add genre_id:9 count:33<LF>"

> Request: "a5:41:d2:cd:cd:05 playlistcontrol cmd:load album_id:22<LF>"
> Response: "a5:41:d2:cd:cd:05 playlistcontrol cmd:load album_id:22 count:12<LF>"

`<playerid> status <start> <itemsPerResponse> <taggedParameters>`

The "status" request returns the complete status about a given player, including the current playlist. Set the <start> parameter to "-" to get the playlist data starting from the current song.
In this "curent" mode and if repeat is on, SlimServer will attempt to return <itemsPerResponse> elements, by repeating the playlist at most once, unless shuffling is on and SlimServer is configured to re-shuffle the playlist at each loop (in which case it is impossible to predict the song following the last one in the playlist until this last song has finished playing).
Similarly, in the "curent" mode, if repeat is one, only the current song is returned, regardless of the value of <itemsPerResponse>.
Clients can subscribe to "status" requests, so that the request results are automatically returned asynchronously whenever a change occurs to a player. Please note this mechanism is completely distinct from the "listen" and "subscribe" commands described above.

Accepted tagged parameters:

Tag | Description
tags | Determines which tags are returned. Each returned tag is identified by a letter (see command "songinfo" for a list of possible fields and their identifying letter). The default tags value for this query is "gald".
charset | Character set to use to return data. See charset notes above.

subscribe

This optional parameter controls the subscription to the player status. Only one status subscription is possible per player and connection.
Subscription is enabled by using this parameter with a positive integer. It is disabled by using "-". When the subscription is enabled, normal "status" queries (i.e. not using the "subscribe" parameter) can be performed and will have no effect on the subscription in place.
When enabled, the "status" request is automatically re-generated on player change (and sent asynchronously to the CLI client). The number indicates the time interval in seconds between automatic generations in case nothing happened to the player in the interval. Use "0" to disable this last feature and only be notified on player or playlist changes. Please see the example.
Some situations will lead to multiple status queries generated very close to another. This is a limitation of the change detection "algorithm".
If the player is manually (through the web page) or automatically deleted from SlimServer, "client forget" is sent instead of the status query and the subscription is terminated.
Please note this mechanism is completely distinct from the "listen" and "subscribe" commands described above.

Returned tagged parameters:

Tag | Description
rescan | Returned with value 1 if the SlimServer is still scanning the database. The results may therefore be incomplete. Not returned if no scan is in progress.
player_name | Name of the player.
player_connected | Connected state of the player.
power | Power state of the player. Not returned for remote streaming connections.
signalstrength | Signal strength (only for Squeezeboxen and Transporters).
If player is on: |
mode | Player mode.
remote | Returns 1 if a remote stream is currently playing.
current_title | Returns the current title for remote streams. Only if remote stream is playing.
time | Elapsed time into the current song. Decimal seconds. Only if current song.
rate | Player rate. Only if there is a current song.
duration | Duration of the current song. Decimal seconds. Only if current song and if the duration is known (it is not for remote streams).
sleep | If set to sleep, the amount (in seconds) it was set to.
will_sleep_in | Seconds left until sleeping. Only if set to sleep.
sync_master | ID of the master player in the sync group this player belongs to. Only if synced.
sync_slaves | Comma-separated list of player IDs, slaves to sync_master in the sync group this player belongs to. Only if synced.
mixer volume | Not returned for remote streaming connections.
mixer treble | Only for SliMP3 and Squeezebox1 players.
mixer bass | Only for SliMP3 and Squeezebox1 players.
mixer pitch | Only for Squeezebox1 players.
playlist repeat | 0 no repeat, 1 repeat song, 2 repeat playlist.
playlist shuffle | 0 no shuffle, 1 shuffle songs, 2 shuffle albums.
playlist_id | Playlist id, if the current playlist is a stored playlist.
playlist_name | Playlist name, if the current playlist is a stored playlist. Equivalent to "playlist name ?".
playlist_modified | Modification state of the saved playlist (if the current playlist is one). Equivalent to "playlist modified ?".
playlist_cur_index | Index (first is 0) of the current song in the playlist. Only if there is a playlist.
playlist_tracks | Number of tracks in the current playlist. Only if there is a playlist.
If playlist information exist/requested, for each song in the playlist: |
playlist index | Index (first item is 0) of the playlist entry in the player playlist. Unless <start> is "-", the first returned instance of this field is equal to start. If <start> is "-", the first returned instance of this field contains the index of the currently playing song in the player playlist. Item seperator.
Tags | Same tags as defined in command "songinfo".

Example:

> Simple example
> Request: "a5:41:d2:cd:cd:05 status 0 2 tags:<LF>"
> Response: "a5:41:d2:cd:cd:05 status 0 2 tags: player_name:127.0.0.1 player_connected:1 power:1 mode:play rate:1 time:13.7129358076728 duration:252.630204081633 mixer%20volume:50 mixer%20treble:50 mixer%20bass:50 mixer%20pitch:100 playlist%20repeat:2 playlist%20shuffle:0 playlist_cur_index:1 playlist_tracks:3 playlist%20index:0 title:Left%20Outside%20Alone playlist%20index:1 title:Bounce%20[Original%20Version]<LF>"

> Current mode example
> Request: "a5:41:d2:cd:cd:05 status - 2 tags:<LF>"
> Response: "a5:41:d2:cd:cd:05 status - 2 tags: player_name:127.0.0.1 player_connected:1 power:1 mode:play rate:1 time:18.721127818274 duration:252.630204081633 mixer%20volume:50 mixer%20treble:50 mixer%20bass:50 mixer%20pitch:100 playlist%20repeat:2 playlist%20shuffle:0 playlist_cur_index:1 playlist_tracks:3 playlist%20index:1 title:Bounce%20[Original%20Version] playlist%20index:2 title:Open%20Up%20[Radio%20Edit]<LF>"

> Subscribe mode example
> Request: "a5:41:d2:cd:cd:05 status - 2 subscribe:30<LF>"
> Response: "a5:41:d2:cd:cd:05 status - 2 subscribe:30 player_name:127.0.0.1 ... (same as above)
> 10 seconds later, player is turned off, CLI generates and sends:
> "a5:41:d2:cd:cd:05 status - 2 subscribe:30 player_name:127.0.0.1 player_connected:1 power:0<LF>"
> 30 seconds (the subscribe value) elapse, no changes to the player, the CLI generates and sends:
> "a5:41:d2:cd:cd:05 status - 2 subscribe:30 player_name:127.0.0.1 player_connected:1 power:0<LF>"

## Notifications

All commands listed in this document are notifications as well as being commands and can be received when using "listen 1" (if they do not originate from the command-line connection that issued them; no command is echoed twice). Note that queries (for example, "display ? ?") are not notified. Other available notifications are listed below with their meaning. Please note that other notifications or commands may exist, but internal to the server and therefore not documented in this CLI document. Likewise, commands originating from the server may have more parameters than those described in this document, or parameters consisting of internal Perl data structures with strange text representations.

`<playerid> client <new|disconnect|reconnect>`

A new client is notified using "client new". "client disconnect" is sent when a client disconnects. Unless it reconnects (as signaled by "client reconnect") before a number of minutes, the client will be automatically forgotten by SlimServer (as indicated by command/notification "client forget".)

`rescan done`

This signals the end of a "rescan" or "wipecache".

`<playerid> unknownir <ircode> <time>`

This signals an IR code unkown by the server. The syntax is the same than the one used by "ir".

`<playerid> playlist newsong [<current_title>]`

This signals the start of a new song as reported by the player hardware (SB1/2/3 only; for SliMP3 players, this happens a couple of seconds before music starts on the player) and/or the start of a new song as reported by the listened to radio station (in which case the "current_title " information is provided for convenience).

## Plugins commands and queries

The following command and queries are proposed by SlimServer plugins. The plugin must be enabled in the SlimServer configuration for the commands and queries to be available to the CLI client. Please use query "can" to determine if the given command or query is available. Query "radios" can alternatively be used to get a list of available radio station plugin CLI queries.

- `radios`
- Slimdevices Picks, Shoutcast, Podcast, Live Music Archive, RadioGuide, RadioIO & RSS
- Live365
- RandomPlay

`radios <start> <itemsPerResponse> <taggedParameters>`

The "radios" query returns all radio type plugins enabled in the server. This command enables the client to present a top level "Radio" menu easily, without hardcoding the plugins nor worrying about them being enabled.

Accepted tagged parameters:

Tag | Description
charset | Character set to use to return data. See charset notes above.

Returned tagged parameters:

Tag | Description
count | Number of results returned by the query.
For each radio plugin: |
cmd | Command, one of "picks", "podcast", "lma", "shoutcast", "radioio", "radiotime" or "live365". Item delimiter. This corresponds to the respective queries below.
name | Radio plugin full display name, for example "Live Music Archive".
type | Type of the API of the radio plugin, one of "xmlbrowser" or "live365".

Example:

> Request: "radios 0 2<LF>"
> Response: "radios 0 2 count:2 cmd:radiotime name:RadioGuide type:xmlbrowser cmd:shoutcast name:SHOUTcast%20Internet%20Radio type:xmlbrowser <LF>"

### Slimdevices Picks, Shoutcast, Podcast, Live Music Archive, RadioGuide, RadioIO & RSS

`<picks|podcast|lma|shoutcast|rss|radioio|radiotime> items <start> <itemsPerResponse> <taggedParameters>`

These instructions are valid for all XMLBrowser based plugins. While the CLI queries are identical, returned values may vary between plugins. All queries to fetch data from the Internet, and consequently, as experienced in the web interface, there may be a significant delay before these queries return data. Data is cached however so subsequent queries performed immediately return much faster.

Accepted tagged parameters:

Tag | Description
item_id | The id of an item to be returned. The id represents the hierarchical structure of the file using a dotted syntax similar to the one used in SNMP, like eg. 2.0.9.3
search | When a list of items is to be returned, it can be filtered by it's name or title.
want_url | If set to 1, urls are returned by the query, otherwise they aren't.
charset | Character set to use to return data. See charset notes above.

Returned tagged parameters:

Tag | Description
networkerror | Returned with value 1 if there was a network error accessing the content source.
count | The number of items available at the selected level.
For each element: |
id | An item's hierarchical id. Item delimiter.
name | An item's (station, track, podcast etc.) name or title.
hasitems | Whether or not an item has sub-items. May indicate the number of sub-items.
type | Stream content type. Value "link" means sub-items must be fetched.
url | URL of the station or track (only returned if parameter "want_url" is set to 1). Although, the station can be played using the "playlist play" command, an equivalent command that operates on the id is provided below.
description | Some streams (podcasts) provide further information than the title.
length | Some streams (podcasts) contain information about their size/length.

Example:

> Request: "picks items 0 2 item_id:0<LF>"
> Response: "picks items 0 2 item_id:0 count:19 id:0.0 name:Alternative | RADIO%20DAVIDBYRNE.COM hasitems:0 id:0.1 name:Alternative | KCRW Music hasitems:0 <LF>"

`<playerid> <picks|podcast|lma|shoutcast|rss|radioio> playlist <play|load|insert|add> <taggedParameters>`

This command adds or plays an item. Though playback of these stations could be achieved by the standard playlist methods, calling this command will ensure that the station's name is displayed, not only it's url (if possible).
If item_id defines an item that can't be played, but contains playable subitems, then these will be played instead. This allows to eg. play all tracks of a genre.

Accepted tagged parameters:

Tag | Description
item_id | The id of an item to be played. The id represents the hierarchical structure of the file using a dotted syntax similar to the one used in SNMP, like eg. 2.0.9.3

Example:

> Request: "6e:ef:54:e9:02:b0 shoutcast playlist play item_id:1.1<LF>"
> Response: "6e:ef:54:e9:02:b0 shoutcast playlist play item_id:1.1<LF>"

### Live365

`live365 genres <start> <itemsPerResponse> <taggedParameters>`

This query returns the Live365 genre list. The "Live 365" internet radio plugin must be enabled in the server preferences for this query to work.
All calls to this query result in information being fetched from the web, with the resulting delayed answer.

Accepted tagged parameters:

Tag | Description
charset | Character set to use to return data. See charset notes above.

Returned tagged parameters:

Tag | Description
loginerror | Returned with value 1 if plugin cannot log in to Live365. Note that the CLI always attempts to autologin.
networkerror | Returned with value 1 if there was a network error accessing Live365.
count | The number of genres available.
For each genre: |
id | Live365 genre identifier. Item delimiter.
name | Genre name.

Example:

> Request: "live365 genres 252 2<LF>"
> Response: "live365 genres 252 2 count:262 id:community name:Talk%20-%20Community id:educational name%3ATalk%20-%20Educational <LF>"

`live365 stations <start> <itemsPerResponse> <taggedParameters>`

This query returns Live365 stations lists. The "Live 365" internet radio plugin must be enabled in the server preferences for this query to work.
All calls to this query result in information being fetched from the web, with the resulting delayed answer.

Accepted tagged parameters:

Tag | Description
genre_id | Genre of the stations to return. One of "presets", "picks", "pro" (professional stations), "all", or one of the genre id returned by "live365 genres". Defaults to "all"
sort | Sort order of the returned list of stations. One of "name", "bitrate", "rating" or "listeners". If no parameter is given, the default set in the web interface applies.
search | Search term to look for. The field (or field list) in which to search can be optionally specified with the "searchtype" field below.
searchtype | Fields on which to apply the search, if any. One of "tac" (title, artist & CD), "artist", "track", "cd", "station", "location" or "broadcaster". If no parameter is given, the default configured in the web interface applies.
charset | Character set to use to return data. See charset notes above.

Returned tagged parameters:

Tag | Description
loginerror | Returned with value 1 if plugin cannot log in to Live365. Note that the CLI always attempts to autologin.
networkerror | Returned with value 1 if there was a network error accessing Live365.
count | The total number of stations available.
For each station: |
id | Live365 station identifier. Item delimiter. Use the "live365 playlist" command to play that stream using this id.
name | Station name.
listeners | Number of listeners.
maxlisteners | Max number of possible listeners.
bitrate | Station bitrate in kbps.
rating | Live365 station rating.
quality | Quality?.
access | "PUBLIC" or "PRIVATE".
location | Station location.
broadcaster | Station broadcaster.

Example:

> Request: "live365 stations 0 1 genreid:all sort:name<LF>"
> Response: "live365 stations 0 1 genreid:all sort:name count:5997 id:305761 name:%C2%BBRADIOBUZZED%C2%AB listeners:8 maxlisteners:200 bitrate:64 rating:9.43 quality:264 access:PUBLIC location:santa%20clarita%20CA%20(California)%20United%20States broadcaster:relms <LF>"

`<playerid> live365 playlist <play|add> <taggedParameters>`

This command adds or plays a live365 station. Though playback of these stations could be achieved by the standard playlist methods, calling this command will ensure that the station's name is displayed, not only it's url (if possible).
The "Live 365" internet radio plugin must be enabled in the server preferences for this query to work. All calls to this query result in information being fetched from the web, with the resulting delayed answer.

Accepted tagged parameters:

Tag | Description
station_id | The id of the station to be played.

Example:

> Request: "6e:ef:54:e9:02:b0 live365 playlist play station_id:201489<LF>"
> Response: "6e:ef:54:e9:02:b0 live365 playlist play station_id:201489<LF>"

### RandomPlay

`<playerid> randomplay <tracks|albums|artists|year>`

The "randomplay" command starts a random mix of the given type.

Example:

> Request: "04:20:00:12:23:45 randomplay albums<LF>"
> Response: "04:20:00:12:23:45 randomplay albums<LF>"

## Deprecated commands and queries

The following commands are still supported but their usage is not recommended:

- `mode`
- `playlisttracks`

`<playerid> mode <play|pause|stop>`

The "mode" command allows to set the player playlist mode directly. It is deprecated. "mode play" has been replaced by "play" "mode stop" by "stop" and "mode pause" by "pause 1".

`playlisttracks <start> <itemsPerResponse> <taggedParameters>`

The "playlisttracks" command returns the tracks of a given playlist, is deprecated, and has been replaced by the "playlists tracks" query.