Skip to main content

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

  1. Search — yt-dlp queries YouTube and returns results
  2. Stream — yt-dlp extracts a direct audio URL (no download)
  3. Play — mpv streams the audio URL in the terminal
  4. 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

musix_player-0.2.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

musix_player-0.2.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

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

Hashes for musix_player-0.2.0.tar.gz
Algorithm Hash digest
SHA256 21db9d937621e47a6c83be4ea57a31e7d37c72b6e4b0d2b6e9316065ecf6866b
MD5 bf3bb0f557e892c044b394e88c85c177
BLAKE2b-256 dff6c3a4781ca59fbe983ee0679efb31d2225e13cc824cc378b8717bc3984e6d

See more details on using hashes here.

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

Hashes for musix_player-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e499ba6bf5ba0d657d147146ec343ec8c7aba73fc545789d9903ac752957b87a
MD5 f8b887bac2e55d345112cc7086ed2ebe
BLAKE2b-256 23e64a45f7360cd62ecff64cd88311c220ff59e43e4184e08bb7d3ea5274ea20

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page