Files
stef-openclaw-skills/skills/spotify/SKILL.md

59 lines
2.2 KiB
Markdown

---
name: spotify
description: Search Spotify tracks, create and manage playlists, and import songs from text files, M3U playlists, or music folders.
metadata: {"clawdbot":{"emoji":"music","requires":{"bins":["node"]}}}
---
# Spotify
Use this skill when the user wants to search Spotify tracks, create playlists, add or remove playlist tracks, or import songs from a text list, M3U/M3U8 playlist, or local music folder.
Use the local helper from the installed skill directory:
```bash
cd ~/.openclaw/workspace/skills/spotify
scripts/spotify --help
```
This skill uses the Spotify Web API with OAuth2 Authorization Code + PKCE. It does not use browser automation for Spotify operations and does not need a Spotify client secret.
Do not print token files or OAuth callback data. Use `--json` for machine-readable command output.
## Setup
```bash
mkdir -p ~/.openclaw/workspace/.clawdbot/credentials/spotify
chmod 700 ~/.openclaw/workspace/.clawdbot/credentials/spotify
$EDITOR ~/.openclaw/workspace/.clawdbot/credentials/spotify/config.json
cd ~/.openclaw/workspace/skills/spotify
scripts/setup.sh
```
`config.json`:
```json
{
"clientId": "your-spotify-client-id",
"redirectUri": "http://127.0.0.1:8888/callback"
}
```
## Commands
```bash
scripts/spotify status --json
scripts/spotify search "Radiohead Karma Police" --limit 3 --json
scripts/spotify list-playlists --limit 10 --json
scripts/spotify create-playlist "OpenClaw Mix" --description "Created by OpenClaw" --public --json
scripts/spotify add-to-playlist "<playlistId>" "spotify:track:..." --json
scripts/spotify remove-from-playlist "<playlistId>" "spotify:track:..." --json
scripts/spotify search-and-add "<playlistId>" "Radiohead Karma Police" --json
scripts/spotify import "/path/to/tracks.txt" --playlist "Imported Mix" --json
```
`--playlist NAME` creates a new private playlist by default. Use `--playlist-id ID` to update an exact existing playlist.
Current Spotify endpoints used by this skill include `/v1/me/playlists` and `/v1/playlists/{id}/items`; do not use the removed `/tracks` playlist mutation endpoints.
Spotify has no normal delete-playlist Web API operation. Ask before running live smoke tests that create playlists.