A terminal-based music player powered by yt-dlp and mpv.
Project description
Musix — Terminal Music Player
Built for developers who live in the terminal.
Music Apps has ads, skip limits, and pulls you out of your flow. Browser players eat RAM. Musix lets you search and stream any song without leaving the terminal — no account, no browser, no interruptions.
Why Musix
- Zero context switching — stay in the terminal, stay in flow
- Low RAM — mpv + a small Python process, no Electron overhead
- No constraints — no skip limits, no ads, no subscription
- No account needed — just install and play
Prerequisites
mpv must be installed on your system:
| Platform | Command |
|---|---|
| Linux | sudo apt install mpv |
| Mac | brew install mpv |
| Windows | scoop install mpv |
Installation
pip install musix-cli-player
Commands
Playback
musix play "song name" # Stream a song instantly
musix search "song name" # Search and pick from top 5 results
musix play-playlist "playlist name" # Play all songs in a playlist
Download
musix download "song name" # Search and download as audio file
# Saves to ~/Music/musix/
Playlists
musix playlist "My Playlist" # Create a playlist
musix add-song "song name" "My Playlist" # Add a song to a playlist
musix delete-playlist "My Playlist" # Delete a playlist and its songs
musix list-playlists # List all playlists
History
musix history # Show last 20 played songs with links
Playback Controls
While a song is playing:
| Key | Action |
|---|---|
p or Space |
Play / Pause |
q |
Skip to next / Quit |
9 / 0 |
Volume down / up |
How It Works
- Search — yt-dlp queries YouTube and returns results
- Stream — yt-dlp extracts a direct audio URL (no download)
- Play — mpv streams the audio URL in the terminal
- Store — playlists and history are saved locally in SQLite
No audio is stored unless you explicitly use musix download.
Architecture
graph TD
CLI["CLI — cli.py<br/>(Typer commands)"]
CLI --> Player["Player — player.py<br/>(yt-dlp + mpv)"]
CLI --> DB["Database — db.py<br/>(SQLite)"]
Player --> YTDLP["yt-dlp<br/>Fetches audio URL from YouTube"]
Player --> MPV["mpv<br/>Streams audio in terminal"]
DB --> SQLite["musix.db<br/>Playlists · Songs · History"]
Database Design
erDiagram
playlist {
INTEGER PlayID PK
VARCHAR PlaylistName
}
songs {
VARCHAR SongID PK
VARCHAR SongName
INT SongPlayTime
VARCHAR SongArtist
INT SongOrder
INT PlayID FK
}
history {
INTEGER id PK
TEXT song_name
TEXT youtube_id
TIMESTAMP played_at
}
playlist ||--o{ songs : "has"
Play Flow
sequenceDiagram
actor User
participant CLI
participant yt-dlp
participant YouTube
participant mpv
User->>CLI: musix play "song name"
CLI->>yt-dlp: search + extract audio URL
yt-dlp->>YouTube: API request
YouTube-->>yt-dlp: stream metadata
yt-dlp-->>CLI: audio URL + title
CLI->>mpv: stream URL
mpv->>YouTube: fetch audio stream
YouTube-->>mpv: audio chunks
mpv-->>User: plays in terminal
Project details
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 musix_player-0.2.0.tar.gz.
File metadata
- Download URL: musix_player-0.2.0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21db9d937621e47a6c83be4ea57a31e7d37c72b6e4b0d2b6e9316065ecf6866b
|
|
| MD5 |
bf3bb0f557e892c044b394e88c85c177
|
|
| BLAKE2b-256 |
dff6c3a4781ca59fbe983ee0679efb31d2225e13cc824cc378b8717bc3984e6d
|
File details
Details for the file musix_player-0.2.0-py3-none-any.whl.
File metadata
- Download URL: musix_player-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e499ba6bf5ba0d657d147146ec343ec8c7aba73fc545789d9903ac752957b87a
|
|
| MD5 |
f8b887bac2e55d345112cc7086ed2ebe
|
|
| BLAKE2b-256 |
23e64a45f7360cd62ecff64cd88311c220ff59e43e4184e08bb7d3ea5274ea20
|