A hackathon cli tool for Spotify, written in Rust.
I don't want to spend time finding music to listen to. I want to use existing playlists with a specific vibe and just play them.
git clone git@github.com:BlakeHolifield/spot.git
cd spot
cargo build --release
cp ./target/release/spot /usr/local/bin
spot needs to connect to Spotify’s API in order to function.
- Go to the Spotify dashboard
- Select
Create an app- You should be able to see
Client IDandClient Secret
- You should be able to see
- Click
Edit Settings - Add
http://localhost:8888/callbackto Redirect URIs - Scroll down, then click
Save - Expose three environment variables in an env file or your terminal:
export CLIENT_ID="yourid"export CLIENT_SECRET="yoursecret"export REDIRECT_URI="http://localhost:8888/callback"
- Run
spot play <playlist> or spot find <playlist> - Spotify will redirect you to a Spotify webpage asking for permissions.
- After accepting the permissions, you'll be redirected to localhost. The redirect URL should be parsed.
- If you see a web page with "Connection Refused", you can ignore it as
spotdoes not run a server.
- If you see a web page with "Connection Refused", you can ignore it as
- Finally, copy the URL and paste into the prompt in the terminal.
spot -h
spot play lofi
Spot uses $MENU to determine interaction with /dev/tty. By default, you will see a numbered list
of selections. You can do export MENU='fzf' to use fzf instead. You can find a full list of
supported menus at the interactor library repo
spot find 19th century villain
and then select a playlist
- Play a playlist chosen for you as the top result of your query (user created playlists are ranked higher)
- Find a playlist from the top 10 results of your query
- Pause
- Resume
- Shuffle on / off
- Skip forward / backward
- Show currently running track