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 in mpd.conf's metadata_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's music_directory variable
  • %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). START is the first index of the range, END is the first index after the range (i.e. excluding). START and END may 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 (on or off) is not specified.
  • crossfade [<seconds>] โ€” Gets and sets the current amount of crossfading between songs (0 disables crossfading).
  • current [--wait] โ€” Show the currently playing song. With --wait, mpc waits 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 the crossfade command does and just straight-up mixes the songs together. -50.0 will effectively yeet any gaps into the void, and 0.0 will mash tracks together fr fr. The amount of overlap is capped by the audio_buffer_size MPD 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 of crossfade. 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 (on or off) isn't specified.
  • repeat <on|off> โ€” toggles repeat mode if the state (on or off) 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, or off) isn't specified. Fun lil detail: once toggles to off. 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 (use play for that).

๐ŸŒˆ Queue Commands ๐ŸŒˆ

  • add <file> โ€” adds a song from the music database to the queue. It can also read input from pipes. Use mpc add / to add all files to the queue. ๐Ÿ’–
  • insert <file> โ€” works similarly to add, 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 (0 deletes 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 --range may 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. truncates playlist.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, or any (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 as search, 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 as find, 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 to search. 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>] โ€” like update, 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 in mpd.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. If only is 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. If only is 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 to idle, 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 what mpc with 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 -f option 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 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