A minimal Spotify CLI for you and your agent.
Install globally from this directory with uv:
uv tool install .To upgrade an existing global install:
uv tool install . --reinstallYou 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_IDSPOTIFY_CLIENT_SECRET
Fixed defaults:
- redirect URI:
http://127.0.0.1:8888/callback - auth file:
~/.spotify-cli.json
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 logoutDefaults:
searchsearches tracks unless--typeis setplaywith no query resumes playbackplay "query"plays the first search resultplay <id>treats the value as a Spotify ID for the selected--typeplay spotify:<type>:<id>plays that exact Spotify URI directly