[GH-ISSUE #467] Get Information of current playback from CLI #1200

Closed
opened 2026-03-14 13:55:30 +03:00 by kerem · 3 comments
Owner

Originally created by @vsantele on GitHub (Jun 14, 2024).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/467

Is your feature already implemented in the latest master?
No

Is your feature request related to a problem? Please describe.

I want to use spotify_player to get information of current song played via the CLI in order to use it via a script.

Describe the solution you'd like
I would like a command like spotify_player get playback or spotify_player playback info to get a json with playback information if it's available.

Additional context
I try to implement this myself, I easily get a result with current_playback. But I'm not sure where is the best place to put this command.

github.com/aome510/spotify-player@b180b6bab5/spotify_player/src/cli/client.rs (L89-L101)

Originally created by @vsantele on GitHub (Jun 14, 2024). Original GitHub issue: https://github.com/aome510/spotify-player/issues/467 **Is your feature already implemented in the latest `master`?** No **Is your feature request related to a problem? Please describe.** I want to use spotify_player to get information of current song played via the CLI in order to use it via a script. **Describe the solution you'd like** I would like a command like `spotify_player get playback` or `spotify_player playback info` to get a json with playback information if it's available. **Additional context** I try to implement this myself, I easily get a result with `current_playback`. But I'm not sure where is the best place to put this command. https://github.com/aome510/spotify-player/blob/b180b6bab5f5086496e8fb83e467320218289d5e/spotify_player/src/cli/client.rs#L89-L101
kerem 2026-03-14 13:55:30 +03:00
Author
Owner

@jStimpert0430 commented on GitHub (Jun 14, 2024):

You can actually do exactly that with 'get key playback'. I use it to parse state and album information currently.

https://github.com/aome510/spotify-player/issues/294#issuecomment-1831581074

I do wish there were easier aliases however for more common things like artist/trackname.

<!-- gh-comment-id:2168584636 --> @jStimpert0430 commented on GitHub (Jun 14, 2024): You can actually do exactly that with 'get key playback'. I use it to parse state and album information currently. https://github.com/aome510/spotify-player/issues/294#issuecomment-1831581074 I do wish there were easier aliases however for more common things like artist/trackname.
Author
Owner

@vsantele commented on GitHub (Jun 15, 2024):

I didn't know this, thank you.

The documentation for cli commands doesn't explain well the get command. I will check that.

Aliases can be a good idea, but it can also be more generic and add a select parameters to specify which fields we want in return. With that we could have something like spotify_player get current that return basic info like title, artists, durations... And it's only a shortcut to something like `spotify_player get key playback --select "title,artists,duration".

<!-- gh-comment-id:2170614897 --> @vsantele commented on GitHub (Jun 15, 2024): I didn't know this, thank you. The documentation for cli commands doesn't explain well the get command. I will check that. Aliases can be a good idea, but it can also be more generic and add a `select` parameters to specify which fields we want in return. With that we could have something like `spotify_player get current` that return basic info like title, artists, durations... And it's only a shortcut to something like `spotify_player get key playback --select "title,artists,duration".
Author
Owner

@aome510 commented on GitHub (Jun 17, 2024):

Thanks @jStimpert0430. I'll close this issue for now as spotify_player does provide a CLI command to get playback info

<!-- gh-comment-id:2174447037 --> @aome510 commented on GitHub (Jun 17, 2024): Thanks @jStimpert0430. I'll close this issue for now as `spotify_player` does provide a CLI command to get playback info
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-player#1200
No description provided.