Terminal Music Player

July 18, 2025 · View on GitHub

A fast, minimalist, and stylish terminal-based music player written in Go, powered by Bubbletea and Lipgloss. Built for Unix-like systems using PipeWire (pw-play) for audio playback.


mpterm

✨ Features

  • Automatically loads songs from a predefined directory
  • Play, pause, and stop audio directly from the terminal
  • Add and manage a playback queue interactively
  • Persistent Queue/ Playlist across sessions (sqlite)
  • Navigate between currently queued songs
  • Stylish dual-pane interface with color highlights
  • Mouse-free operation using Vim-style keybindings
  • Real-time playback state tracking (playing/paused)
  • PipeWire backend via pw-play

Requirements

  • Go 1.21+
  • PipeWire installed with pw-play available in PATH
  • Audio files in ~/Music (or the configured directory)

Installation

go install github.com/ad1822/mpterm@latest
git clone https://github.com/ad1822/mpterm.git
cd mpterm
go build -o mpterm ./main.go
./mpterm

⌨️ Keybindings

KeyAction
j / kMove up/down in the list
TabSwitch between song list & queue
EnterPlay selected song
SpacePause/Resume current song
aAdd selected song to queue
dRemove song from queue
h / lPlay previous/next from active panel
sStop current song
oOpen selected folder
q / Ctrl+CQuit the player

Project Structure

music-player/
├── main.go               # Entry point
├── internal/
│   ├── app/              # Model, update, init, play logic
│   └── style/            # Centralized Lipgloss styles
├── go.mod
└── README.md

TODO

  • Playlist persistence across sessions
  • UI animations and transitions
  • Configurable music directory (~/.config/music-player/config.yaml)
  • Volume control (+, -)
  • Shuffle and repeat modes
  • Search/filter songs
  • Native MPV/Ffplay backend support

Contributing

PRs and feature ideas are welcome. Open an issue to discuss improvements or bugs.