Power CLI using Spotify browser cookies or official OAuth. Search, control playback, manage library/playlists, and script with JSON/plain output.
Product direction and compatibility policy: VISION.md.
- Search tracks, albums, artists, playlists, shows, episodes
- Playback control: play/pause/next/prev/seek/volume/shuffle/repeat
- Play artists (starts with top tracks)
- Queue management
- Library management (save/remove/follow)
- User listening data: top tracks by Spotify affinity and available recent plays
- Playlist management (create/add/remove/list)
- Device selection and status
- Browser cookie import via
sweetcookie - Official Spotify Authorization Code OAuth with PKCE, refresh tokens, and a secure per-profile token cache
- Explicit
--auth cookies|oauthselection for Web API requests --jsonand--plainfor scripting- Colorized human output (respects
NO_COLOR,TERM=dumb,--no-color) - Engine switch:
auto(connect → web → local Spotify.app for playback on macOS),connect(internal endpoints),web(Web API endpoints; search/info/playback fall back to connect on rate limit)
Cookie auth remains the default because Spotify's official Web API has strict rate limits that can make it impractical for agents and automation. Browser cookies let spogo use the same internal endpoints as the Spotify web player for catalog search, item lookup, library listing, listening history, and most playback and playlist operations:
- Fewer public-API rate limits - Most reads and playback use the same internal endpoints as open.spotify.com
- No app registration - No need to create a Spotify Developer app
- Full functionality - Access to everything the web player can do
- Agent-friendly - Perfect for AI assistants and automation scripts
Import your cookies once with sweetcookie and you're good to go (defaults to Chrome).
Some operations still require Spotify's public Web API: saving/removing library tracks or albums, following/unfollowing artists, creating playlists, artist-top-track lookups used by artist playback, and certain device transfers or playback fallbacks. Explicit --engine web also uses the public API. These paths can return 429; when Spotify supplies a cooldown, spogo reports its retry-after hint, which can be several hours.
For a cookie-free Web API setup, spogo also supports Spotify's official Authorization Code flow with PKCE:
spogo auth oauth login --client-id YOUR_SPOTIFY_CLIENT_ID
spogo --engine web --auth oauth search track "weezer"OAuth never uses a client secret. Connect and internal endpoints still require browser cookies; selecting OAuth changes the Web API token provider, not the Connect protocol.
brew install steipete/tap/spogogo install github.com/steipete/spogo/cmd/spogo@latestspogo auth import --browser chrome
spogo auth import --browser chrome --browser-profile "Profile 1"
spogo search track "weezer" --limit 5
spogo play spotify:track:7hQJA50XrCWABAu5v6QZ4i
spogo statusspogo [global flags] <command> [args]Global flags:
--config <path>config file path--profile <name>profile name--timeout <dur>request timeout (default 10s)--market <cc>market country code--language <tag>language/locale (defaulten)--device <name|id>target device--engine <auto|web|connect|applescript>API engine (defaultconnect,applescriptis macOS-only)--auth <cookies|oauth>Web API authentication (defaultcookies)--spotify-client-id <id>public Spotify application client ID--spotify-redirect-uri <uri>registered loopback OAuth redirect URI--json/--plain--no-color-q, --quiet/-v, --verbose/-d, --debug
Env overrides:
SPOGO_TOTP_SECRET_URLoverride TOTP secret source (http(s) orfile://...)SPOGO_CONNECT_VERSIONoverride connect client version sent to playback endpoints
Commands:
completion bash|zsh|fishauth status|import|paste|clearauth oauth login|status|clearsearch track|album|artist|playlist|show|episodetrack info,album info,artist info,playlist info,show info,episode infoplay [<id|url>] [--type ...] [--shuffle],pause,next,prev,seek,volume,shuffle,repeat,statusqueue add|showlibrary tracks|albums|artists|playlistsuser top-tracks|historyplaylist create|add|remove|tracksdevice list|set
Full spec: docs/spec.md.
Cookie auth is the default. Import cookies once:
spogo auth import --browser chromeDefaults: Chrome + Default profile. Cookies are stored under your config directory (per profile).
If import still fails, spogo now surfaces browser-store warnings instead of only printing no cookies found.
If WSL cookie import/decryption is broken, paste cookies from Chrome DevTools:
- Developer Tools -> Application tab -> Cookies ->
https://open.spotify.com - Copy
sp_dc(required),sp_key(optional),sp_t(recommended for connect playback) - Run:
spogo auth pasteNon-interactive:
printf '%s\n%s\n' "sp_dc=..." "sp_t=..." | spogo auth paste --no-inputOfficial OAuth is available for the Web API client. Register http://127.0.0.1:8888/callback in a Spotify developer application, then run spogo auth oauth login --client-id .... See Auth for scopes, storage, environment variables, and the exact Connect/OAuth interaction.
autotries connect first, then falls back to web on unsupported features or rate limits.- On macOS, playback status and playback controls can recover through the local Spotify.app using AppleScript after remote failure. Authentication failures skip the other remote provider; local recovery remains available when cookies are unavailable. Search, library, playlists, queues, and devices never use this local fallback.
connectuses Spotify's internal connect-state endpoints for playback control.- Auth/session data and the last active playback route are cached per profile so repeated playback commands avoid a full Connect state refresh when the route is still valid.
- Search/info, followed artists, saved albums/tracks, playlists, top tracks, and recent listening history prefer internal endpoints; catalog lookups fall back to the Web API if their internal operation cannot be resolved.
webuses Web API endpoints; search/info/playback auto-fallback to connect when rate limited.
- Human output by default
--plainfor line-oriented output--jsonfor structured output
This tool interacts with Spotify's web endpoints. Use responsibly and in accordance with Spotify's Terms of Service.
MIT
