A simple command-line tool to control Spotify playback using Bash.
Features:
- π Search for songs
βΆοΈ Play tracks- βΈοΈ Pause
- βοΈ Next / Previous
- π OAuth-based login
- π§ Works on Linux
git clone https://github.com/saiaunghlyanhtet/spotify.git
cd spotifychmod +x spotify
mkdir -p ~/bin
cp spotify ~/binmkdir -p ~/.config
cp spotify-cli.env.example ~/.config/spotify-cli.envvi ~/.config/spotify-cli.env
SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=your_client_secret- Go to the Spotify Developer Dashboard.
- Log in with your Spotify account.
- Click on "Create an App".
- Fill in the required details and create the app.
- You will find your Client ID and Client Secret on the app page.
- Set the Redirect URI to
http://127.0.0.1:8888/callbackin the app settings. - Copy the Client ID and Client Secret to your
spotify-cli.envfile.
Run the following command to log in to your Spotify account:
spotify loginYou will get a login URL. Open it β log in β copy the redirect URL β paste it back into the terminal.
Play a song.
spotify play "don't look back in anger"Pause playback.
spotify pauseSkip to the next track.
spotify nextGo back to the previous track.
spotify previous