[GH-ISSUE #429] Provide a cli arg based interface #180

Closed
opened 2026-02-28 14:47:34 +03:00 by kerem · 14 comments
Owner

Originally created by @clearnote01 on GitHub (May 3, 2020).
Original GitHub issue: https://github.com/Rigellute/spotify-tui/issues/429

I want to trigger commands that goes through spotify-tui but doesn't open the UI. For starters support for search/play/pause through command line would be really good to have.

spt -s --search "a man of wire" // returns top n results
spt -p --play "song name" // based on closest match, start playing this song
spt -t --toggle // toggle play pause

Originally created by @clearnote01 on GitHub (May 3, 2020). Original GitHub issue: https://github.com/Rigellute/spotify-tui/issues/429 I want to trigger commands that goes through spotify-tui but doesn't open the UI. For starters support for search/play/pause through command line would be really good to have. spt -s --search "a man of wire" // returns top n results spt -p --play "song name" // based on closest match, start playing this song spt -t --toggle // toggle play pause
kerem closed this issue 2026-02-28 14:47:34 +03:00
Author
Owner

@Rigellute commented on GitHub (May 4, 2020):

Could be an interesting addition 👍 , will require some architectural changes but is doable

<!-- gh-comment-id:623387812 --> @Rigellute commented on GitHub (May 4, 2020): Could be an interesting addition 👍 , will require some architectural changes but is doable
Author
Owner

@dvdmuckle commented on GitHub (May 17, 2020):

It would also be great to have something like spt --status to show the currently playing song.

As an aside, there are several tools that allow a CLI arg based interface for Spotify, but they're very fragmented and aren't all mutliplatform, and generally control Spotify in different ways (DBUS/MPRIS for Linux or oascript for Mac) as opposed to interfacing with the Spotify API.

<!-- gh-comment-id:629873729 --> @dvdmuckle commented on GitHub (May 17, 2020): It would also be great to have something like `spt --status` to show the currently playing song. As an aside, there are several tools that allow a CLI arg based interface for Spotify, but they're very fragmented and aren't all mutliplatform, and generally control Spotify in different ways (DBUS/MPRIS for Linux or oascript for Mac) as opposed to interfacing with the Spotify API.
Author
Owner

@Dragonsong3k commented on GitHub (Jul 19, 2020):

I want to trigger commands that goes through spotify-tui but doesn't open the UI. For starters support for search/play/pause through command line would be really good to have.

spt -s --search "a man of wire" // returns top n results
spt -p --play "song name" // based on closest match, start playing this song
spt -t --toggle // toggle play pause

Launching a playlist in shuffle mode would be great!
spt -p "some playlist name" -s ( --shuffle)

<!-- gh-comment-id:660588409 --> @Dragonsong3k commented on GitHub (Jul 19, 2020): > I want to trigger commands that goes through spotify-tui but doesn't open the UI. For starters support for search/play/pause through command line would be really good to have. > > spt -s --search "a man of wire" // returns top n results > spt -p --play "song name" // based on closest match, start playing this song > spt -t --toggle // toggle play pause Launching a playlist in shuffle mode would be great! spt -p "some playlist name" -s ( --shuffle)
Author
Owner

@dann-merlin commented on GitHub (Aug 19, 2020):

I think that sounds more like a separate program. Something like this script referenced by spotifyd's README, but more powerful.

<!-- gh-comment-id:675801055 --> @dann-merlin commented on GitHub (Aug 19, 2020): I think that sounds more like a separate program. Something like this [script](https://gist.github.com/wandernauta/6800547) referenced by spotifyd's README, but more powerful.
Author
Owner

@OrangeFran commented on GitHub (Oct 30, 2020):

I picked this up yesterday. Expect a demo this evening :)

<!-- gh-comment-id:719661535 --> @OrangeFran commented on GitHub (Oct 30, 2020): I picked this up yesterday. Expect a demo this evening :)
Author
Owner

@OrangeFran commented on GitHub (Oct 30, 2020):

Never used imgur, I hope it works: here.

