name: spotify description: 在 macOS 上控制 Spotify 播放。播放/暂停、切换曲目、控制音量、播放艺术家/专辑/播放列表。当用户要求播放音乐、控制 Spotify、切换歌曲或调整 Spotify 音量时使用。 metadata: {“clawdbot”:{“emoji”:“🎵”,“requires”:{“bins”:[“spotify”],“os”:“darwin”},“install”:[{“id”:“brew”,“kind”:“brew”,“packages”:[“shpotify”],“bins”:[“spotify”],“label”:“安装 Spotify CLI (brew)”}]}}
Spotify CLI
在 macOS 上控制 Spotify。无需 API 密钥。
命令
spotify play # 恢复播放
spotify pause # 暂停/切换
spotify next # 下一曲
spotify prev # 上一曲
spotify stop # 停止
spotify vol up # 音量 +10%
spotify vol down # 音量 -10%
spotify vol 50 # 设置音量为 50%
spotify status # 当前曲目信息
按名称播放
- 在网络上搜索 Spotify URL:
"Daft Punk" site:open.spotify.com - 从 URL 中获取 ID:
open.spotify.com/artist/4tZwfgrHOc3mvqYlEYSvVi→ ID 为4tZwfgrHOc3mvqYlEYSvVi - 使用 AppleScript 播放:
# 艺术家
osascript -e 'tell application "Spotify" to play track "spotify:artist:4tZwfgrHOc3mvqYlEYSvVi"'
# 专辑
osascript -e 'tell application "Spotify" to play track "spotify:album:4m2880jivSbbyEGAKfITCa"'
# 曲目
osascript -e 'tell application "Spotify" to play track "spotify:track:2KHRENHQzTIQ001nlP9Gdc"'
注意事项
- 仅限 macOS - 使用 AppleScript
- Spotify 桌面应用程序必须正在运行
- 可通过 Spotify Connect 与 Sonos 配合使用