Skip to content

Getting started

This page walks through the path from an empty install to a first playlist. Every step is a single museflow command; the full option reference lives in the command pages.

Prerequisites

  • MuseFlow installed and configured as described in the README installation section (database, Spotify application credentials, settings).
  • The CLI's redirect URI registered in the Spotify application, when connecting a Spotify account: see provider connect.
  • An OpenRouter API key configured, for the steps that call an LLM (enrich tracks, taste build, playlist discover).
  • Your Spotify Extended streaming history, see Spotify data export.

The CLI is available as museflow when installed in the environment, or as uv run museflow from the repository. Run museflow --help or museflow <group> <command> --help at any time.

Commands act on the user set by MUSEFLOW_CLI_DEFAULT_EMAIL, in the environment or in .env; the examples below assume it is set. --email overrides it, and a command fails if neither is given. Two exceptions: the users commands never use the setting, and llm usage without --email sums all the users.

The flow

flowchart TD
    A["users create"] --> B["provider connect"]
    B --> C["tracks history<br/>(import the Spotify export)"]
    C --> D["rate history<br/>(optional)"]
    C --> E["enrich tracks<br/>(optional, LLM)"]
    D --> F["taste build<br/>(LLM, most expensive)"]
    E --> F
    C --> F
    F --> G["playlist discover<br/>(LLM, cheap)"]
    D --> X["playlist explore<br/>(LLM, cheap)"]
    C --> X
    C --> H["playlist history<br/>(local, no LLM)"]
    D --> H
    E --> H

1. Create a user

museflow users create --email user@example.com

The password is prompted for (hidden, with confirmation). See users.

2. Connect Spotify

museflow provider connect

A browser window opens on the Spotify consent page; once accepted, paste the URL the browser lands on (the page does not load) into the terminal. See provider.

3. Import the streaming history

Request the export first (Spotify data export), unzip it, then:

museflow tracks history --directory ~/Downloads/MySpotifyData

Short plays are ignored (90 seconds by default), and tracks are stored with their play count and first/last played dates. See tracks.

4. Rate tracks (optional)

museflow rate history --play

Scores from 0 to 10 are an explicit preference signal, on top of the play counts. They are used by taste build --rated-only, by playlist history --score-min, and by the stats commands. See rate.

5. Enrich tracks (optional)

museflow enrich tracks

Adds genre, mood and language metadata to tracks with an LLM. Required for the --genre, --mood and --locale filters of playlist history. See enrich.

6. Build a taste profile

museflow taste build --name my-profile

Analyses the library with an LLM and stores a master taste profile (eras, personality archetype, life-phase insights). Add --rated-only when enough tracks have been rated. See taste.

7. Discover a playlist

museflow playlist discover

Asks the advisor for new tracks guided by the profile, matches them on Spotify, and creates a playlist. Add --dry-run to preview the result without creating anything. See playlist.

Your artists' tracks you missed

Once tracks are rated or the history is imported, explore plays the tracks you don't know from your favourite artists, with no taste profile needed:

museflow playlist explore

See playlist explore.

The rediscovery path (no LLM call)

A playlist can also be built from the library itself, filtered and ordered by play count or score:

museflow playlist history --played-last-max 2023-12-31 --limit 30

This needs only steps 1 to 3 (a connected Spotify account is required to create the playlist). See the recipes for more.

What costs money

Command Calls an LLM Notes
enrich tracks Yes One request per batch of tracks (--batch-size). Use --limit to cap it.
taste build Yes The most expensive step: processes up to --track-limit tracks in batches. Use --resume after an interruption.
playlist discover Yes A few small advisor calls (DISCOVERY_MAX_ATTEMPTS, 3 by default). Use --dry-run to avoid creating a playlist.
playlist explore Yes One advisor call per round, usually one round. Use --dry-run to avoid creating a playlist.
everything else No playlist history, rate, stats, blacklist, llm usage, exports and imports run locally.

Each of them prints what it spent at the end; llm usage sums it over time.

Tip

enrich export / taste export / rate export / blacklist export save LLM results, ratings and the blacklist to YAML, so a database reset does not mean paying again. See Back up and restore.