NetEase-MusicBox is a Python 3.10+ command-line/curses TUI music player, managed with
uv. There is a single package (NEMbox) and one product
(the musicbox CLI/TUI). Dependencies are refreshed automatically by the startup update
script (uv sync --frozen); you do not need to reinstall them.
- Interactive TUI:
uv run musicbox— this usescursesand requires a real interactive terminal (TTY). It will not render in a non-TTY/headless shell; use the CLI subcommands below for scripted/agent verification instead. - Agent/CLI mode (no TTY needed):
uv run musicbox <command>, e.g.search,song url,play,pause,status,queue,daemon,auth. Add--jsonfor machine-readable output. SeeREADME.mdfor the full command list. - Playback runs through a background daemon;
musicbox play --id <id>auto-starts it andmusicbox daemon stopstops it.
mpg123(MP3) andmpv(FLAC / Hi-Res) are OS packages installed viaapt-get(sudo apt-get install -y mpg123 mpv). They are pre-installed in the snapshot; reinstall only ifmusicbox playreports a missing backend. Playback selectsmpg123by default.
- Song search and playable URLs come from NetEase's public API, which only accepts China-region access. From other regions requests can fail or return empty; set an HTTP proxy (see README "配置") if search stops returning results. In this environment the API was reachable and returned live results.
- Login is QR-code scan only (renders a QR block in the terminal); there is no username/password login and no test-login secret is required for search/playback.
Standard commands (already documented in .cursor/rules/pre-commit-validation.mdc and
.github/workflows/ci.yml); run them via uv run:
uv run ruff checkuv run ruff format --checkuv run ty check— emits ~11 diagnostics that are configured aswarninpyproject.toml; it exits 0 and is not a failure.uv run pytest -q --tb=shortuv build