A Rust TUI client for NetEase Cloud Music, with an embedded fullscreen playback page.
CNMPlayer (Customized Netease Music Player) is a terminal NetEase Cloud Music client. It supports QR code, account (username/email), and phone verification-code login; automatically restores the last session on startup; browses home recommendations, playlist/album results, artist pages, and search pages; and streams songs in the terminal with local caching. When you switch into fullscreen playback, CNMPlayer hands control to the embedded TMPlayer fullscreen page.
- QR code, account (username/email), and phone verification-code login
- Automatic session restore on startup
- Home recommendations, playlist pages, artist pages, and search pages;
@albumsearch results reuse the playlist-page layout - Search suffixes:
@single,@album,@list,@author, and the@artistalias; an empty@authorquery lists followed artists - Streaming playback with a local audio cache
- Playback queue memory and local playback position restore
- VIP-aware audio quality clamping
- Page lyrics overlay on content pages
- Theme switching, language switching, transparent background, hint toggles, and configurable keybinds
- Bars / oscilloscope visualization; if
cavais not installed, visualization is automatically disabled - Embedded TMPlayer fullscreen page; the main UI's
cavais paused/resumed when entering/leaving fullscreen - Linux MPRIS sync
- Audio cache cleanup controls
- Current image protocol only implements
off/halfblocks; legacyauto,sixel,kitty, anditerm2values are migrated tohalfblocks - There is no dedicated album page; album search results are shown with the playlist-page layout
Esc,Ctrl+K, andCtrl+Up/Downare fixed shortcuts and cannot be rebound- The app fills in missing config fields on startup and rewrites
config/default.tomlwhen needed
- Rust 2024
- TUI: ratatui + crossterm
- Networking: compio + cyper + ncm-api-rs
- Playback: rodio + symphonia + cpal
- Metadata and artwork: lofty + image + qrcode
- Image rendering: ratatui-image + chafa
- Visualization: external
cava - Fullscreen playback integration: TMPlayer
- Linux media control: MPRIS
The UI uses icon glyphs in several places. A Nerd Font is strongly recommended; otherwise some icons may render as missing glyph boxes.
Install the build dependencies provided by your distribution. On Debian/Ubuntu, this is usually enough:
sudo apt update
sudo apt install -y build-essential cmake pkg-config libasound2-dev libdbus-1-devCNMPlayer looks for an external cava binary for the live spectrum visualizer.
If cava is not available, the app still runs, but the bars and oscilloscope visualizers are automatically disabled.
The executable lookup order is:
TMPLAYER_CAVA<executable dir>/cava<executable dir>/third_party/cava/cava<current working directory>/third_party/cava/cavacavainPATH
For development:
cargo runcargo build --release
./target/release/cnmplayerOn first run, the app creates its asset directory under your OS config directory; on Linux this is usually ~/.config/cnmplayer.
If CNMPLAYER_ASSET_DIR is set, that directory becomes the asset root instead.
The app keeps config/, themes/, and auth/ under that root.
After the first run you will see:
config/default.tomlthemes/*.tomlauth/session.toml
Audio cache files are stored under your OS cache directory unless you set cache.path in config/default.toml.
config/default.toml: application settings, playback settings, keybinds, and cache policythemes/*.toml: theme definitionsauth/session.toml: persisted login cookie- Cache root: OS cache directory by default, or
cache.pathif you set one
The app fills in missing config fields on startup and rewrites config/default.toml when needed. Legacy graphics_protocol values auto, sixel, kitty, and iterm2 are migrated to halfblocks.
Important settings in config/default.toml:
- Runtime:
ui_fps,spectrum_hz,mpris_poll_ms - Interface:
theme,language,transparent_background,show_hints,home_more_recommend,album_border - Login banner:
default_opening_title(supports\nline breaks) - Image and visualization:
graphics_protocol,visualize,super_smooth_bar,bars_gap,bar_number,bar_channels,bar_channel_reverse,kitty_cover_scale_percent - Playback behavior:
audio_quality,playback_memory,resume_last_position,eq_bands_db - Lyrics and recognition:
page_lyrics,lyrics_cover_fetch,lyrics_cover_download,audio_fingerprint,acoustid_api_key - Keybinds:
keybind_*(see below; can be rebound in Settings) - Cache policy:
cache.path,cache.clean_strategy,cache.max_size_mb,cache.max_age_days,cache.clean_on_startup
Additional notes:
themecan besystem,latte,frappe,macchiato, ormocha; the default isfrappegraphics_protocolcurrently only implementsoff/halfblocksvisualizesupportsoff,bars, andoscilloscope; ifcavais unavailable it falls back tooffcache.clean_strategysupportssize,age, andbothaudio_qualitysupportsstandard,higher,exhigh,lossless,hires,jyeffect,sky,dolby, andjymaster- If the current account does not have VIP access, CNMPlayer clamps the quality to the free range
Configurable shortcuts (default bindings):
Ctrl+S: open the search boxCtrl+F: open / return to fullscreen playbackT: open settingsP: toggle the sidebarQ: quit the host appAlt+Space: toggle play/pauseAlt+Left: previous trackAlt+Right: next trackAlt+M: toggle repeat modeLeft: fullscreen previous trackRight: fullscreen next trackSpace: fullscreen play/pauseM: toggle fullscreen playback modeE: toggle fullscreen EQAlt+R: reset fullscreen EQL: toggle like/unlike in fullscreenAlt+L: toggle like/unlike in the collapsed player bar
Fixed shortcuts:
Esc: close overlays or go back from the current pageCtrl+Up/Ctrl+Down: switch sidebar playlist section (Created / Collected) when the sidebar is expandedCtrl+K: open help
Login page:
F1: QR loginF2: account login (username / email)F3: phone loginQ: quit the appTab/Up/Down: switch focusEnter: confirm or submit
Search box:
Enter: run the searchEsc/Ctrl+S: close the search boxBackspace: delete text- Arrow keys: move the cursor
Search, playlist, and author pages:
Enter: open or play the focused itemEscorLeft: go backTab/Down: move to the next itemShift+Tab/Up: move to the previous item
Settings keybind page:
Enter: start rebinding the selected shortcutCtrl+Alt+R: reset keybinds to defaultsEsc: return
- TMPlayer: fullscreen playback UI used by CNMPlayer
- ncm-api-rs: NetEase Cloud Music API client used by CNMPlayer
CNMPlayer is licensed under AGPL-3.0-only.
Third-party attributions and license notices for vendored code are documented in THIRD_PARTY_NOTICES.md.
See CITATION.cff for the standard citation metadata and upstream references.