← Back to Skills Marketplace
ejatapibeda

ClawSpotify

by Muhammad Fahreza · GitHub ↗ · v1.0.3
cross-platform ⚠ suspicious
546
Downloads
1
Stars
1
Active Installs
4
Versions
Install in OpenClaw
/install clawspotify
Description
Control Spotify playback: play, pause, resume, skip, previous, restart, search, queue, set volume, shuffle, repeat, and view now-playing status.
README (SKILL.md)

\r \r

ClawSpotify 🎵\r

\r Control your Spotify playback directly from your OpenClaw agent or terminal. Works with both Free and Premium Spotify accounts.\r \r ---\r \r

📦 Installation\r

\r

Via ClawHub (recommended)\r

clawhub install clawspotify\r
```\r
\r
### Manual from GitHub\r
```bash\r
# Clone main skill\r
git clone https://github.com/ejatapibeda/ClawSpotify.git ~/.openclaw/workspace/skills/ClawSpotify\r
\r
# Create virtual environment\r
python3 -m venv ~/.venv-clawspotify\r
\r
# Install SpotAPI (modified version with session support)\r
git clone https://github.com/ejatapibeda/SpotAPI.git ~/.openclaw/workspace/skills/SpotAPI\r
~/.venv-clawspotify/bin/pip install -e ~/.openclaw/workspace/skills/SpotAPI\r
\r
# Create wrapper script\r
cat > ~/.local/bin/clawspotify \x3C\x3C 'EOF'\r
#!/bin/bash\r
VENV="/home/$(whoami)/.venv-clawspotify"\r
SCRIPT_DIR="/home/$(whoami)/.openclaw/workspace/skills/ClawSpotify"\r
exec "$VENV/bin/python" "$SCRIPT_DIR/scripts/spotify.py" "$@"\r
EOF\r
chmod +x ~/.local/bin/clawspotify\r
\r
# Ensure ~/.local/bin is in PATH\r
export PATH="$HOME/.local/bin:$PATH"\r
```\r
\r
### Dependencies\r
- Python 3.10+\r
- SpotAPI (custom version from ejatapibeda/SpotAPI)\r
- Active Spotify account (Free or Premium)\r
- Spotify app open on at least one device (PC/phone/web) for playback commands to work\r
\r
---\r
\r
## 🔐 First-Time Setup (Authentication)\r
\r
`clawspotify` authenticates using two session cookies from your browser (`sp_dc` and `sp_key`). You only need to do this **once per account**.\r
\r
### Step-by-step\r
\r
1. Open **[https://open.spotify.com](https://open.spotify.com)** in your browser and **log in**\r
2. Press **F12** to open DevTools\r
3. Go to **Application** tab → **Cookies** → `https://open.spotify.com`\r
4. Find and copy the value of **`sp_dc`**\r
5. Find and copy the value of **`sp_key`**\r
6. Run:\r
```bash\r
clawspotify setup --sp-dc "AQC..." --sp-key "07c9..."\r
```\r
\r
Session is saved to `~/.config/spotapi/session.json` and reused automatically.\r
\r
#### Multi-account support\r
```bash\r
clawspotify setup --sp-dc "..." --sp-key "..." --id "work"\r
clawspotify status --id "work"\r
```\r
\r
> **Note:** Cookies expire periodically. If commands fail with a 401 error, re-run setup with fresh cookies.\r
\r
---\r
\r
## 🎮 Commands\r
\r
### Now playing status\r
```bash\r
clawspotify status            # default account\r
clawspotify status --id work  # specific account\r
```\r
\r
### Search music (without playing)\r
```bash\r
clawspotify search "Bohemian Rhapsody"        # search tracks, show top 5\r
clawspotify search-playlist "Workout"         # search playlists, show top 5\r
```\r
\r
### Search and play\r
```bash\r
clawspotify play "Bohemian Rhapsody"          # play first result\r
clawspotify play "Bohemian Rhapsody" --index 2  # pick result #2 (0-indexed)\r
clawspotify play-playlist "Lofi Girl"         # play first playlist result\r
```\r
\r
### Playback controls\r
```bash\r
clawspotify pause\r
clawspotify resume\r
clawspotify skip                     # next track\r
clawspotify prev                     # previous track\r
clawspotify restart                  # restart from beginning\r
```\r
\r
### Queue\r
```bash\r
clawspotify queue "Stairway to Heaven"\r
clawspotify queue "spotify:track:3z8h0TU..."  # add by URI\r
```\r
\r
### Volume\r
```bash\r
clawspotify volume 50     # set to 50%\r
clawspotify volume 0      # mute\r
clawspotify volume 100    # max\r
```\r
\r
### Shuffle / Repeat\r
```bash\r
clawspotify shuffle on\r
clawspotify shuffle off\r
clawspotify repeat on\r
clawspotify repeat off\r
```\r
\r
---\r
\r
## 💡 Usage Tips\r
\r
- **Spotify must be open** on at least one device for playback commands to work. The skill transfers playback to a phantom device but needs an active session.\r
- **First run may be slow** (10-30 seconds) due to WebSocket handshake and device registration. Subsequent commands are faster.\r
- **Session identifier:** Default is `"default"`. Use `--id` flag to manage multiple Spotify accounts.\r
- **Search is fuzzy:** Use artist name + title for best results.\r
- **Output:** Commands print status messages (e.g., `Searching for "...", Playing: URI`).\r
\r
---\r
\r
## ⚠️ Troubleshooting\r
\r
### "No active Spotify device found"\r
- Open Spotify on any device (PC, phone, or web) and start playing something first.\r
- Ensure you're logged in with the same account as the cookies.\r
\r
### "spotapi is not installed" or import errors\r
- Verify virtual environment: `ls ~/.venv-clawspotify/bin/python`\r
- Reinstall SpotAPI: `~/.venv-clawspotify/bin/pip install -e ~/.openclaw/workspace/skills/SpotAPI`\r
\r
### 401 Unauthorized / Session expired\r
- Cookies (`sp_dc`, `sp_key`) expire. Re-run `clawspotify setup` with fresh cookies from browser.\r
\r
### Commands time out or hang\r
- The skill uses WebSockets for real-time state. If Spotify's API is slow, commands may take longer. Use longer timeout or background execution.\r
- Restart OpenClaw gateway to reload skill if it becomes unresponsive.\r
\r
### Wrapper not found (`command not found: clawspotify`)\r
- Ensure `~/.local/bin` is in your `PATH`: `echo $PATH`\r
- Or run directly: `~/.venv-clawspotify/bin/python ~/.openclaw/workspace/skills/ClawSpotify/scripts/spotify.py \x3Ccommand>`\r
\r
---\r
\r
## 📂 File Locations\r
\r
| Component | Path |\r
|-----------|------|\r
| Skill folder | `~/.openclaw/workspace/skills/ClawSpotify` |\r
| Wrapper script | `~/.local/bin/clawspotify` |\r
| Virtualenv | `~/.venv-clawspotify` |\r
| SpotAPI (editable) | `~/.openclaw/workspace/skills/SpotAPI` |\r
| Session credentials | `~/.config/spotapi/session.json` |\r
| Main script | `~/skills/ClawSpotify/scripts/spotify.py` |\r
\r
---\r
\r
## 🔧 Agent Implementation Notes\r
\r
When using this skill via OpenClaw agent:\r
\r
1. **Playback commands** (`play`, `pause`, `skip`, etc.) are asynchronous. The command returns once Spotify accepts the request. Actual playback may take a few seconds to start.\r
2. **Long-running operations:** Use background execution or extended timeout (15-30 seconds) for `play`, `search`, and `status` to avoid premature termination.\r
3. **Status query** may occasionally timeout due to WebSocket latency. Play commands are more reliable.\r
4. **Always check** Spotify app/device for actual playback state. The CLI reports what Spotify acknowledges.\r
5. If the skill becomes unresponsive, restart the OpenClaw gateway to clear WebSocket connections.\r
\r
---\r
\r
## 🌐 Platform Note\r
\r
- **Linux/macOS:** Works natively with bash.\r
- **Windows:** Requires WSL, Git Bash, or Cygwin to run the `clawspotify` bash script. Alternatively, run Python directly:\r
  ```bash\r
  python ~/.openclaw/workspace/skills/ClawSpotify/scripts/spotify.py play "song name"\r
  ```\r
