Skip to content

saiaunghlyanhtet/spotify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎧 Spotify CLI

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

πŸš€ Installation

1. Clone the repo

git clone https://github.com/saiaunghlyanhtet/spotify.git
cd spotify

2. Install the script to user's bin

chmod +x spotify
mkdir -p ~/bin
cp spotify ~/bin

πŸ”§ Configuration

1. Copy the example file

mkdir -p ~/.config
cp spotify-cli.env.example ~/.config/spotify-cli.env

2. Edit and Put your Spotify API credentials

vi ~/.config/spotify-cli.env
SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=your_client_secret

πŸ”‘ Getting Spotify Client ID & Secret

  1. Go to the Spotify Developer Dashboard.
  2. Log in with your Spotify account.
  3. Click on "Create an App".
  4. Fill in the required details and create the app.
  5. You will find your Client ID and Client Secret on the app page.
  6. Set the Redirect URI to http://127.0.0.1:8888/callback in the app settings.
  7. Copy the Client ID and Client Secret to your spotify-cli.env file.

πŸ” Login

Run the following command to log in to your Spotify account:

spotify login

You will get a login URL. Open it β†’ log in β†’ copy the redirect URL β†’ paste it back into the terminal.

🎡 Usage

Play a song.

spotify play "don't look back in anger"

Pause playback.

spotify pause

Skip to the next track.

spotify next

Go back to the previous track.

spotify previous

About

Personal bash script to use spotify in cli with ease

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages