ncm-cli-setup

Original🇨🇳 Chinese
Translated
1 scripts

Install and configure ncm-cli (NetEase Cloud Music CLI tool). Use this skill when users need to install ncm-cli, configure API Key, install mpv player, or troubleshoot installation issues.

6installs
Added on

NPX Install

npx skill4agent add netease/skills ncm-cli-setup

Tags

Translated version includes tags in frontmatter

SKILL.md Content (Chinese)

View Translation Comparison →

ncm-cli Installation and Configuration

ncm-cli is a CLI tool for NetEase Cloud Music (supports music search, playback control, playlist management, and TUI player).

Installation Process

Step 1: Install ncm-cli and mpv

1.1 Install ncm-cli

bash
npm install -g @music163/ncm-cli
Verify installation:
bash
ncm-cli --version

1.2 Install mpv

Playback functionality requires the mpv player. First check if it is already installed:
bash
mpv --version
macOS / Windows: If not installed, run the installation script directly:
bash
python3 scripts/install_mpv.py
Linux: Ask the user if playback functionality is needed:
  • If it's a desktop environment and local playback is required → run
    python3 scripts/install_mpv.py
  • If it's a server environment and playback is not needed → skip, commands like search/playlist can still be used normally
The installation script will automatically identify the package manager:
  • macOS: Homebrew (
    brew install mpv
    ) or MacPorts
  • Linux: apt / dnf / pacman / zypper
  • Windows: winget / Chocolatey / Scoop

Step 2: Configure API Key

Using ncm-cli requires setting the API Key first:
bash
ncm-cli config set appId <your AppId>
ncm-cli config set privateKey <your PrivateKey>
If you don't have an API Key yet, please go to NetEase Cloud Music Open Platform to apply for an API Key (appId and privateKey).

Step 3: Configure Default Player

Ask the user to select the default player:
  • mpv (built-in player): Lightweight, cross-platform, requires completing mpv installation in Step 1 first
  • orpheus (Cloud Music App): Calls the local NetEase Cloud Music client for playback, only supports macOS
Execute according to the user's selection:
bash
ncm-cli config set player mpv      # Select built-in player
ncm-cli config set player orpheus  # Select Cloud Music App

Step 4: Login

Login is required, please use:
bash
ncm-cli login --background

Common Issues

IssueSolution
ncm-cli: command not found
Check if the npm global bin directory is in PATH:
npm bin -g
mpv not found
Re-run
python3 scripts/install_mpv.py
or install manually: https://mpv.io
Login timeoutRe-run
ncm-cli login --background

Basic Information

  • Requires Node.js >= 18