Skip to main content

Generate and play music playlists from natural language prompts or seed songs

Project description

myplaylist

PyPI version Python versions

Generate and play music playlists in your terminal from natural language prompts or seed songs.

myplaylist TUI — playlist view with lyrics panel and mood animation

Why myplaylist?

  • AI-native, terminal-first — describe any mood or song in plain language and get a curated playlist instantly, without leaving your terminal
  • Ad-free playback — streams directly from YouTube via yt-dlp and mpv; no ads, no interruptions
  • You own your playlists — add, delete, reorder, and save tracks live during playback; export to M3U/CSV/JSON for use anywhere
  • Vast music catalog — any song on YouTube is fair game, from mainstream hits to obscure jazz recordings and everything in between
  • No account, no tracking — everything stays local in ~/.myplaylist/; no sign-up, no cloud sync, no data collection
  • Zero extra subscription — works with your existing Claude subscription, or a minimal Gemini API key; no music platform membership required
  • Immersive terminal experience — time-synced lyrics and mood-driven ASCII animations keep the vibe going while you work

Features

  • Natural language prompts: myplaylist new "下雨天的 lo-fi jazz"
  • Seed songs: myplaylist new --seed "Norah Jones - Come Away With Me"
  • Terminal playback via mpv with a rich TUI (pause / skip / lyrics marquee / progress bar)
  • Lyrics panel: toggle a side panel showing time-synced lyrics with mood-driven ASCII animations
  • In-session append: press + to fetch ~10 more tracks without interrupting playback
  • Playlist loops: automatically restarts from track 1 after the last track
  • Local persistence at ~/.myplaylist/playlists/
  • Export to .m3u, .csv, or .json
  • Flexible LLM backend: Claude Code CLI (zero-config) or Gemini API key

Requirements

  • Python 3.9+
  • macOS or Linux
  • One of the following LLM backends (for natural language mode):
    • Claude Code CLI (claude) — zero-config if you have a Claude subscription
    • Gemini API key — set via myplaylist setup

Installation

macOS — Homebrew (recommended)

brew tap haoziwlh/autoplaylist https://github.com/haoziwlh/autoplaylist && brew install myplaylist

Homebrew handles everything: Python, mpv, and myplaylist itself.

macOS / Linux — curl one-liner

curl -fsSL https://raw.githubusercontent.com/haoziwlh/autoplaylist/main/install.sh | bash

The script detects your OS, installs pipx, myplaylist, and mpv automatically.

Manual — pipx

pipx install myplaylist

mpv is required for playback. Install it separately if needed:

  • macOS: brew install mpv
  • Linux: sudo apt-get install mpv

On first run, myplaylist will automatically guide you through setup (LLM backend, optional Last.fm key).

Quick Start

# Play your most recent playlist instantly
myplaylist

# Natural language prompt
myplaylist new "rainy day lo-fi jazz for working"

# Seed song
myplaylist new --seed "Norah Jones - Come Away With Me"

# Seed from YouTube URL
myplaylist new --seed "https://www.youtube.com/watch?v=..."

# Custom track count (default 20, max 50) and name
myplaylist new "chill beats" --count 30 --name my-chill-list

Commands

Command Description
myplaylist Play the most recent playlist
myplaylist new "<prompt>" Generate playlist from natural language
myplaylist new --seed "<song>" Generate playlist from seed song
myplaylist new ... --count <n> Set track count (default 20, max 50)
myplaylist list List all saved playlists
myplaylist show <name> Show track listing
myplaylist play [name] Play a playlist (defaults to most recent)
myplaylist export <name> --format m3u|csv|json Export playlist
myplaylist delete <name> Delete a playlist
myplaylist setup Choose LLM backend and configure API keys

Playback Controls

Key Action
p Pause / resume
n Skip to next track
↑ / ↓ Move cursor up / down
← / → Page up / page down
Enter Jump to selected track
09 + Enter Jump to track by number
+ Append ~10 more tracks (background, non-blocking)
l Toggle lyrics panel (time-synced lyrics + mood animation)
[ / ] Switch to previous / next playlist
d Delete cursor track from live playlist
s Save current playlist to disk
q Quit

Lyrics Panel

Press l during playback to open a side panel with time-synced lyrics fetched from lrclib.net. The panel also shows a mood-driven ASCII animation in the margin — determined per track by the LLM (calm, melancholic, energetic, romantic, nostalgic).

Requires terminal width ≥ 84 columns.

Last.fm (optional)

Last.fm integration improves similar-song quality. Get a free API key at https://www.last.fm/api/account/create and enter it during myplaylist setup. You can skip this and run in yt-dlp-only mode.

Data Storage

~/.myplaylist/
  config.json          # API keys and settings
  playlists/
    <name>.json        # Saved playlists

Uninstall

# If installed via pipx or the install.sh script:
pipx uninstall myplaylist

# If installed via Homebrew tap:
brew uninstall myplaylist
brew untap haoziwlh/autoplaylist

License

MIT — see LICENSE.

Running Tests

pip install pytest
pytest tests/                     # smoke tests (no network)
pytest tests/ -m slow             # include integration tests (requires network)

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

myplaylist-0.2.0.tar.gz (37.2 kB view details)

Uploaded Source

Built Distribution

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

myplaylist-0.2.0-py3-none-any.whl (36.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: myplaylist-0.2.0.tar.gz
  • Upload date:
  • Size: 37.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for myplaylist-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b203e1a426235a7898180c9b4137f1e1f6b2bad0ab1d1eca0a79fe1ca1f0760f
MD5 9ecccaaa558f4f4e1a5a481d6e208246
BLAKE2b-256 1dd5f33ec16f2875ad986057f86c68e4179abb6919e081fe2762bab56b84317c

See more details on using hashes here.

Provenance

The following attestation bundles were made for myplaylist-0.2.0.tar.gz:

Publisher: release.yml on haoziwlh/autoplaylist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: myplaylist-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 36.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for myplaylist-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 283bb1d0f6ddefeb0ba79a26065335f9aeb4a54be6ef1d61c7296f697df602d7
MD5 1eba4ddcc2c13572a0df7188b413fbd6
BLAKE2b-256 022dd7b47a75d89f362dd8baf0ec4bc456a717d8e3d1596441c4ccb7b307318b

See more details on using hashes here.

Provenance

The following attestation bundles were made for myplaylist-0.2.0-py3-none-any.whl:

Publisher: release.yml on haoziwlh/autoplaylist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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