Skip to content

huwprosser/spotify-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spotify CLI

A minimal Spotify CLI for you and your agent.

Setup

Install globally from this directory with uv:

uv tool install .

To upgrade an existing global install:

uv tool install . --reinstall

How it works

You must have a spotify developer account and app setup to use this CLI. It is very easy to do. Install the cli and run 'spotify-cli auth', a link will be generated. Follow it. A tiny web browser will receive your spotify auth code and save it. You, or your agent, can then control your spotify from your terminal. By default, spotify will play on the most recent active spotify device.

Set these environment variables:

  • SPOTIFY_CLIENT_ID
  • SPOTIFY_CLIENT_SECRET

Fixed defaults:

  • redirect URI: http://127.0.0.1:8888/callback
  • auth file: ~/.spotify-cli.json

Usage

spotify-cli auth --open
spotify-cli search "foo fighters"
spotify-cli play "everlong"
spotify-cli play
spotify-cli play 3fMbdgg4jU18AjLCKBhRSm
spotify-cli play --type playlist 37i9dQZF1DXcBWIGoYBM5M
spotify-cli play spotify:track:3fMbdgg4jU18AjLCKBhRSm
spotify-cli play --type playlist spotify:playlist:37i9dQZF1DXcBWIGoYBM5M
spotify-cli pause
spotify-cli resume
spotify-cli next
spotify-cli previous
spotify-cli status
spotify-cli logout

Defaults:

  • search searches tracks unless --type is set
  • play with no query resumes playback
  • play "query" plays the first search result
  • play <id> treats the value as a Spotify ID for the selected --type
  • play spotify:<type>:<id> plays that exact Spotify URI directly

About

A simple CLI for spotify for you and your agent.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages