Melody CLI is a powerful, minimal, and interactive command-line music player that lets you search, download, and play songs from YouTube Music โ all inside your terminal.
Built with Python, powered by ytmusicapi
, yt-dlp
, and pygame
, this tool gives devs and terminal geeks a lightweight, distraction-free music experience.
- ๐ Search Songs from YouTube Music right inside the terminal
- โฌ๏ธ Download & Cache Audio using
yt-dlp
for efficient playback - ๐ง Play Music with smooth
pygame
integration - โธ๏ธ Playback Controls โ Pause, Resume, Stop, Skip, Previous
- ๐ Autoplay Queue โ Auto-queues and plays recommended tracks
- ๐ง Smart Caching โ Replays already downloaded tracks to save bandwidth
- ๐งน Disk Management โ Only keeps the last 10 played songs in cache
- ๐งผ Clear CLI โ Use
clear
to reset your screen mid-session
git clone https://github.com/pythonicforge/Melody.CLI
cd Melody.CLI
python3 -m venv env
source env/bin/activate # or .\env\Scripts\activate on Windows
pip install -r requirements.txt
python melody.py
Once you're in the CLI, use commands like:
search <song name> # Search songs
play <index> # Play a song from search results
pause # Pause music
resume # Resume playback
stop # Stop playback (also disables autoplay)
next # Play next song in the queue
prev # Play previous song
queue # View the current queue
autoplay # Toggle autoplay on/off
clear # Clear the terminal screen
bye # Exit the CLI
- Search: Uses
ytmusicapi
to find relevant tracks. - Download: Fetches audio from YouTube with
yt-dlp
, stores it as MP3. - Playback: Uses
pygame
for low-latency audio control. - Queue: Automatically fills up with related tracks post-playback.
- Memory Friendly: Automatically keeps cache folder to a max of 10 songs.
Purpose | Tool |
---|---|
Search API | ytmusicapi |
Download Engine | yt-dlp |
Audio Playback | pygame |
CLI Framework | Python's cmd |
Got ideas? Found bugs?
Pull requests and issues are super welcome! Letโs make terminal music cool again ๐ป๐ถ
This isnโt your average MP3 player โ Melody CLI is for the terminal generation. Itโs fast, snappy, and doesnโt need a GUI to vibe.