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

#### Introduction

The SlimServer provides a command-line interface to the Slim Devices players via standard in and out and a TCP/IP port. After starting the server, commands may be sent by connecting to a specific TCP/IP port or directly from the command line. Each command is terminated by a carriage return. The server will reply echoing the request. If the request included a "?" in a parameter to request a value from the server, the "?" will be replaced by the requested value in the reply. By default, the SlimServer will listen for connections on TCP/IP port 9090. This format is designed for ease of integration into Crestron and other automation systems.

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.

The format of the commands is as follows:

> [<playerid>] <p0> <p1> <p2> <p3> <p4> <CR>

where:

> <playerid> is the unique identifier for the player, usually (but not guaranteed to be) the IP address or MAC address of the player. The <playerid> may be omitted if there is only one player in the system or when using the "player" commands.

> <playerid> may be obtained by using the "player id" command.

> <p0> through <p4> are command parameters. Pass a "?" to obtain a value for that parameter in the response. 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".)

> Note: Commands that use paths to songs or playlists 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".

#### Supported Commands

The following commands are supported:

player count ?
player name <playerindex> ?
player id <playerindex> ?
player ip <playerindex> ?

player model <playerindex> ?

To obtain information about the players in the system, use the " player count", "player id", "player name". The "player count" command returns the number of players in the system. The "player name" command 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 will be returned.) The "player ip" command returns the IP address (along with port number) of the specified player. Note: The IP address and or port may change if the player reconnects or is rebooted. Use the player's id to uniquely identify the player. The "player id" command returns the player's unique MAC address. This value is used when specifying a player in subsequent commands.

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

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

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

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

play
pause <0|1|>
stop
mode <play|pause|stop|off|?>

Commands to control playback include "stop", "pause", "play". 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. The "mode" command allows you set the mode for the player directly.

Examples:

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

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

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

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 ?<CR>"
> > Response: "04:20:00:12:23:45 time 12.55<CR>"

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

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

genre ?
artist ?
album ?
title ?
duration ?
path ?

The "genre", "artist", "album", "title" "duration" and "path" commands allow for querying information about the song currently playing.

Examples:

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

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

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

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

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

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

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 a "?" parameter.

Examples:

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

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

sync <number|-|?>

The "sync" command specifies the player to synchronise with the given playerID. You may query which players are already synced with this player by passing in a "?" parameter. The server will return the IDs of any players synced with the player used in the query. Multiple ID's are separated by a space. To unsync a player, simply use the - parameter.

Examples:

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

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

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

power <0|1|?>

The "power" command turns the player on or off.

Examples:

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

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

signalstrength <?>

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

Examples:

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

connected <?>

Return the connected state of the player. HTTP and Squeezebox players will indicate 1 or 0 depending on if the TCP connection to the player is active. SLIMP3 players, since they use UDP always return 1.

Examples:

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

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<CR>"
> Response: "04:20:00:12:23:45 playlist play /music/abba/01_Voulez_Vous.mp3<CR>"

playlist add <item>

The "playlist add" command adds the specified song URL, playlist or directory contents to the end of the current playlist. Any 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<CR>"
> Response: "04:20:00:12:23:45 playlist add /music/abba/01_Voulez_Vous.mp3<CR>"

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

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<CR>"
> Response: "04:20:00:12:23:45 playlist insert /music/abba/01_Voulez_Vous.mp3<CR>"

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

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<CR>"
> Response: "04:20:00:12:23:45 playlist move 0 5<CR>"

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<CR>"
> Response: "04:20:00:12:23:45 playlist delete 5<CR>"

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<CR>"
> Response: "04:20:00:12:23:45 playlist resume abba<CR>"

playlist save <playlist>

Save 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. 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 save abba<CR>"
> Response: "04:20:00:12:23:45 playlist save abba<CR>"

playlist loadalbum <genre> <artist> <album>

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

Examples:

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

playlist addalbum <genre> <artist> <album>

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

Examples:

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

playlist clear

The "playlist clear" command removes any song that is on the playlist. If a song is currently playing, it is stopped.

Examples:

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

playlist 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<CR>"
> Response: "04:20:00:12:23:45 playlist index +1<CR>"

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

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

