Skip to content
AlexDeveloperUwUPublic

About

A simple TUI for the personal user's library on Tidal

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

TidalTUI

A lightweight terminal UI for Tidal music streaming, built with Textual and python-vlc.

Features

  • Fast library browsing — Instantly load your favorite tracks and playlists with local caching
  • Followed artists — Browse artists you follow and play their top tracks directly
  • Playback control — Play, pause, skip, and control volume from the keyboard
  • Shuffle mode — Randomize track order for mixed listening
  • Audio device selection — Route playback to different speakers, headphones, or virtual audio devices (Windows)
  • OAuth login — Secure authentication via browser; session is cached for quick future launches
  • Keyboard-driven — Vim-like keybindings for efficient navigation
  • Minimal dependencies — Only VLC, Textual, and tidalapi

Prerequisites

  • Python 3.14+
  • VLC media player installed on your system (download)
  • uv package manager (install)
  • An active Tidal account (any subscription tier)

Installation

  1. Clone or download the repository
  2. Install dependencies with uv:
uv sync
  1. Run the app:
uv run python main.py

On first launch, you'll be directed to authenticate with Tidal via a browser OAuth flow.

Keyboard Shortcuts

Navigation

Key Action
L Focus library sidebar
A Focus artists sidebar
T Focus tracks table
Ctrl+L Toggle sidebar visibility

Playback

Key Action
Space Play / Pause
N Next track
P Previous track
R Toggle shuffle mode

Volume & Output

Key Action
U Volume up (+5%)
D Volume down (-5%)
O Select audio output device

Library & Sorting

Key Action
S Toggle sort order (newest/oldest)
? Show help screen

General

Key Action
Ctrl+C Quit the application

Getting Started

First Run

  1. Launch the app — a browser window opens to log in
  2. After login, your Tidal session is saved locally
  3. On subsequent launches, the cached session is used (no re-authentication needed)
  4. Your library, playlists, and settings persist across sessions

Basic Workflow

  1. Press L to focus the library sidebar (favorites + playlists)
  2. Press A to focus the artists sidebar (followed artists); the first artist auto-loads
  3. Navigate with arrow keys to select a playlist or artist
  4. Press Enter or T to open the selection and focus the tracks table
  5. Navigate tracks with arrow keys; press Enter to start playback
  6. Press Space to pause, N for next, P for previous
  7. Press U/D to adjust volume
  8. Press R to toggle shuffle mode (plays random tracks from the current list)
  9. Press ? anytime to see all keybindings

Audio Device Selection

Windows only — The O key opens a dialog to select your audio output device:

  • Shows all active audio endpoints with friendly names
  • Defaults to "System Default"
  • Selection takes effect on the next track
  • Device choice is remembered across sessions

On non-Windows platforms, the device picker shows only "System Default".

Configuration

Data Directory

All session, cache, and log files are stored in app_data/ by default. To use a custom location:

TIDALTUI_DATA_DIR=/path/to/dir uv run python main.py

Environment Variables

Variable Default Description
TIDALTUI_DATA_DIR app_data Directory for session, cache, settings, logs
TIDALTUI_LOG_LEVEL INFO Logging level: DEBUG, INFO, WARNING
TIDALTUI_QUALITY high_lossless Audio quality (see tidalapi Quality options)

User Settings

The app auto-saves your preferences to app_data/user_settings.json:

  • Volume level (0–100)
  • Sort order (newest or oldest first)
  • Shuffle mode (on/off)
  • Audio output device (device ID)

Project Structure

TidalTUI/
├── main.py                    # App entry point
├── audio_api/
│   ├── player.py             # VLC playback control
│   └── win32_devices.py       # Windows audio device enumeration
├── terminal_ui/
│   ├── main_view.py          # Main UI container and handlers
│   ├── login.py              # OAuth login flow
│   ├── modals.py             # Dialog windows (device picker, help)
│   ├── user_settings.py       # Settings persistence
│   ├── utils.py              # String truncation, formatting
│   └── widgets/
│       ├── player_footer.py   # Playback status bar
│       ├── sidebar.py         # Library menu
│       └── track_table.py     # Tracks display
├── tidal_api/
│   ├── provider.py           # Data fetching & caching
│   ├── session.py            # OAuth session management
│   ├── cache.py              # Local track/playlist cache
│   └── models.py             # Data models (CachedTrack, etc.)
├── ui_css/
│   ├── main_ui.tcss          # Main screen styles
│   └── login_ui.tcss         # Login screen styles
└── app_data/
    ├── tidal_session.json     # OAuth session token (created on first login)
    ├── user_settings.json     # User preferences (created on first run)
    ├── music_cache.json       # Cached tracks and playlists
    └── tidaltui.log           # Application logs

Troubleshooting

The app won't start

Error: ModuleNotFoundError: No module named 'vlc'

Error: KeyboardInterrupt or app crashes immediately

  • Check the log file at app_data/tidaltui.log for detailed error messages
  • Try increasing verbosity: TIDALTUI_LOG_LEVEL=DEBUG uv run python main.py

Authentication fails at login

Error: "Login failed" message or timeout

  • Ensure you have an active internet connection
  • Check app_data/tidaltui.log for API errors
  • Try logging in again — click the URL in the browser if the automatic launch fails

Solution: Delete app_data/tidal_session.json and restart the app to re-authenticate

No audio output or device picker doesn't work

Windows:

  • Ensure you have at least one audio output device configured in Windows Sound Settings
  • Try opening Sound Settings and selecting a different device
  • Check that VLC itself can play audio (test in VLC directly)

macOS/Linux:

  • The device picker is Windows-only; audio routes to the system default device
  • Check your system audio settings to select the output device

Playback is stuttering or silent

  1. Check that VLC can play audio independently (not a TidalTUI issue)
  2. Verify your Tidal subscription tier supports the requested quality
  3. Check internet bandwidth — streaming high-lossless quality requires good speeds
  4. Try reducing audio quality: TIDALTUI_QUALITY=high uv run python main.py

Sidebar or library won't load

  • Wait a few seconds — the app syncs your library in the background on startup
  • Check the status bar at the bottom for "Syncing library..." message
  • Press L, A, or T repeatedly to refocus widgets
  • Restart the app if it freezes

Session expired

  • The app automatically re-routes to login if your session expires
  • Delete app_data/tidal_session.json to force a fresh login next time

Development

Install dev dependencies:

uv sync --group dev

Run the linter:

uv run ruff check .

Enable debug logging:

TIDALTUI_LOG_LEVEL=DEBUG uv run python main.py

Logs are written to app_data/tidaltui.log (rotates at 5MB, keeps 3 backups).

Credits

About

A simple TUI for the personal user's library on Tidal

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages