English | Русский
YMusic CLI is a modern, fast, and lightweight console music player for Yandex Music featuring an ASCII interface, real-time dynamic spectrum visualizer, retro cassette animation, sliding window queue, and automated browser authentication.
Cross-platform: first-class support for Linux and Windows (10 / 11).
- Instant Number Navigation (1–6):
1/wave: My Wave — infinite personalized algorithmic radio stream with automatic background track prefetching.2/liked: Favorites — your personal library of liked tracks.3/playlists: Playlists — browse your personal and editorial playlists (3 <N>to select).4/search: Search — instant search across tracks, artists, and albums (4 <query>).5/queue: Queue — compact sliding window view of the active playlist.6/lyrics: Lyrics — view synchronized or plain text lyrics for the currently playing track.
- Intelligent 3-Track Sliding Window Queue:
<< Previous>> Playing>> Next- To inspect the complete playlist list at any time, pass the
allflag (e.g.liked all,5 all).
- Interactive Spectrum Visualizer (
vis):- Fullscreen terminal ASCII spectrum analyzer with column gravity and decay physics.
- Real-time playback control hotkeys directly inside the visualizer without leaving the view.
- Retro Cassette Track Card (
now):- Animated retro cassette with spinning reels, precise playback timeline, and track metadata.
- Zero-Friction Device Auth (
auth):- Hassle-free login powered by Device Auth: the player automatically generates a code, copies it to your clipboard, and launches
https://ya.ru/devicein your default browser. No manual token inspection in DevTools! - Tokens and settings are stored strictly in the operating system's protected user profile directory with restrictive permissions and are never bundled into release artifacts or repositories.
- Hassle-free login powered by Device Auth: the player automatically generates a code, copies it to your clipboard, and launches
- Clean Terminal UI:
- Automatic screen management on section switching with zero log spam.
- Audio Backend (mpv / libmpv): YMusic CLI uses
libmpvfor high-quality, low-latency audio playback with minimal resource usage. - (Optional, only when running from source): Python 3.10+ and package manager (
uvorpip).
Install mpv and development libraries using your distribution's package manager:
- Ubuntu / Debian / Linux Mint:
sudo apt update sudo apt install -y mpv libmpv-dev
- Arch Linux / Manjaro:
sudo pacman -S mpv
- Fedora / RHEL:
sudo dnf install -y mpv mpv-libs-devel
- openSUSE:
sudo zypper install mpv libmpv2
-
Download the release package (
ymusic-v0.2.0-linux-x64.tar.gz) from GitHub Releases or locatedist/linux/ymusic:tar -xzf ymusic-v0.2.0-linux-x64.tar.gz cd ymusic-v0.2.0-linux-x64 -
Grant execution permissions:
chmod +x ymusic
-
(Recommended) Install into your user binary path to run
ymusicanywhere:mkdir -p ~/.local/bin cp ymusic ~/.local/bin/
(Ensure
~/.local/binis in your$PATH). -
Start the player:
ymusic
-
Using uv (recommended):
# Install dependencies into virtual environment: uv sync # Start the player: uv run ymusic
-
Using standard Python venv and pip:
python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt python3 -m ymusic_cli
The player requires libmpv / mpv.exe in your system PATH:
- Method 1 (via winget — built into Windows 10/11):
In PowerShell:
winget install mpv.net # or winget install mpv.mpv - Method 2 (via Scoop):
scoop install mpv
- Method 3 (via Chocolatey):
choco install mpv
- Method 4 (Manual download):
- Download the mpv package from SourceForge / GitHub.
- Extract
libmpv-2.dll(ormpv.exe) into the same directory asymusic.exe, or add its folder to your systemPATH.
Tip
Recommended Windows Terminal: Use the modern Windows Terminal (available free from the Microsoft Store). It provides full ANSI 24-bit color support, UTF-8 rendering, and compatibility with Nerd Fonts / Cascadia Code for crisp cassette and equalizer art.
- Download and extract
ymusic-v0.2.0-windows-x64.zip. - Open Windows Terminal (PowerShell or Command Prompt).
- Run the executable:
(Or double-click
.\ymusic.exerun.batincluded in the zip package).
# Create and activate virtual environment
py -m venv .venv
.\.venv\Scripts\Activate.ps1
# Install requirements
pip install -r requirements.txt
# Run interactive CLI
python -m ymusic_cliOn first run, the player automatically prompts you to log into your Yandex account:
- Run the auth command:
ymusic auth
- The player generates a one-time device code (e.g.
ABCD-1234), automatically copies it to your clipboard, and opens the verification page:https://ya.ru/device - In your browser, press Ctrl+V (Paste) and authorize the device.
- The CLI automatically intercepts the token, stores it securely in your configuration, and displays your account username along with Yandex Plus subscription status.
If you already possess an OAuth token:
ymusic auth <YOUR_TOKEN>Or pass it via environment variable:
- Linux:
export YANDEX_MUSIC_TOKEN="your_token" - Windows (PowerShell):
$env:YANDEX_MUSIC_TOKEN="your_token"
| Command | Description |
|---|---|
ymusic |
Start interactive terminal shell |
ymusic 1 or ymusic wave |
Launch "My Wave" immediately on startup |
ymusic 2 or ymusic liked |
Open favorites / liked tracks |
ymusic play <query> |
Search and immediately play first matching track |
ymusic search <query> |
Search library for tracks, artists, and albums |
ymusic vis |
Launch directly into interactive spectrum visualizer |
ymusic status |
Check account info and Plus subscription status |
ymusic update / auth |
Force re-authentication via browser |
ymusic --version / -v |
Display version information |
ymusic --help / -h |
Show CLI flags and options help |
1— My Wave (infinite personalized radio stream)2— Liked (compact 3-track sliding window of favorites)2 all— Display full list of liked tracks3— Playlists (browse personal and editorial playlists)3 <number>— Load and start playlist number N4 <query>— Search Yandex Music5— Queue (current 3 tracks: Previous / Playing / Next)5 all— Display entire active playback queue6— Lyrics (synchronized or plain text lyrics)
vis— Fullscreen ASCII spectrum analyzer with column decay physics.- Visualizer Hotkeys:
Space— Pause / Resume playbackn/p— Next / Previous track+/-— Volume up / downl— Toggle Like on current tracks— Shuffle queueqorEsc— Exit visualizer back to shell
- Visualizer Hotkeys:
now— Now Playing card with animated cassette and audio timeline.
play <number>— Play track by index from current listpause— Pause or resume playbackstop— Stop playback completelyn/next— Skip to next track (in My Wave, streams infinitely)p/prev— Go back to previous trackseek +/-N— Seek by N seconds (e.g.seek +30orseek -15)vol <0-100>— Set volume percentage (e.g.vol 80)vol +/-N— Adjust volume by delta (e.g.vol +5orvol -10)repeat— Cycle repeat mode:off->all->oneshuffle— Shuffle current queuelike/dislike— Rate track: Like [+] or Dislike [-]
clear/cls— Clear terminal screenstatus— Show user profile & Yandex Plus statusupdate/auth— Force browser authentication updatehelp— Print command referenceq/quit/exit— Exit the player
You can compile a standalone, single-file binary for your platform using build.py:
# 1. Install build requirements
pip install -r requirements-dev.txt
# 2. Run compilation script
python build.py- Linux:
dist/linux/ymusic(single ELF binary) andreleases/ymusic-v0.2.0-linux-x64.tar.gz. - Windows:
dist/windows/ymusic.exe(single PE32+ executable) andreleases/ymusic-v0.2.0-windows-x64.zip.
Build Security Guarantee: Before packaging,
build.pyvalidates the workspace and blocks any token files,config.json, or private user credentials from being included in the resulting binaries or archives.
Configuration is stored automatically in the operating system's protected user directory:
- Linux:
~/.config/ymusic-cli/config.json(chmod0600) - Windows:
%APPDATA%\ymusic-cli\config.json - Logs:
~/.cache/ymusic-cli/ymusic.log(Linux) or%LOCALAPPDATA%\ymusic-cli\ymusic.log(Windows).
- Linux: Verify that
libmpv1orlibmpv2/libmpv-devpackage is installed. - Windows: Verify that
libmpv-2.dllis in yourPATHor placed directly in the same folder asymusic.exe.
- Standard
cmd.exelacks modern unicode support. Launch Windows Terminal. - In the console, execute:
chcp 65001(switch active code page to UTF-8). - Ensure your terminal uses a font with full box-drawing glyphs (e.g. Cascadia Code, JetBrains Mono, Fira Code).
Mark the executable file as executable:
chmod +x ./dist/linux/ymusicVerify that mpv can play audio on your system:
mpv --ao=pulse /path/to/sample.mp3If using PipeWire, ensure pipewire-pulse is active.