Spotify CLI for Openclaw

A robust command-line interface for controlling Spotify playback across your devices from a Linux or Raspberry Pi environment.

shawnpana
v1.0.0
Jan 27, 2026
1
2.4k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install spotify-cli

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install spotify-cli using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Spotify CLI?

The Spotify CLI is a specialized tool designed for developers and power users who want to manage their music without leaving the terminal. By utilizing the official Spotify Web API and the Spotipy Python library, this skill enables full control over playback on any active Spotify session, whether it is running on a phone, computer, or web player. As part of the Openclaw Skills ecosystem, it provides a high-performance interface for headless systems like the Raspberry Pi.

This tool is particularly valuable for creating automated environments where music is a core component of the user experience. It allows for searching tracks, managing queues, and monitoring playback status through simple bash commands, making it a perfect addition for those building custom dashboard or smart home integrations.

Spotify CLI Use Cases

  • Managing background music while working in a terminal-centric development workflow.
  • Controlling Spotify playback on a headless Raspberry Pi connected to speakers.
  • Automating music playback via shell scripts or system triggers.
  • Providing AI agents with a reliable interface to search and play specific songs accurately.

How Spotify CLI Works

  1. The CLI loads your Spotify Developer credentials from a local configuration file located in your home directory.
  2. Upon first run, it initiates an OAuth2 authentication flow, providing a URL for the user to authorize the application.
  3. Once authenticated, the skill stores a refresh token locally to maintain a persistent connection to the Spotify API.
  4. Commands issued via the terminal are translated into API requests that target the user's active Spotify Connect devices.
  5. The system utilizes a search-then-verify logic, especially when used by AI agents, to ensure the highest accuracy in track selection.

Spotify CLI Setup

1. Install Dependencies

pip3 install spotipy --break-system-packages

2. Configure Spotify Developer App

Register an application at the Spotify Developer Dashboard, setting the Redirect URI to http://127.0.0.1:8888/callback.

3. Create Configuration

mkdir -p ~/.config/spotify-cli
cat << EOF > ~/.config/spotify-cli/config
SPOTIPY_CLIENT_ID=your_client_id
SPOTIPY_CLIENT_SECRET=your_client_secret
SPOTIPY_REDIRECT_URI=http://127.0.0.1:8888/callback
EOF

4. Finalize Installation

sudo cp spotify /usr/local/bin/spotify
sudo chmod +x /usr/local/bin/spotify

Spotify CLI Data Schema & Taxonomy

The skill manages configuration and session data locally to ensure fast execution and security.

File Path Purpose
~/.config/spotify-cli/config Stores environment variables for API authentication.
~/.cache-* Stores temporary OAuth tokens for session persistence.
API Metadata Tracks results from searches including Track Names, Artist IDs, and URIs.

Spotify CLI Advanced Features

  • Device Switching: List and target specific Spotify Connect devices using the devices command.
  • AI-Optimized Workflow: Structured search-verify-play logic to handle fuzzy matching errors common in voice or agentic commands.
  • Status Monitoring: Real-time retrieval of current track metadata and playback progress.
  • Integration Ready: Designed to be easily wrapped by other Openclaw Skills for complex automation tasks.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*