Home

Awesome

nowplaying-cli

nowplaying-cli is a macOS command-line utility for retrieving currently playing media, and simulating media actions.

Use nowplaying-cli to get song information and play/pause your media through an easy to use CLI!

Disclaimer: nowplaying-cli uses private frameworks, which may cause it to break with future macOS software updates.

Tested and working on:

Installation

Homebrew

You can install nowplaying-cli using Homebrew.

brew install nowplaying-cli

Build from source

Clone the repository and run make to build the binary. You can then move the binary to your desired location.

make
mv nowplaying-cli ~/.local/bin

Usage

nowplaying-cli <cmd>

commanddescription
get [propName1 propName2 ... ]get now playing media properties
get-rawget all non-nil now playing media properties in dictionary format
playplay the currently playing media regardless of current state
pausepause the currently playing media regardless of current state
togglePlayPausetoggle play/pause based on current state
seek <seconds>seek to a specific time in the currently playing media
nextskip to next track
previousgo to previous track

Examples

screenshot of examples in terminal

Available properties

nativenowplaying-cli
kMRMediaRemoteNowPlayingInfoTotalDiscCounttotalDiscCount
kMRMediaRemoteNowPlayingInfoShuffleModeshuffleMode
kMRMediaRemoteNowPlayingInfoTrackNumbertrackNumber
kMRMediaRemoteNowPlayingInfoDurationduration
kMRMediaRemoteNowPlayingInfoRepeatModerepeatMode
kMRMediaRemoteNowPlayingInfoTitletitle
kMRMediaRemoteNowPlayingInfoPlaybackRateplaybackRate
kMRMediaRemoteNowPlayingInfoArtworkDataartworkData
kMRMediaRemoteNowPlayingInfoArtworkDataWidthartworkDataWidth
kMRMediaRemoteNowPlayingInfoArtworkDataHeightartworkDataHeight
kMRMediaRemoteNowPlayingInfoAlbumalbum
kMRMediaRemoteNowPlayingInfoTotalQueueCounttotalQueueCount
kMRMediaRemoteNowPlayingInfoArtworkMIMETypeartworkMIMEType
kMRMediaRemoteNowPlayingInfoMediaTypemediaType
kMRMediaRemoteNowPlayingInfoDiscNumberdiscNumber
kMRMediaRemoteNowPlayingInfoTimestamptimestamp
kMRMediaRemoteNowPlayingInfoGenregenre
kMRMediaRemoteNowPlayingInfoQueueIndexqueueIndex
kMRMediaRemoteNowPlayingInfoArtistartist
kMRMediaRemoteNowPlayingInfoDefaultPlaybackRatedefaultPlaybackRate
kMRMediaRemoteNowPlayingInfoElapsedTimeelapsedTime
kMRMediaRemoteNowPlayingInfoTotalTrackCounttotalTrackCount
kMRMediaRemoteNowPlayingInfoIsMusicAppisMusicApp
kMRMediaRemoteNowPlayingInfoUniqueIdentifieruniqueIdentifier