The current playlist

add {URI}

Adds the file URI to the playlist (directories add recursively). URI can also be a single file.

addid {URI} [POSITION]

Adds a song to the playlist (non-recursive) and returns the song id.

URI is always a single file or URL. POSITION is optional, a negative number means it is relative to the currently playing song in the playlist (if there is one). For example:

addid "foo.mp3"
Id: 999
OK
            

clear

Clears the current playlist.

delete {SONGPOS}

Deletes a song from the playlist.

deleteid {SONGID}

Deletes the song SONGID from the playlist

move [{FROM} | {START:END}] {TO}

Moves the song at FROM or range of songs at START:END to TO in the playlist. [3]

moveid {FROM} {TO}

Moves the song with FROM (songid) to TO (playlist index) in the playlist. If TO is negative, it is relative to the current song in the playlist (if there is one).

playlist

Displays the current playlist.

Note

Do not use this, instead use playlistinfo.

playlistfind {TAG} {NEEDLE}

Finds songs in the current playlist with strict matching.

playlistid {SONGID}

Displays a list of songs in the playlist. SONGID is optional and specifies a single song to display info for.

playlistinfo [[SONGPOS] | [START:END]]

Displays a list of all songs in the playlist, or if the optional argument is given, displays information only for the song SONGPOS or the range of songs START:END [3]

playlistsearch {TAG} {NEEDLE}

Searches case-sensitively for partial matches in the current playlist.

plchanges {VERSION}

Displays changed songs currently in the playlist since VERSION.

To detect songs that were deleted at the end of the playlist, use playlistlength returned by status command.

plchangesposid {VERSION}

Displays changed songs currently in the playlist since VERSION. This function only returns the position and the id of the changed song, not the complete metadata. This is more bandwidth efficient.

To detect songs that were deleted at the end of the playlist, use playlistlength returned by status command.

shuffle [START:END]

Shuffles the current playlist. START:END is optional and specifies a range of songs.

swap {SONG1} {SONG2}

Swaps the positions of SONG1 and SONG2.

swapid {SONG1} {SONG2}

Swaps the positions of SONG1 and SONG2 (both song ids).



[3] Ranges are supported since MPD 0.15