playlist genre ?
playlist artist ?
playlist album ?
playlist title ?
playlist duration ?
playlist path ?

The "playlist genre", "playlist artist", "playlist album", "playlist title", "playlist path" and "playlist duration" commands will return the requested information for a given song at an index position in the current playlist. The path may be a path to the file or a URL.

Examples:

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

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

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

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

> Request: "04:20:00:12:23:45 playlist path 3 ?<CR>"
> Response: "04:20:00:12:23:45 playlist path 3 <CR>"

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

playlist tracks ?

The "playlist tracks" command is used to obtain the the total number of tracks in the current playlist

Example:

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

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.

Example:

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

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

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

Example:

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

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

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

The "mixer volume - will return the current volume setting for the player <0-99)

Example:

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

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

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

mixer balance <-100 .. 100|+200 .. +200|?>
mixer base <0 .. 100|-100 .. +100|?>
mixer treble <0 .. 100|-100 .. +100|?>

Reserved for future implementation.

display <line1> <line2> <duration>
display ? ?

The "display" command specifies some text to be displayed on the player screen for a specified amount of time, or may be used to obtain the text that is currently displayed on the screen. A duration <in seconds> may be specified to indicate how long the text should remain on the screen.

Examples:

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

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

displaynow <line1> <line2> <duration>
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 ? ?<CR>"
> Response: "04:20:00:12:23:45 display Hello World<CR>"

pref <prefname> <prefvalue>
pref <prefname> ?

The "pref" command allows the caller to set and query the Slim Server's internal preferences values. Preference values are escaped with HTTP-style (percent) escaping..

Examples:

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

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

playerpref <prefname> <prefvalue>
playerpref <prefname> ?

The "playerpref" command allows the caller to set and query the Slim Server's internal player-specific preferences values. Preference values are escaped with HTTP-style (percent) escaping..

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"

debug <d_debugflag> ?
debug <d_debugflag> 0
debug <d_debugflag> 1
debug <d_debugflag>

The "debug" command allows the caller to query, clear, set or toggle the SlimServer'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 ?"
> Response: "debug d_files 0"

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

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

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

rescan

The "rescan" command allows the caller to have the SlimServer rescan its music library, reloading the music file information.

Examples:

> Request: "rescan"
> Response: "rescan"

> Request: "04:20:00:12:23:45 rescan"
> Response: "04:20:00:12:23:45 rescan"

button <buttoncode>

The "button" command simulates a button press from a Slim Devices infrared remote, and has the same effect on the player as receiving that IR command. Valid button codes correspond to the functions defined in the Default.map file: add", "brightness_down", "brightness_toggle", "brightness_up", "done", "down", "fire", "jump_fwd", "jump_rew", "left", "left_repeat", "menu_browse_album", "menu_browse_artist", "menu_browse_genre", "menu_browse_music", "menu_browse_playlists", "menu_plugins", "menu_home", "menu_now_playing", "menu_playlist", "menu_pop", "menu_search_album", "menu_search_artist", "menu_search_song", "menu_settings", "muting", "numberScroll_0", "numberScroll_1", "numberScroll_2", "numberScroll_3", "numberScroll_4", "numberScroll_5", "numberScroll_6", "numberScroll_7", "numberScroll_8", "numberScroll_9", "pause", "play", "play_0", "play_1", "playdisp_0", "playdisp_1", "playdisp_2", "playdisp_3", "playdisp_4", "playdisp_5", "playdisp_toggle", "power_off", "power_on", "power_toggle", "repeat_0", "repeat_1", "repeat_2", "repeat_toggle", "right", "right", "scan_end", "scan_fwd", "scan_rew", "search", "shuffle_off", "shuffle_on", "shuffle_toggle", "sleep", "slimtrisButtonHandler_add", "slimtrisButtonHandler_down", "slimtrisButtonHandler_left", "slimtrisButtonHandler_play", "slimtrisButtonHandler_right", "slimtrisButtonHandler_up", "stop", "textsize_large", "textsize_small", "textsize_toggle", "titleFormat", "up", "volume_down", & "volume_up".

Example:

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

exit

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

Examples:

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

[% PROCESS helpfooter.html %]