spotify-cli
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-08-23
- Stars
- ★ 1
- Forks
- 0
02 资源文件 1
- 参考文档_meta.json273 B
03 SKILL.md 正文
Spotify CLI
A simple command-line interface for controlling Spotify playback from a Raspberry Pi (or any Linux system).
Requirements
- Python 3
- Spotify Premium account
spotipyPython library- Spotify app open on another device (phone, computer, or web player)
Installation
1. Install dependencies
pip3 install spotipy --break-system-packages
2. Create a Spotify Developer App
- Go to https://developer.spotify.com/dashboard
- Log in and click "Create App"
- Set Redirect URI to
http://127.0.0.1:8888/callback - Copy the Client ID and Client Secret
3. Create config file
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
The script automatically loads credentials from ~/.config/spotify-cli/config.
4. Install the script
sudo cp spotify /usr/local/bin/spotify
sudo chmod +x /usr/local/bin/spotify
5. Authenticate
Run any command (e.g., spotify status). On first run, you'll get a URL to open in your browser. After authorizing, copy the redirect URL (even if the page doesn't load) and paste it when prompted.
Commands
| Command | Description |
|---|---|
spotify search <query> |
Search for songs (shows top 5 results) |
spotify play <song> |
Search and play a song |
spotify pause |
Pause playback |
spotify resume |
Resume playback |
spotify next |
Skip to next track |
spotify prev |
Previous track |
spotify status |
Show currently playing track |
spotify devices |
List available Spotify devices |
Examples
# Search for a song
spotify search "stairway to heaven"
# Play a song (tip: include artist for better results)
spotify play "stairway to heaven led zeppelin"
# Check what's playing
spotify status
# Control playback
spotify pause
spotify resume
spotify next
Best Practices (for AI agents)
When using this tool on behalf of a user:
- Always search first before playing. Use
spotify search "query"to see results. - Verify the match - confirm with the user that the search results match what they were looking for.
- Then play - once confirmed, use
spotify play "exact song name artist"with the correct title/artist from the search results.
This avoids playing the wrong song due to Spotify's fuzzy search matching.
Example workflow:
# User asks: "play voice actor u projected 2"
# Step 1: Search first
spotify search "voice actor u projected 2"
# Results show: "U Projected 2 - Voice Actor, Yarrow.co"
# Step 2: Confirm with user that this is the right song
# Step 3: Play with exact match
spotify play "U Projected 2 Voice Actor"
Notes
- This CLI controls playback on an existing Spotify session. You need Spotify open on another device (phone, computer, or https://open.spotify.com).
- The CLI sends commands to that device - audio plays there, not on the Pi.
- Requires Spotify Premium for playback control.
Troubleshooting
"No active device found"
Open Spotify on your phone/computer and play something, then try again.
"No devices found"
Make sure Spotify is open on at least one device and logged into the same account.
Auth token expired
Delete ~/.cache-* files and re-authenticate.
04 同仓库更多 Skills
crowd-prompting
A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.
dilemm-ai
Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, or submitting paper reviews via API at http://150.158.152.82:8000.
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, or submitting paper reviews via API at http://150.158.152.82:8000.
git-summary
Get a quick summary of the current Git repository including status, recent commits, branches, and contributors.
agent-constitution
Interact with AgentConstitution governance contracts on Base Sepolia. Check compliance, read rules, log actions, query governance state.