Skip to main content

Music control utility for MPD + beets

Project description

Musictl

Music control CLI for MPD + beets. Manage your library, playlists, and playback from the terminal.

Prerequisites

  • Python ≥ 3.13
  • MPD — running and configured
  • beets — with library database and custom fields (folder, playlists, comments)
  • YAD — for interactive dialogs (update, delete-current)
  • FFmpeg — for cue-split

Beets Setup

Musictl expects these beets flexible attributes:

  • folder — organizes tracks into directories (also synced to genre)
  • playlists — comma-separated playlist names
  • comments — synced to playlists:$playlists for external readers

Beets path config should include:

paths:
  "folder::.+": $folder/$artist - $album - $track - $title
  default: inbox/$genre/$artist - $album - $track - $title

Installation

# Clone and install with uv
git clone https://github.com/anthropics/musictl  # replace with actual repo
cd musictl
uv sync

# Install shell completions (bash/zsh/fish)
uv run musictl --install-completion

Commands

Command Description
musictl search <query> Search beets library, print relative paths
musictl play <playlist> Load and play a playlist
musictl play --random [--count N] Play N random tracks
musictl update Set folder/playlists on current track via YAD dialog
musictl delete-current Delete current track from library and disk
musictl clean-current Remove current track from MPD queue
musictl import [args] Import tracks via beet import
musictl cue-split <file> --cue <cue> Split audio file by CUE sheet
musictl generate-playlists Regenerate all .m3u playlist files
musictl rename-playlist <old> <new> Rename a playlist across all tracks
musictl rename-folder <old> <new> Rename a folder, move files, update tags
musictl waybar JSON output for waybar custom module

Piping

# Search and play results
musictl search 'artist:Beatles' | musictl play

# Chain: update current track, then remove from queue
musictl update && musictl clean-current

Waybar Integration

Add to your waybar config:

"custom/music": {
    "exec": "musictl waybar",
    "interval": 5,
    "return-type": "json"
}

Hyprland Keybindings

bind = $mainMod, M, exec, musictl play --random --count 20
bind = $mainMod SHIFT, M, exec, musictl update
bind = $mainMod CTRL, M, exec, musictl delete-current

Development

just check      # ruff check + basedpyright
just fmt         # ruff fix + ruff format
uv run pytest    # run tests
just sync        # uv sync dependencies

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

musictl-0.2.0.tar.gz (61.3 kB view details)

Uploaded Source

Built Distribution

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

musictl-0.2.0-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file musictl-0.2.0.tar.gz.

File metadata

  • Download URL: musictl-0.2.0.tar.gz
  • Upload date:
  • Size: 61.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for musictl-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c6dae56c3d4f87f6c61afde504ccc74c2fd89867566cf5253b5c1a8c9a7908df
MD5 f5eab67ed668fb1f452888ae592da9ea
BLAKE2b-256 ec0fefda96d1c34411cb7acc8fbc651afd928278a9a17c9e22d7925e95faa159

See more details on using hashes here.

File details

Details for the file musictl-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: musictl-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for musictl-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bfc0f1c1b8c1c0f9289b91f7486223178a4786911fb881d3a561a2b764f3dfb1
MD5 c0810cf9e2a760b3469fa97e0b32a478
BLAKE2b-256 8dcdd2951b8a5ac4967ff8640ed9f56bd26fd48687e546098fa1cb3da2dc5e70

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