i found an tool that can get current playing song info in macos from the commandline,…
- User
i found an tool that can get current playing song info in macos from the commandline, but i dont know how to install it: github: https://github.com/kirtan-shah/nowplaying-cli
README.md: 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:
Ventura 13.1
Usage
nowplaying-cli command description get [propName1 propName2 … ] get now playing media properties get-raw get all non-nil now playing media properties in dictionary format play play the currently playing media regardless of current state pause pause the currently playing media regardless of current state togglePlayPause toggle play/pause based on current state next skip to next track previous go to previous track Examples
screenshot of examples in terminal Available properties native nowplaying-cli kMRMediaRemoteNowPlayingInfoTotalDiscCount totalDiscCount kMRMediaRemoteNowPlayingInfoShuffleMode shuffleMode kMRMediaRemoteNowPlayingInfoTrackNumber trackNumber kMRMediaRemoteNowPlayingInfoDuration duration kMRMediaRemoteNowPlayingInfoRepeatMode repeatMode kMRMediaRemoteNowPlayingInfoTitle title kMRMediaRemoteNowPlayingInfoPlaybackRate playbackRate kMRMediaRemoteNowPlayingInfoArtworkData artworkData kMRMediaRemoteNowPlayingInfoAlbum album kMRMediaRemoteNowPlayingInfoTotalQueueCount totalQueueCount kMRMediaRemoteNowPlayingInfoArtworkMIMEType artworkMIMEType kMRMediaRemoteNowPlayingInfoMediaType mediaType kMRMediaRemoteNowPlayingInfoDiscNumber discNumber kMRMediaRemoteNowPlayingInfoTimestamp timestamp kMRMediaRemoteNowPlayingInfoGenre genre kMRMediaRemoteNowPlayingInfoQueueIndex queueIndex kMRMediaRemoteNowPlayingInfoArtist artist kMRMediaRemoteNowPlayingInfoDefaultPlaybackRate defaultPlaybackRate kMRMediaRemoteNowPlayingInfoElapsedTime elapsedTime kMRMediaRemoteNowPlayingInfoTotalTrackCount totalTrackCount kMRMediaRemoteNowPlayingInfoIsMusicApp isMusicApp kMRMediaRemoteNowPlayingInfoUniqueIdentifier uniqueIdentifier Homebrew Install
TODO Build
clang nowplaying.mm -framework Cocoa -o nowplaying-cli -O3
files: nowplaying.mm Enums.h
- Assistant
Based on the README file, you can build and install the tool following these steps:
- First, make sure you have Xcode Command Line Tools installed on your macOS system. You can install them using the following command:
xcode-select --install- Next, clone the repository from GitHub:
git clone https://github.com/kirtan-shah/nowplaying-cli.git- Navigate to the cloned repository:
cd nowplaying-cli- Build the 'nowplaying-cli' tool using the provided command:
clang nowplaying.mm -framework Cocoa -o nowplaying-cli -O3- Now, you can use the 'nowplaying-cli' tool directly from the repository folder like this:
./nowplaying-cli <cmd>If you want to use the 'nowplaying-cli' tool from anywhere on your system, you can move it to
/usr/local/bin:sudo mv nowplaying-cli /usr/local/bin/
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.