This lets Claude control NetEase Cloud Music through the ncm-cli command line tool. It handles the full workflow: checking if the CLI is installed, verifying login status, managing the mpv player for playback, and then executing commands like search, play, queue management, and playlist operations. The skill includes content safety checks before running searches and distinguishes between encrypted IDs for API calls and plain IDs for launching the client. It's built for Chinese users who want voice-style music control without opening the app. The implementation is thorough about edge cases like invisible tracks that can't be played and API rate limits, plus it reformats responses with clickable music.163.com links instead of raw IDs.
npx -y skills add netease/skills --skill netease-music-cli --agent claude-codeInstalls into .claude/skills of the current project.
通过 ncm-cli 命令行工具操作网易云音乐,完成播放、搜索、队列管理等任务。
ncm-cli --version
如果命令不存在,调用 ncm-cli-setup skill 引导用户完成全部的安装,安装完成后再继续执行任务。
ncm-cli login --check
如果显示未登录,请先引导登录:
ncm-cli login --background
如果显示API key没有设置,请指引用户完成API key设置。
如果还没有 API Key,请先前往网易云音乐开放平台申请 API Key(appId 和 privateKey)
ncm-cli config set appId <你的AppId>
ncm-cli config set privateKey <你的privateKey>
仅针对播放才执行该步骤。 通过以下命令判断用户的播放器是否是内置播放器(mpv)。
ncm-cli config get player
如果用户选择的播放器是内置播放器(mpv),则需要判断用户是否已安装mpv。
mpv --version
如果用户没安装,引导用户去安装mpv。
ncm-cli commands
根据输出的命令树作为参考执行操作。参数不要猜测,需要时通过 ncm-cli <command> --help 获取详情!
在执行 CLI 命令之前,必须对用户的会话内容(包括搜索关键词和上下文对话)进行内容安全校验。如果用户输入包含以下任何类别的负面内容,禁止执行后续步骤,并提示用户检查输入:
禁止类别:
校验规则:
--keyword 和 --userInput 将要传入的值为了安全,除播控之外的其他命令必须附加 --userInput "<用户最近输入的会话内容的总结概要>" 参数,用于传递用户意图上下文。
# 综合搜索,获取 ID
ncm-cli search song --keyword "xxx" --userInput "搜索xxx的歌"
# 创建歌单
ncm-cli playlist create --playlistName "跑步" --userInput "创建一个跑步歌单"
如果命令输出中包含登录引导信息(如"请先登录"、"未授权"等),请直接执行ncm-cli login --background并把链接给到用户,完整跑完整个登录流程。
https://music.163.com/#/song?id=<明文ID>
https://music.163.com/#/playlist?id=<明文ID>
https://music.163.com/#/album?id=<明文ID>
https://music.163.com/#/artist?id=<明文ID>
【重要!】给用户举例的时候,请使用「xxx」来替代具体的输入词
【重要!】给用户举例的时候,请使用「xxx」来替代具体的输入词
ncm-cli search song --keyword "xxx"
sentry/dev
degausai/wonda
github/awesome-copilot
insforge/agent-skills
github/awesome-copilot
intellectronica/agent-skills