$ show openclaw/spogo
spogo is a terminal-based Spotify client written in Go that provides full control over playback, library management, search, and user listening data. It authenticates via browser cookies (sp_dc/sp_t) instead of the official OAuth flow, allowing it to bypass rate limits by using Spotify's internal web API endpoints (Connect/GraphQL) alongside the public Web API. The architecture is modular with multiple engine backends (connect, web, auto, applescript) and a clean CLI interface built with Kong. It features robust output formatting (human, JSON, plain), comprehensive error handling with documented exit codes, and extensive test coverage. While the tool is highly functional and well-crafted, its reliance on undocumented internal Spotify APIs and webpack hash resolution introduces fragility that may require maintenance as Spotify's frontend evolves.
The LLM identified 3 files worth highlighting for reuse:
Provides a clean abstraction for formatting CLI output in human-readable, JSON, or plain text modes. Supports color themes and respects NO_COLOR/TERM=dumb. The Emit method dispatches based on format, making it easy to add new formats. This component is self-contained and could be extracted into any Go CLI project that needs structured output formatting.
Defines ExitError with specific exit codes (0-4) for different failure modes (auth, network, etc.) and a WrapExit helper. This pattern ensures consistent error reporting and scripting-friendly behavior. The error mapping is isolated and could be reused in any CLI application that needs structured error-to-exit-code mapping.
Implements a CookieSource interface with concrete implementations for reading from browser stores (via sweetcookie), from a file, or from a stub. This abstraction decouples cookie retrieval from authentication logic and could be reused in any project that needs to extract browser cookies for API authentication.