- Terminal UI music player/library manager written in Go (tview/tcell).
- Scans audio libraries into SQLite, analyzes duration/key/BPM, and provides browsing, queueing, and playback.
cmd/txp/main.go: CLI entrypoint, config/db resolution, logging, start UI/player.internal/config/: config schema, defaults, load/save, path resolution.internal/storage/: SQLite access, schema/migrations, queue/errors/stats.internal/library/: library scan, metadata read, duration/key/BPM analysis.internal/player/: local audio playback via beep/oto.internal/ui/: TUI layout, panels, dialogs, shortcuts, palette, settings.internal/model/: core models (e.g.,Track).
- Build:
go build ./cmd/txp - Run:
go run ./cmd/txp - Run with config:
go run ./cmd/txp --config-path /path/to/config.json(directory paths resolve toconfig.json).
- Config is JSON; schema in
internal/config/config.go. - Default config path:
~/.txp/config.json(auto-created if missing). --config-pathuses the provided file and sets scope tocurrent(for queue).- Key fields:
libraries/selectedLibrarieslibrary_nav_cursormain_view:track_vieworlibrary_viewtheme,panel.libraryWidth,panel.queueWidth,panel.showTrackInfoshortcutsmap (customizable)analysis_*settings (window seconds, sample rate, BPM range)volume,enable_double_click_playback
TXP_LOG_PATH: override log file path.TXP_LOG_LEVEL:error(default),warn,info,debug.TXP_AUDIO_DIAG: enable periodic audio diagnostics logs (any non-empty value except0/false).
- SQLite created automatically:
- Default:
~/.txp/txp.db - With
--config-path:txp.dbnext to that config.
- Default:
- WAL + pragmas are enabled in
internal/storage/db.go.
tracks:path(PK),title,artist,album,genre,year,track_no,duration,mtime,checksum,key,bpm,favorite.queue:scope,position,path(PK:scope,position).track_stats:path(PK),play_count,skip_count,last_played,last_position.stats_cache:key(PK),value_json,updated_at.track_errors:path(PK),last_error,updated_at.
- Metadata via
github.com/dhowden/tag. - Playback via
beep+oto(internal/player/local.go). - Supported playback formats:
.mp3 .ogg .flac .wav .aif .aiff .m4a. - Analysis sampling supports
.mp3 .ogg .flac .wav, plus.aif/.aiffand.m4a.
.m4adecoding requires FFmpeg and build tagffmpeg.- Without the tag, m4a decode returns an error.
- Workspace may not be a git repo; avoid destructive git operations.
- Escape user-provided strings before rendering in tview (use
tview.Escape).