Terminal-based YouTube music downloader, streamer, and local music player built with Python.
songcli is a terminal-based YouTube music downloader, streamer, and local audio player built using Python, yt-dlp, mpv, Rich, and InquirerPy.
It allows you to:
- Search YouTube directly from the terminal
- Download songs in multiple qualities and formats
- Stream music instantly using mpv
- Play locally downloaded songs
- Download playlists
- Track download/search history
- Detect duplicate downloads
- Customize themes and settings
- Manage playback directly from the CLI
songcli is designed for Linux and Termux users who want a fast, keyboard-driven music experience directly inside the terminal.
songcli works correctly in:
- Normal Linux distributions
- Standard Termux environment
However, audio playback and streaming may fail inside Termux proot distros such as:
- Arch Linux (proot)
- Fedora (proot)
- Ubuntu (proot)
- Debian (proot)
Proot environments are userspace container-like environments. They do not have direct access to Android's native multimedia and hardware layers.
Unlike standard Linux systems, Android uses a completely different audio architecture based on:
- AudioFlinger
- Binder IPC
- Android HAL (Hardware Abstraction Layer)
Meanwhile, Linux applications such as mpv expect desktop Linux audio systems like:
- ALSA
- PulseAudio
- PipeWire
Inside a proot distro:
/dev/sndaudio devices are unavailable- ALSA cannot access Android speakers directly
- PipeWire usually cannot initialize properly
- mpv cannot communicate directly with Android audio drivers
Because of this, mpv inside proot often produces errors such as:
Could not open/initialize audio device -> no sound
Run the tool:
python3 songcli-1.py- Download songs from YouTube
- Download playlists
- Stream music directly with mpv
- Play downloaded songs locally
- Configure output quality and format
- Search download history
- Detect duplicate downloads
- Theme customization
- yt-dlp update checker
Default download directory:
~/Music/songcli
Inside mpv:
SPACE Play/Pause
q Quit
← → Seek
L Toggle loop
M Mute
9/0 Volume
Install system dependencies:
sudo apt update
sudo apt install python3 python3-pip ffmpeg mpvInstall Python dependencies:
python3 -m pip install -U yt-dlp rich InquirerPy requestsRun songcli:
python3 songcli-1.pyUpdate packages:
pkg update && pkg upgradeInstall required packages:
pkg install python ffmpeg mpv pulseaudioInstall Python dependencies:
pip install -U yt-dlp rich InquirerPy requestsRun songcli:
python songcli-1.pyInstall dependencies normally inside your distro.
Example for Arch Linux:
pacman -S python python-pip ffmpeg mpv Example for Fedora:
dnf install python3 python3-pip ffmpeg mpv Install Python dependencies:
pip install -U yt-dlp rich InquirerPy requestssongcli depends on:
- Python 3.8+
- yt-dlp
- mpv
- ffmpeg
- Rich
- InquirerPy
- requests
songcli/
│
├── songcli-1.py
├── downloads/
├── history/
├── themes/
├── docs/
│ ├── logo.png
│ └── screenshots/
│ ├── main-menu.png
│ ├── stream-songs.png
│ └── download-progress.png
Planned features for future versions:
- Live synced lyrics (karaoke-style)
- Better TUI interface
- Playlist management
- Queue system
- Background playback
- Search improvements
- Animated progress bars
- Metadata editor
- Multi-threaded downloads
If you like this project, consider supporting it:
MIT License



