MPC(1)
๐ NAME ๐
mpc โ the manual page for mpc itself, bestie. That's it, that's the name. ๐
๐ธ DESCRIPTION ๐ธ
okay so picture this: mpc is a command-line client for the Music Player Daemon (MPD). It connects to a MPD and controls it according to the commands and arguments you pass to it. That's the whole vibe โ you type, MPD obeys. ๐
And here's the lil party trick: if you give it no command at all, it just prints the current status. Same energy as running mpc status. Lowkey iconic default behavior, ngl. โจ
๐ฆ SYNOPSIS ๐ฆ
mpc [options] <command> [--] [<arguments>]
After --, all parameters are considered to be arguments, not options, even if they start with a dash. So if you've got a cursed little argument that looks like a flag, -- is your bestie that protects it. ๐
โจ OPTIONS โจ
-f,--formatโ Configure the format used to display songs.
The metadata delimiters are:
%name%โ A name for this song. This is not the song title. The exact meaning of this tag is not well-defined. It is often used by badly configured internet radio stations with broken tags to squeeze both the artist name and the song title in one tag. ๐ญ%artist%โ Artist file tag%album%โ Album file tag%albumartist%โ Album Artist file tag%comment%โ Comment file tag (not enabled by default inmpd.conf'smetadata_to_use)%composer%โ Composer file tag%date%โ Date file tag%originaldate%โ Original Date file tag%disc%โ Disc file tag%genre%โ Genre file tag%performer%โ Performer file tag%title%โ Title file tag%track%โ Track file tag%time%โ Duration of file%file%โ Path of file, relative to MPD'smusic_directoryvariable%position%โ Queue track number%id%โ Queue track id number%prio%โ Priority in the (random) queue.%mtime%โ Date and time of last file modification%mdate%โ Date of last file modification%audioformat%โ The audio format of the song.
The [] operator is used to group output such that if no metadata delimiters are found or matched between [ and ], then none of the characters between [ and ] are output. & and | are logical operators for and and or. # is used to escape characters. Some useful examples for format are: "%file%" and "[[%artist% - ]%title%]|[%file%]". This command also takes the following defined escape sequences:
\โ backslash\[โ left bracket\]โ right bracket\aโ alert\bโ backspace\eโ escape\tโ tab\nโ newline\vโ vertical tab\fโ form-feed\rโ carriage return
If not given, the value of the environment variable MPC_FORMAT is used. ๐ซถ
--waitโ Wait for operation to finish (e.g. database update). Patience is a virtue, bestie. ๐ง--range=[START]:[END]โ Operate on a range (e.g. when loading a playlist).STARTis the first index of the range,ENDis the first index after the range (i.e. excluding).STARTandENDmay be omitted, making the range open to that end. Indexes start with zero. Zero-indexed fr fr. ๐ข--with-prioโ Show only songs that have a non-zero priority.-q,--quiet,--no-statusโ Prevents the current song status from being printed on completion of some of the commands. Shhh. ๐คซ--verboseโ Verbose output. It's giving main character energy, tell me everything. ๐--host=HOSTโ The MPD server to connect to. This can be a hostname, IPv4/IPv6 address, an absolute path (i.e. local socket) or a name starting with@(i.e. an abstract socket, Linux only).
To use a password, provide a value of the form "password@host".
If not given, the value of the environment variable MPD_HOST is used.
--port=PORT,-p PORTโ The TCP port of the MPD server to connect to.
If not given, the value of the environment variable MPD_PORT is used.
--partition=PARTITION,-a PARTITIONโ The partition of the MPD server to operate on.
If not given, the default partition is used.
๐ COMMANDS ๐
Commands can be used from the least unambiguous prefix (e.g insert or ins). Type less, slay more. ๐
๐ต Player Commands ๐ต
consume <on|off>โ Toggle consume mode if state (onoroff) is not specified.crossfade [<seconds>]โ Gets and sets the current amount of crossfading between songs (0disables crossfading).current [--wait]โ Show the currently playing song. With--wait,mpcwaits until the song changes (or until playback is started/stopped) before it queries the current song from the server. ๐งqueuedโ Show the currently queued (next) song. The up-next of it all. โญmixrampdb[<db>]โ gets and sets the volume level where songs carrying MixRamp tags get overlapped. Heads up bestie: this kills the fading that thecrossfadecommand does and just straight-up mixes the songs together.-50.0will effectively yeet any gaps into the void, and0.0will mash tracks together fr fr. The amount of overlap is capped by theaudio_buffer_sizeMPD configuration parameter, so don't go wild. ๐mixrampdelay[<seconds>]โ gets and sets the current amount of extra delay tacked onto the value computed from the MixRamp tags. And oop โ a negative value disables overlapping with MixRamp tags and restores the previous value ofcrossfade. So like, don't do that unless you mean it. ๐ญnextโ starts playing the next song on the queue. โญ๏ธpauseโ pauses playing.play<position>โ starts playing the song-number you specified. If none is specified, it plays number 1. periodt.prevโ starts playing the previous song. โฎ๏ธrandom<on|off>โ toggles random mode if the state (onoroff) isn't specified.repeat<on|off>โ toggles repeat mode if the state (onoroff) isn't specified.replaygain[<off|track|album>]โ sets the replay gain mode. With no arguments, it just prints the replay gain mode at you. ๐single<on|once|off>โ toggles single mode if the state (on,once, oroff) isn't specified. Fun lil detail:oncetoggles tooff. iykyk.seek[+-][<HH:MM:SS>]or<[+-]<0-100>%>โ seeks by hour, minute or seconds, and hours or minutes can be omitted. If you're seeking by percentage, it seeks within the current song in the specified manner. If a+or-is used, the seek happens relative to the current song position. Absolute seeking by default. ๐ฆseekthrough[+-][<HH:MM:SS>]โ seeks by hour, minute or seconds, hours or minutes can be omitted, relatively to the current position. If the duration exceeds the limit of the current song, the seek command proceeds to seek through the playlist until the duration is reached. If a+is used, the seek is forward. If a-is used, the seek is backward. Forward seeking by default. slay.stopโ stops playing.toggleโ toggles between play and pause. If stopped, it starts playing. But note: it does not support starting playback at a song number (useplayfor that).
๐ Queue Commands ๐
add<file>โ adds a song from the music database to the queue. It can also read input from pipes. Usempc add /to add all files to the queue. ๐insert<file>โ works similarly toadd, except it adds song(s) after the currently playing one instead of at the end. And when random mode is enabled, the new song is queued after the current song. โจclearโ empties the queue. bye ๐cropโ removes all songs except for the currently playing song. main character energy only.del<songpos>โ removes a queue number from the queue. Can also read input from pipes (0deletes the current playing song). ๐mv,move<from> <to>โ moves the song at position<from>to the position<to>in the queue.searchplay<type> <query> [<type> <query>]...โ searches the queue for a matching song and plays it.shuffleโ shuffles all songs on the queue. ๐ฒ
๐ Playlist Commands ๐
load<file>โ loads<file>as the queue. The option--rangemay be used to load only a portion of the file.lsplaylists:โ lists available playlists. (yes the colon is in the name, we don't make the rules ๐)playlist[<playlist>]โ lists all songs in<playlist>. If no<playlist>is specified, it lists all songs in the current queue.rm<file>โ deletes a specific playlist.save<file>โ saves the playlist as<file>.addplaylist<playlist> <file>โ adds a song from the music database to the playlist. The playlist will be created if it does not exist. Can also read input from pipes. ๐ซถdelplaylist<playlist> <songpos>โ removes the song at the given position from the playlist. Can also read input from pipes.moveplaylist<playlist> <from> <to>โ moves the song at the given<from>position to the<to>position in the playlist.renplaylist<playlist> <new playlist>โ renames a playlist. glow up โจclearplaylist<playlist>โ clears the playlist name (i.e. truncatesplaylist.m3u).
๐ง Database Commands ๐ง
listall[<file>]โ lists<file>from the database. If no file is specified, it lists all songs in the database.ls[<directory>]โ lists all files/folders in the directory. If no directory is specified, it lists all files in the music directory.lsdirs[<directory>]โ lists subdirectories of the directory. If no directory is specified, it lists subdirectories in the music directory.search<type> <query> [<type> <query>]...โ searches for substrings in song tags. You can throw in any number of tag type and query combinations. Possible tag types are:artist,album,title,track,name,genre,date,composer,performer,comment,disc,filename, orany(which matches any tag). ๐search<expression>โ searches with a filter expression, like this for example:
mpc search '((artist == "Kraftwerk") AND (title == "Metall auf
Metall"))'
Check the MPD protocol documentation for details. This syntax can be used with find and findadd as well. (Requires libmpdclient 2.16 and MPD 0.21)
find<type> <query> [<type> <query>]...โ same assearch, but tag values have to match the query exactly instead of doing a substring match. no fuzzy vibes here ๐findadd<type> <query> [<type> <query>]...โ same asfind, but it adds the result to the current queue instead of printing them. ๐list<type> [<type> <query>]... [group <type>]...โ returns a list of all tags of the given tag type. The optional search type/query limits results in a way similar tosearch. Results can be grouped by one or more tags. Example time:
mpc list album group artist
statsโ displays statistics about MPD. ๐update[--wait] [<path>]โ scans for updated files in the music directory. The optional parameter path (relative to the music directory) may limit the scope of the update.
With --wait, mpc waits until MPD has finished the update. ๐
rescan[--wait] [<path>]โ likeupdate, but it also rescans unmodified files. thorough queen.
๐ธ File Commands ๐ธ
albumart<file>โ downloads album art for the given song and writes it to stdout. ๐ผ๏ธreadpicture<file>โ downloads a picture embedded in the given song and writes it to stdout.
โญ Mount Commands โญ
mountโ lists all mounts.mount<mount-path> <storage-uri>โ creates a new mount: mounts a storage on the given path. Example:
mpc mount server nfs://10.0.0.5/mp3
mpc mount stick udisks://by-id-ata-FOO-part2
unmount<mount-path>โ removes a mount.listneighborsโ prints a list of "neighors" (i.e. automatically detected storages which can be mounted). This requires enabling at least one neighbor plugin inmpd.conf. Example:
$ mpc listneighbors
upnp://uuid:01234567-89ab-cdef-0123-456789abcdef/urn:schemas-upnp-org:service:ContentDirectory:1
udisks://by-id-dm-name-_dev_sdb3
udisks://by-id-ata-FOO-part2
ngl the typo "neighors" is in the original and we are keeping it, character for character, because that's the rule ๐ซก
๐ Sticker Commands ๐
The sticker command lets you get and set song stickers. cute, right?
sticker<file> set <key> <value>โ sets the value of a song sticker.sticker<file> get <key>โ prints the value of a song sticker.sticker<file> listโ lists all stickers of a song.sticker<file> delete <key>โ deletes a song sticker. ๐๏ธsticker<dir> find <key>โ searches for stickers with the specified name, below the specified directory.
๐ Output Commands ๐
volume[+-]<num>โ sets the volume to<num>(0-100). If+or-is used, then it adjusts the volume relative to the current volume.outputsโ lists all available outputs.disable[only] <output # or name> [...]โ disables the output(s); a list of one or more names or numbers is required. Ifonlyis the first argument, all other outputs are enabled.enable[only] <output # or name> [...]โ enables the output(s); a list of one or more names or numbers is required. Ifonlyis the first argument, all other outputs are disabled.toggleoutput<output # or name> [...]โ changes the status for the given output(s); a list of one or more names or numbers is required.moveoutput<output # or name>โ moves the given output to the current partition (see--partition). โจ
๐ Partition Commands ๐
partitionsโ lists all available partitions.makepart<name> [...]โ creates new partitions.delpart<name> [...]โ deletes partitions.
๐ฆ Client-to-client Commands ๐ฆ
channelsโ lists the channels that other clients have subscribed to.sendmessage<channel> <message>โ sends a message to the specified channel. ๐จwaitmessage<channel>โ waits for at least one message on the specified channel.subscribe<channel>โ subscribes to the specified channel and continuously receives messages.
โจ Other Commands โจ
idle[events]โ waits until an event occurs. Prints a list of event names, one per line. See the MPD protocol documentation for further information.
If you specify a list of events, only these events are considered.
idleloop[events]โ similar toidle, but it re-enters the "idle" state after events have been printed.
If you specify a list of events, only these events are considered.
status[format]โ with no argument, prints a three-line status output that's basically whatmpcwith no arguments gives you. If you hand it a format string, the delimiters get processed exactly the same way they are for metadata. (Peep the-foption in Options, bestie ๐ )
Here's every delimiter you can use, no gatekeeping:
%totaltime%โ the total duration of the song.%currenttime%โ the time that the client is currently at.%percenttime%โ the percentage of time elapsed for the current song.%songpos%โ the position of the current song within the playlist.%length%โ the number of songs within the playlist.%state%โ either'playing','paused'or'stopped'.%volume%โ the current volume spaced out to 4 characters including a percent sign.%random%โ current status of random mode.'on'or'off'.%repeat%โ current status of repeat mode.'on'or'off'.%single%โ current status of single mode.'on','once', or'off'.%consume%โ current status of consume mode.'on'or'off'.%kbitrate%โ the bit rate in kbps for the current song.%audioformat%โ the audio format which MPD is currently playing as'samplerate:bits:channels'.%samplerate%โ the sample rate in Hz extracted from the current MPD audio format.%bits%โ the number of significant bits per sample size extracted from the current MPD audio format.%channels%โ the number of channels extracted from the current MPD audio format.versionโ reports the version of the protocol spoken, not the real version of the daemon. Yes, that distinction is real and it matters, don't @ me ๐ซถ
๐ ENVIRONMENT VARIABLES ๐
okay so listen โ all environment variables are overridden by any values you specify via command line switches. CLI stays winning, periodt ๐
MPC_FORMATโ configure the format used to display songs. See option--format.MPD_HOSTโ the MPD server to connect to. See option--host.MPD_PORTโ the TCP port of the MPD server to connect to. See option--port.
๐ BUGS ๐
Report bugs on https://github.com/MusicPlayerDaemon/mpc/issues โ the devs literally want to hear it, fr fr.
Since MPD uses UTF-8, mpc needs to convert characters to the charset used by the local system. If you get character conversion errors when you're running mpc you probably need to set up your locale. This is done by setting any of the LC_CTYPE, LANG or LC_ALL environment variables (LC_CTYPE only affects character handling).
not the locale drama again ๐ญ but yeah, fix your locale and the cursed characters go away
๐ SEE ALSO ๐
๐ AUTHOR ๐
See https://raw.githubusercontent.com/MusicPlayerDaemon/mpc/master/AUTHORS
Max Kellermann
ยฉ๏ธ COPYRIGHT ยฉ๏ธ
Copyright 2003-2021 The Music Player Daemon Project
and that's the whole page bestie, you ate that ๐ this was MPC(1), version 0.35, dated Apr 08, 2024 โ go forth and control your music like the main character you are ๐
โจ๐ธ
๐ฆ where this page comes from
- ubuntu noble: mpc 0.35-1build1 ยท GPL-2.0-or-later
- ubuntu questing: mpc 0.35-1build1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms