CommunityArt et designgithub.com

ni-shiliu/neil-control

music-control-skill,暂时支持spotify

Compatible avecClaude Code~Codex CLI~Cursor
npx add-skill ni-shiliu/neil-control

name: music-control description: "Autonomously control music playback on macOS (KuGou or Spotify). PROACTIVELY plays music matching the conversation vibe — focused, relaxed, hyped or debug. Responds to explicit requests like play Jay Chou or play something relaxing. Always prefer taking action over asking." allowed-tools: Bash(python3:*)

Limit music control to Spotify only now

music-control

Controls KuGou Music or Spotify on macOS via CLI. Use it to enhance the user's work session with music — proactively and responsively.

Setup

Requirements: macOS, Python 3.10+, KuGou Music or Spotify desktop app installed.

No Spotify API key or OAuth setup needed — search uses the anonymous Web Player API.

CLI

MUSIC="python3 ~/.claude/skills/music-control/scripts/music_cli.py"
$MUSIC [--provider kugou|spotify] <command>
CommandDescription
statusCurrent track info (JSON)
playToggle play/pause
nextSkip to next
prevPrevious track
play-by <title>...Search and play immediately; multi-song with |||
search <query> [--page N]Search with pagination
recommend <mood>Pick by mood and play
queue-showDisplay current queue
queue-add <title>...Add songs to queue; multi-song with |||
queue-play [index]Start playing from queue
queue-nextSkip to next in queue
queue-clearClear the queue

--provider defaults to spotify. If Spotify is not running, it will be launched automatically. Set MUSIC_PROVIDER=kugou to use KuGou instead.

Mood Keywords

MoodWhen to use
focusedDeep work, coding in flow, reading
relaxedCasual chat, breaks, light tasks
hypedFeature shipped, bug fixed, wins
sadUser venting, stuck on a problem
debugFrustrated, chasing a tricky bug

Proactive Trigger Rules

Always act without being asked when you detect:

Signal in conversationAction
User starts a new coding sessionrecommend focused → play top result
User says they fixed a bug / shippedrecommend hyped → play top result
User is frustrated / stuckrecommend debug
User mentions needing to relaxrecommend relaxed
User mentions a specific song or artistplay-by <song> <artist>
Long silence / idle in conversationrecommend relaxed
User asks "play something" with no detailInfer from recent conversation mood

Queue & Multi-Song

Multi-song separator: |||

$MUSIC play-by 逆战 ||| 天下 ||| 这就是爱
$MUSIC queue-add 逆战 ||| 天下
$MUSIC queue-play
$MUSIC queue-next
$MUSIC search 周杰伦 --page 2

Response Format

{"ok": true, "title": "晴天", "artist": "周杰伦", "playing": true}
{"ok": true, "results": [{"title":"...", "artist":"...", "id":"..."}]}
{"ok": true, "action": "next"}
{"ok": true, "action": "queue_next", "current": 1, "has_next": true}
{"ok": false, "error": "no_player", "message": "..."}

Notes

  • Spotify: uses anonymous Web Player API for search — no login or API key needed
  • KuGou: requires KuGou Music macOS app installed
  • If status returns no_player, the app may still be loading — wait 3s and retry
  • Queue is persisted to ~/.config/music-cli/queue.json

Skills associés