Author: Pinaka Type: CLI Application Level: Intermediate Platform: Windows · Linux · macOS
Music Player CLI is a cross-platform command-line based music player written in Python.
It automatically scans your system’s Music folder, displays available .mp3 files, and allows you to play, pause, resume, stop, and queue songs using simple keyboard commands.
This project demonstrates real-world CLI design, OS detection, and audio playback using Python.
The program automatically selects your system Music directory:
| OS | Music Folder |
|---|---|
| Windows | C:\Users\<User>\Music |
| Linux | /home/<user>/Music |
| macOS | /Users/<user>/Music |
.mp3 files are supported
- 🎧 Auto-detect system Music folder
- 📜 List all available MP3 files
▶️ Play music- ⏸ Pause music
- 🔁 Resume music
- ⏹ Stop music
- ➕ Add songs to queue
- 📖 Built-in help manual
- 💻 Beautiful CLI UI using
rich - 🧠 Real-world CLI interaction design
Create a file named requirements.txt
rich
pygame
Install dependencies:
pip install -r requirements.txtpython main.py| Key | Action |
|---|---|
ls |
List songs |
p |
Play selected song |
u |
Pause |
r |
Resume |
a |
Stop |
pl |
Pick & play immediately |
h |
Show help manual |
Q |
Quit player |
Start App
↓
Detect OS
↓
Scan Music Folder
↓
Show Playlist
↓
Select Song by ID
↓
Play / Pause / Resume / Stop
- Cross-platform path handling
- Real CLI UX design
- Audio playback using Python
- Event-driven program flow
- Clean command handling logic
- Rich-based terminal UI
- Make sure your Music folder contains
.mp3files - Large files may take a second to load
- Works offline
- No internet required
This project mimics a real desktop music player, but entirely inside the terminal. It’s an excellent demonstration of how Python CLI apps can feel powerful, modern, and practical.