cmd

package
v1.60.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

Package cmd implements CLI subcommands for cliamp.

Package cmd implements interactive subcommands invoked from the CLI. setup.go contains the provider onboarding wizard reachable via `cliamp setup`. It walks the user through configuring each remote provider (Navidrome, Plex, Jellyfin, Spotify, Qobuz, NetEase, YouTube Music), validates the connection where possible, and writes the resulting TOML section to ~/.config/cliamp/config.toml.

The UI is a small standalone Bubbletea+Lipgloss program — separate from the main player Model — because setup runs to completion and exits.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HistoryClear

func HistoryClear() error

HistoryClear wipes the history file.

func HistoryShow

func HistoryShow(limit int, jsonOutput bool) error

HistoryShow prints recently played tracks, newest first. limit <= 0 prints all. When jsonOutput is true, output is a JSON array suitable for scripting.

func PlaylistAdd

func PlaylistAdd(name string, paths []string) error

PlaylistAdd appends tracks from the given paths to an existing playlist.

func PlaylistBookmark

func PlaylistBookmark(name string, index int) error

PlaylistBookmark toggles the bookmark flag on a track by index.

func PlaylistBookmarks

func PlaylistBookmarks() error

PlaylistBookmarks lists all bookmarked tracks across all playlists.

func PlaylistCreate

func PlaylistCreate(name string, paths []string, sshHost string) error

PlaylistCreate creates a new playlist from the given file and directory paths. If sshHost is non-empty, remote paths are walked via SSH.

func PlaylistDedupe

func PlaylistDedupe(name string) error

PlaylistDedupe removes duplicate tracks by exact path, keeping first wins.

func PlaylistDelete

func PlaylistDelete(name string) error

PlaylistDelete deletes an entire playlist.

func PlaylistDoctor

func PlaylistDoctor(name string, fix bool) error

PlaylistDoctor reports missing local files and optionally prunes them.

func PlaylistEnrich

func PlaylistEnrich(name string) error

PlaylistEnrich probes duration and derives album metadata for SSH tracks.

func PlaylistExport

func PlaylistExport(name, format, output string) error

PlaylistExport writes a playlist as M3U or PLS.

func PlaylistImport

func PlaylistImport(path, name string) error

PlaylistImport converts a local M3U/PLS file into a TOML playlist.

func PlaylistList

func PlaylistList() error

PlaylistList prints all playlists with their track counts.

func PlaylistRemove

func PlaylistRemove(name string, index int) error

PlaylistRemove removes a track by index from the named playlist. The index is 1-based for the user, converted to 0-based internally.

func PlaylistRename

func PlaylistRename(oldName, newName string) error

PlaylistRename renames a local playlist.

func PlaylistShow

func PlaylistShow(name string, jsonOutput bool) error

PlaylistShow displays the tracks in a playlist. If jsonOutput is true, the track list is printed as a JSON array to stdout.

func PlaylistSort

func PlaylistSort(name, by string) error

PlaylistSort sorts a playlist in place by one of the supported metadata keys.

func Setup

func Setup() error

Setup launches the interactive wizard. Returns nil on clean exit.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL