A GitHub CLI extension for controlling Spotify from the terminal.
gh extension install maxbeizer/gh-spotify- Go to developer.spotify.com/dashboard and log in
- Click "Create app"
- Fill in any name and description
- Under Redirect URIs, enter exactly:
http://127.0.0.1:8818/callback⚠️ You must use127.0.0.1, notlocalhost. Spotify rejectslocalhostas insecure. - Under "Which API/SDKs are you planning to use?", check Web API
- Agree to the terms and click Save
gh spotify authPaste your Client ID (found on your app's settings page) when prompted. The command will open your browser to authorize the app.
Note: Spotify Premium is required for playback control (play, pause, next, etc.). Free-tier accounts can use read-only commands like
nowanddevices.
| Command | Description |
|---|---|
gh spotify auth |
Authenticate with Spotify |
gh spotify now |
Show currently playing track |
gh spotify play |
Resume playback |
gh spotify pause |
Pause playback |
gh spotify next |
Skip to next track |
gh spotify prev |
Go to previous track |
gh spotify search <query> |
Search tracks, albums, artists |
gh spotify playlist |
Browse your playlists |
gh spotify queue [uri] |
View or add to queue |
gh spotify devices |
List playback devices |
gh spotify device <name> |
Switch playback device |
gh spotify volume <0-100> |
Set volume |
gh spotify shuffle [on|off] |
Toggle shuffle |
gh spotify repeat [off|track|context] |
Set repeat mode |
gh spotify art |
ASCII album art |
- GitHub CLI 2.0+
- Spotify Premium account (required for playback control)
- A Spotify Developer app (free to create)
MIT