YouTube Music CLI tool with interactive terminal interface
Project description
YTM - YouTube Music CLI
🎵 A simple, interactive command-line tool for YouTube Music
Stream music directly from YouTube Music in your terminal with intuitive controls, playlist management, and smart filtering.
✨ Features
- 🔍 Smart Search: Search and play any song from YouTube Music
- 🎮 Interactive Controls: Play/pause, skip, go back with simple key presses
- 📱 Vim-like Navigation: Use
j/kkeys or arrow keys to navigate - 📋 Local Playlists: Create and manage personal playlists
- 👎 Smart Filtering: Dislike songs to filter them from future results
- 📜 Lyrics Display: View lyrics while listening (press
l) - 🎯 Radio Mode: Automatic playlist generation based on your selection
- 🤖 AI-Powered: Natural language music requests and AI-generated playlists
🚀 Quick Start
Requirements
- Python 3.8+
- mpv media player (must be installed system-wide)
Installation
One command with uv (recommended):
# Install from PyPI
uvx ytm-cli "song name"
# Or from source (no clone needed)
uvx --from git+https://github.com/thieuluan1618/ytm.git ytm "song name"
Alternative: clone and run locally
git clone https://github.com/thieuluan1618/ytm.git
cd ytm
uv run ytm "song name"
Alternative: one-shot setup scripts
git clone https://github.com/thieuluan1618/ytm.git
cd ytm
These create the virtual environment, install dependencies, and configure the ytm command globally.
Linux/macOS:
./setup.sh
source ~/.zshrc # or ~/.bashrc for bash
Windows PowerShell:
.\setup.ps1
. $PROFILE
Windows Command Prompt:
setup.bat
After setup, use ytm from anywhere instead of python -m ytm_cli.
Alternative: manual install
git clone https://github.com/thieuluan1618/ytm.git
cd ytm
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
./setup_alias.sh # or setup_alias.ps1 / setup_alias.bat
Basic Usage
Interactive search:
ytm
# Enter search query when prompted
Direct search:
ytm "your favorite song"
Non-interactive mode (automation/scripting):
ytm search "song name" --select 1 # Auto-select first result
ytm search "song" -s 1 -v # With verbose output
ytm search "song" -s 1 -v --log-file debug.log # Save debug logs
Note: If you haven't set up the alias, use
python -m ytm_cliinstead ofytm
🎮 Controls
During Song Selection
↑/↓orj/k- Navigate through resultsEnter- Select and play songq- Quit
During Playback
Space- Play/pausen- Next songb- Previous songl- Show lyricsa- Add to playlistd- Dislike song (skip and filter from future results)q- Quit
📋 Playlist Management
Create and manage playlists:
ytm playlist list # List all playlists
ytm playlist create # Create new playlist
ytm playlist show "My Songs" # View playlist contents
ytm playlist play "My Songs" # Play entire playlist
ytm playlist delete "My Songs" # Delete playlist
Add songs to playlists:
- Press
aduring song selection or playback - Choose existing playlist or create new one
- Song added without interrupting playback
🤖 AI Music Assistant
Use natural language to search and create playlists powered by AI (supports Google Gemini, OpenAI, Anthropic):
ytm llm ask "play something chill for studying" # AI picks and auto-plays
ytm llm ask "upbeat pop songs for a workout" # Natural language search
ytm llm playlist "lo-fi beats for rainy days" --play # AI-generated playlist
ytm llm playlist "90s rock classics" -n 20 # 20-song playlist
Configure your provider in config.ini:
[llm]
provider = google # google, openai, or anthropic
model = gemini-2.5-pro
🛠️ Configuration
The app uses config.ini for customization:
[general]
songs_to_display = 10
show_thumbnails = true
[mpv]
# Add custom mpv flags
flags = --no-video
[playlists]
directory = playlists
🎯 Philosophy
Keep it simple for the listener to enjoy music. Features are designed to be:
- Intuitive: Single-key shortcuts during playback
- Non-disruptive: Actions don't interrupt your listening experience
- Consistent: Same navigation patterns across all screens
- Quick: Important features accessible with simple key presses
🐛 Troubleshooting
Having issues? Check out the Troubleshooting Guide for solutions to common problems:
Quick diagnosis:
# Enable verbose logging to see what's happening
ytm search "test" -s 1 -v --log-file debug.log
# Check versions
mpv --version
yt-dlp --version
📄 License
This project is open source. Please check the license file for details.
Enjoy your music! 🎵
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ytm_cli-0.5.0.tar.gz.
File metadata
- Download URL: ytm_cli-0.5.0.tar.gz
- Upload date:
- Size: 81.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
730ee7d6abadd4507be6f33f0232963d0b3387b061285032027b32b156e907ff
|
|
| MD5 |
b90b2f444b187e4b321158098c798f26
|
|
| BLAKE2b-256 |
0e5c2c9c85fd108b1d1b792c37eddcec49c877b2813e4e67f95c1f6368aca5b6
|
Provenance
The following attestation bundles were made for ytm_cli-0.5.0.tar.gz:
Publisher:
publish.yml on thieuluan1618/ytm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ytm_cli-0.5.0.tar.gz -
Subject digest:
730ee7d6abadd4507be6f33f0232963d0b3387b061285032027b32b156e907ff - Sigstore transparency entry: 1396220034
- Sigstore integration time:
-
Permalink:
thieuluan1618/ytm@070fb12fc5e29f54587eb6731d8c134c9912f33f -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/thieuluan1618
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@070fb12fc5e29f54587eb6731d8c134c9912f33f -
Trigger Event:
release
-
Statement type:
File details
Details for the file ytm_cli-0.5.0-py3-none-any.whl.
File metadata
- Download URL: ytm_cli-0.5.0-py3-none-any.whl
- Upload date:
- Size: 64.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec8f169f2e8e4f57ba106f3673339456617f4345401cd607b3548de6901fbe81
|
|
| MD5 |
77363c4f0f1156bf5347afd4c227fa0d
|
|
| BLAKE2b-256 |
9b8063a2f755bf89beb42818ef6677420a47d5dc6e12a3bcd34ece1e661d44b1
|
Provenance
The following attestation bundles were made for ytm_cli-0.5.0-py3-none-any.whl:
Publisher:
publish.yml on thieuluan1618/ytm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ytm_cli-0.5.0-py3-none-any.whl -
Subject digest:
ec8f169f2e8e4f57ba106f3673339456617f4345401cd607b3548de6901fbe81 - Sigstore transparency entry: 1396220041
- Sigstore integration time:
-
Permalink:
thieuluan1618/ytm@070fb12fc5e29f54587eb6731d8c134c9912f33f -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/thieuluan1618
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@070fb12fc5e29f54587eb6731d8c134c9912f33f -
Trigger Event:
release
-
Statement type: