Note: This project is moved to Codeberg: https://codeberg.org/gaurav712/ytmusic-cli
A terminal-based frontend for YouTube Music using urwid for UI, ytmusicapi for API access, and mpv for playback.
- Search and play YouTube Music songs
- Vim-like navigation (j/k keys)
- Play/pause and seeking controls
- Progress bar with time display
- Loads recommended songs on startup
- Python 3.7+
- mpv (system package)
- YouTube Music auth headers file
-
Install mpv:
# Debian/Ubuntu sudo apt install mpv # Arch Linux sudo pacman -S mpv # macOS brew install mpv
-
Install the package:
pip install -e . -
Set up YouTube Music authentication:
- Follow the ytmusicapi setup guide
- Save the headers file to
~/.config/ytmusic-cli/headersauth.json
ytmusic-cliOr with options:
ytmusic-cli --auth-headers /path/to/headers.json
ytmusic-cli --verbose| Key | Action |
|---|---|
/ |
Search |
Escape |
Cancel Search |
j |
Move down |
k |
Move up |
Enter |
Select / Submit |
Space |
Play/Pause |
h |
Seek -10s |
l |
Seek +10s |
q |
Quit |
ytmusic-cli/
├── pyproject.toml # Package configuration
├── ytmusic_cli/
│ ├── main.py # Entry point
│ ├── interface.py # UI
│ ├── player.py # Playback
│ ├── config.py # Constants
│ └── custom_list_box.py
└── README.md
MIT