|
| 1 | +# Spotify |
| 2 | + |
| 3 | +**Mode**: 🔑 OAuth API · **Domains**: `accounts.spotify.com`, `api.spotify.com` |
| 4 | + |
| 5 | +## Commands |
| 6 | + |
| 7 | +| Command | Description | |
| 8 | +|---------|-------------| |
| 9 | +| `opencli spotify auth` | Authenticate with Spotify and store tokens locally | |
| 10 | +| `opencli spotify status` | Show current playback status | |
| 11 | +| `opencli spotify play [query]` | Resume playback or search-and-play a track | |
| 12 | +| `opencli spotify pause` | Pause playback | |
| 13 | +| `opencli spotify next` | Skip to the next track | |
| 14 | +| `opencli spotify prev` | Skip to the previous track | |
| 15 | +| `opencli spotify volume <0-100>` | Set playback volume | |
| 16 | +| `opencli spotify search <query>` | Search Spotify tracks | |
| 17 | +| `opencli spotify queue <query>` | Add a track to the playback queue | |
| 18 | +| `opencli spotify shuffle <on|off>` | Toggle shuffle | |
| 19 | +| `opencli spotify repeat <off|track|context>` | Set repeat mode | |
| 20 | + |
| 21 | +## Usage Examples |
| 22 | + |
| 23 | +```bash |
| 24 | +# First-time setup |
| 25 | +opencli spotify auth |
| 26 | + |
| 27 | +# What is playing right now? |
| 28 | +opencli spotify status |
| 29 | + |
| 30 | +# Resume playback |
| 31 | +opencli spotify play |
| 32 | + |
| 33 | +# Search and immediately play a track |
| 34 | +opencli spotify play "Numb Linkin Park" |
| 35 | + |
| 36 | +# Search without playing |
| 37 | +opencli spotify search "Daft Punk" --limit 5 -f json |
| 38 | + |
| 39 | +# Queue a track |
| 40 | +opencli spotify queue "Get Lucky" |
| 41 | + |
| 42 | +# Playback controls |
| 43 | +opencli spotify pause |
| 44 | +opencli spotify next |
| 45 | +opencli spotify prev |
| 46 | +opencli spotify volume 35 |
| 47 | +opencli spotify shuffle on |
| 48 | +opencli spotify repeat track |
| 49 | +``` |
| 50 | + |
| 51 | +## Setup |
| 52 | + |
| 53 | +1. Create a Spotify app at <https://developer.spotify.com/dashboard> |
| 54 | +2. Add `http://127.0.0.1:8888/callback` to the app's Redirect URIs |
| 55 | +3. Fill in `SPOTIFY_CLIENT_ID` and `SPOTIFY_CLIENT_SECRET` in `~/.opencli/spotify.env` |
| 56 | +4. Run `opencli spotify auth` |
| 57 | + |
| 58 | +## Notes |
| 59 | + |
| 60 | +- Browser Bridge is not required. |
| 61 | +- Tokens are stored locally at `~/.opencli/spotify-tokens.json`. |
| 62 | +- Playback commands work best when you already have an active Spotify device/session. |
0 commit comments