\r
---\r
\r
**Version:** 1.0.1 (skill) | SpotAPI: 1.2.7 (custom)\r
**Homepage:** https://github.com/ejatapibeda/ClawSpotify\r
**Author:** Deli (OpenClaw agent) + ejatapibeda (original author)\r
Usage Guidance
This skill appears to do what it says, but it uses an unofficial auth method (copying sp_dc and sp_key browser cookies) and installs a custom SpotAPI library from a personal GitHub repo. Before installing: (1) Inspect the SpotAPI and spotify.py source yourself (or use a trusted fork) to ensure nothing exfiltrates stored cookies; (2) Treat sp_dc/sp_key as sensitive — do not paste them into untrusted terminals or share them; (3) Restrict permissions on ~/.config/spotapi/session.json (e.g., chmod 600); (4) Prefer an official OAuth flow or a disposable/test Spotify account if possible; (5) Consider running the skill in an isolated environment (container or dedicated VM) if you’re uncomfortable with installing third‑party code on your main system.
Capability Analysis
Type: OpenClaw Skill Name: clawspotify Version: 1.0.3 The skill is suspicious due to its explicit reliance on an external, custom GitHub repository (`https://github.com/ejatapibeda/SpotAPI.git`) for core functionality, including session management. The `SKILL.md` and `scripts/spotify.py` files instruct users to `git clone` and `pip install -e` this external dependency, which introduces a significant supply chain risk. While the provided `clawspotify` code itself does not exhibit direct malicious intent, the integrity of the skill is entirely dependent on the security of this unvetted external library, which handles sensitive Spotify session cookies (`sp_dc`, `sp_key`) stored in `~/.config/spotapi/session.json`.
Capability Assessment
Purpose & Capability
Name/description match the code and commands: the Python CLI and wrapper implement playback, search, queue, volume, etc. Requiring bash and python3 is reasonable. The one unusual design choice is authenticating via browser session cookies (sp_dc and sp_key) instead of an official OAuth flow — it is coherent with the stated goal but notable and sensitive.
Instruction Scope
SKILL.md and the CLI ask you to copy sp_dc and sp_key from the browser DevTools and run 'clawspotify setup' to write them to ~/.config/spotapi/session.json. The instructions do not ask to read unrelated files or network endpoints, but they explicitly instruct the user to extract and persist sensitive session cookies (full access tokens) which could be reused or exfiltrated if the installed code or environment is compromised.
Install Mechanism
There is no registry install spec; installation instructions clone two GitHub repos (ClawSpotify and a custom SpotAPI by the same author) and pip install an editable dependency. Downloading and running third‑party code from a personal GitHub account is traceable but unvetted and therefore a supply‑chain risk — expected for this approach but worth reviewing before proceeding.
Credentials
The skill does not request environment variables or unrelated credentials. It does, however, require you to supply and persist sensitive Spotify session cookies (sp_dc, sp_key) in a local config file. That is proportionate to the technique chosen (cookie‑based auth) but sensitive; you should treat those values like passwords and verify the code that stores/uses them.
Persistence & Privilege
Skill does not request elevated privileges, does not set always:true, and only writes its own config/session file and a virtualenv as documented. This level of persistence is typical and within the scope of a CLI skill.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install clawspotify
  3. After installation, invoke the skill by name or use /clawspotify
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.3
Expanded documentation and installation instructions - Added detailed installation and setup sections, including ClawHub and manual install guides. - Explained authentication and provided clearer multi-account setup steps. - Documented dependencies, troubleshooting tips, and typical file locations. - Included platform-specific notes and usage tips for improved user experience. - No code or command changes; SKILL.md documentation was substantially expanded.
v1.0.2
Manage active WebSocket connections - Timeout bug fixes.
v1.0.1
- Removed the install.sh script file. - Updated documentation to clarify authentication (using browser cookies, no API key required). - Stated compatibility with both Free and Premium Spotify accounts. - Expanded instructions for one-time setup and multi-account support. - Simplified and reorganized usage and command examples for better readability.
v1.0.0
- Initial release of clawspotify: control Spotify playback from OpenClaw. - Supports play, pause, resume, skip, previous, restart, and queue functions. - Search and play specific tracks or playlists; search results show top 5 options. - Get full now-playing info and control playback device. - Adjust volume, shuffle, and repeat settings directly. - Session setup required once; supports multiple Spotify accounts. - Compatible with macOS/Linux; requires Bash, Python 3, and extra setup for Windows.
Metadata
Slug clawspotify
Version 1.0.3
License
All-time Installs 1
Active Installs 1
Total Versions 4
Frequently Asked Questions

What is ClawSpotify?

Control Spotify playback: play, pause, resume, skip, previous, restart, search, queue, set volume, shuffle, repeat, and view now-playing status. It is an AI Agent Skill for Claude Code / OpenClaw, with 546 downloads so far.

How do I install ClawSpotify?

Run "/install clawspotify" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is ClawSpotify free?

Yes, ClawSpotify is completely free (open-source). You can download, install and use it at no cost.

Which platforms does ClawSpotify support?

ClawSpotify is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created ClawSpotify?

It is built and maintained by Muhammad Fahreza (@ejatapibeda); the current version is v1.0.3.

💬 Comments