<!-- gh-comment-id:719730818 --> @OrangeFran commented on GitHub (Oct 30, 2020): Never used imgur, I hope it works: [here](https://imgur.com/a/eE7ft1g).
Author
Owner

@OrangeFran commented on GitHub (Oct 30, 2020):

I actually did not have to change anything internally. Currently I'm not really happy with the cli.rs file, it seems so unordered. I have to look into that. If you want to try it out, you can use the cli branch on my fork.

<!-- gh-comment-id:719732087 --> @OrangeFran commented on GitHub (Oct 30, 2020): I actually did not have to change anything internally. Currently I'm not really happy with the cli.rs file, it seems so unordered. I have to look into that. If you want to try it out, you can use the cli branch on my fork.
Author
Owner

@OrangeFran commented on GitHub (Oct 31, 2020):

I did some huge changes to the cli:

There are three main subcommands: play to play a song, playback to interact with the playback and query to list and search categories. One of my favourite things is the fact that you can format almost any output with a simple string where %a -> artist, %b -> album, %t -> track, %h -> show, %f -> flags (like, shuffle, repeat), %p -> playlist, %d -> current device and %s -> playing status. I really hope it is intuitive enough.

<!-- gh-comment-id:720000347 --> @OrangeFran commented on GitHub (Oct 31, 2020): I did some huge changes to the cli: There are three main subcommands: `play` to play a song, `playback` to interact with the playback and `query` to list and search categories. One of my favourite things is the fact that you can format almost any output with a simple string where `%a` -> artist, `%b` -> album, `%t` -> track, `%h` -> show, `%f` -> flags (like, shuffle, repeat), `%p` -> playlist, `%d` -> current device and `%s` -> playing status. I really hope it is intuitive enough.
Author
Owner

@spenat28 commented on GitHub (Jan 21, 2021):

Good work, thanks i have one problem
--like does toggle the like
which makes it dangerous to use without looking into app first - which makes it unusable

Solution is:
--like to always add to liked songs not toggle like - to unlike them and add --dislike
OR:
provide any command to tell if song is already liked
spt pb --is_liked

<!-- gh-comment-id:764638628 --> @spenat28 commented on GitHub (Jan 21, 2021): Good work, thanks i have one problem --like does toggle the like which makes it dangerous to use without looking into app first - which makes it unusable Solution is: --like to always add to liked songs not toggle like - to unlike them and add --dislike OR: provide any command to tell if song is already liked spt pb --is_liked
Author
Owner

@OrangeFran commented on GitHub (Jan 21, 2021):

Would just updating the help menu be sufficient? In the tui s toggles the like as well.
Why would you prefer having a --like and a --dislike flag instead of one that just toggles?

<!-- gh-comment-id:764887668 --> @OrangeFran commented on GitHub (Jan 21, 2021): Would just updating the help menu be sufficient? In the tui `s` toggles the like as well. Why would you prefer having a `--like` and a `--dislike` flag instead of one that just toggles?
Author
Owner

@spenat28 commented on GitHub (Jan 21, 2021):

Well,
the thing is, you are listening to the song, and you are in terminal. You like it, so you want to add it to liked songs. More often than not, it is already in your liked songs. And you dislike it by accident.

So i would really prefer to have an option to alway like the song instead of a toggle or any way to find out from terminal command if song is already liked and skip the like programmatically.

<!-- gh-comment-id:764975834 --> @spenat28 commented on GitHub (Jan 21, 2021): Well, the thing is, you are listening to the song, and you are in terminal. You like it, so you want to add it to liked songs. More often than not, it is already in your liked songs. And you dislike it by accident. So i would really prefer to have an option to alway like the song instead of a toggle or any way to find out from terminal command if song is already liked and skip the like programmatically.
Author
Owner

@OrangeFran commented on GitHub (Jan 22, 2021):

This makes sense. I just remembered that it actually happened to me once. I'm working on it.

<!-- gh-comment-id:765458461 --> @OrangeFran commented on GitHub (Jan 22, 2021): This makes sense. I just remembered that it actually happened to me once. I'm working on it.
Author
Owner

@spenat28 commented on GitHub (Jan 22, 2021):

@OrangeFran Thank you!

<!-- gh-comment-id:765515131 --> @spenat28 commented on GitHub (Jan 22, 2021): @OrangeFran Thank you!
Author
Owner

@clearnote01 commented on GitHub (Jan 23, 2021):

Thanks @OrangeFran, closing this ticket.
This is much more comprehensive than what I expected, really love it!

<!-- gh-comment-id:766120723 --> @clearnote01 commented on GitHub (Jan 23, 2021): Thanks @OrangeFran, closing this ticket. This is much more comprehensive than what I expected, really love it!
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-tui#180
No description provided.