English | Русский
YMusic CLI is a modern, fast, and ultra-lightweight (~6.5 MB) console music player for Yandex Music featuring a responsive mini-TUI interface, dynamic track bar, 3-track sliding window view, and automated browser authentication.
Cross-platform: first-class support for Linux and Windows (10 / 11).
- Instant Number Navigation (1–4):
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>).
- Responsive Adaptive Mini-TUI:
- Compact 2-line header adapting dynamically to terminal width (from minimal icon indicators to detailed labels).
- Clean auto-clearing screen mechanism after each command execution — zero clutter or cloned headers.
- Bilingual & Single-Key Controls:
- Full support for English and Russian keyboard layouts without switching (
c/сfor pause,n/тfor next,p/зfor previous,l/дfor like,d/вfor dislike).
- Full support for English and Russian keyboard layouts without switching (
- Intelligent 3-Track Sliding Window Queue:
<< Previous>> Playing>> Next- Pass the
allflag (e.g.liked all,2 all) to inspect the complete playlist list.
- Ultra-Compact Standalone Binary:
- Optimized to ~6.5 MB on Linux with zero Python dependencies required.
- 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. - 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
- 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.3.0-linux-x64.tar.gz) from GitHub Releases:tar -xzf ymusic-v0.3.0-linux-x64.tar.gz cd ymusic-v0.3.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.
- Download and extract
ymusic-v0.3.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 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/wave/волна— My Wave (infinite personalized radio stream)2/liked/лайки— Liked (compact 3-track sliding window of favorites)2 all— Display full list of liked tracks3/playlists/плейлисты— Playlists (browse personal and editorial playlists)3 <number>— Load and start playlist number N4 <query>/поиск <query>— Search Yandex Music
c/pause/с— Pause or resume playbackn/next/т— Skip to next trackp/prev/з— Go back to previous trackl/like/д— Like current trackd/dislike/в— Dislike current tracknow— Display compact Now Playing info cardseek +/-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 playliststop— Stop playback completely
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 using build.py:
# Compile and create release bundles:
python build.py --package- Linux:
dist/linux/ymusic(single ELF binary, ~6.5 MB) andreleases/ymusic-v0.3.0-linux-x64.tar.gz. - Windows:
dist/windows/ymusic.exeandreleases/ymusic-v0.3.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 (sudo apt install libmpv-devorsudo pacman -S mpv). - Windows: Verify that
libmpv-2.dllis in yourPATHor placed directly in the same folder asymusic.exe.
This project is licensed under the MIT License.
Copyright (c) 2026 Кратюк Матвей.