Skip to content

LargeModGames/spotatui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2,352 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

spotatui

A terminal music player written in Rust, powered by Ratatui β€” native Spotify streaming, synced lyrics, a real-time audio visualizer, and optional Local, Subsonic/Navidrome, Internet Radio, and YouTube sources. Spotify is optional.

A community-maintained, actively developed fork of spotify-tui.

Crates.io Upstream X Songs played using Spotatui spotatui Contributors Upstream Contributors

Demo

Song History

Song History

Table of Contents

Features

  • Multiple sources β€” Spotify optional. Play from Spotify, Local Files, a Subsonic/Navidrome server, Internet Radio, or YouTube. The free sources need no Spotify account; press d to switch between them at any time.
  • Native streaming. Play Spotify audio directly, no official app or spotifyd required β€” spotatui appears as its own Spotify Connect device (Premium required).
  • Synced lyrics. Line-by-line lyrics that follow playback.
  • Real-time audio visualizer. A system-wide FFT visualizer (press v) that reacts to whatever is playing.
  • Cross-source play queue. Press z on any track to queue it β€” the queue plays across every source before your current context resumes.
  • Lua plugins. Extend spotatui with event hooks, commands, keybindings, popups, and theming.
  • Listening history & recap. spotatui keeps a local play history and can generate a shareable HTML recap (spotatui history recap).
  • Full CLI. Most of what the UI does is scriptable β€” playback, search, playlists, shell completions. Run spotatui --help.
  • Lightweight. ~78 MB RAM while streaming, versus a full Electron client. See Performance.

Installation

Spotify is optional. On first launch spotatui asks which source you want to use. YouTube, Subsonic/Navidrome, Internet Radio, and Local Files all work with no Spotify account. Spotify Premium is only needed for the Spotify source; you can add it anytime from the d menu.

# Homebrew (macOS only)
brew tap LargeModGames/spotatui
brew install spotatui

# Winget (Windows)
winget install spotatui

# Cargo
cargo install --locked spotatui

# Arch Linux (AUR) - pre-built binary (faster)
yay -S spotatui-bin

# Arch Linux (AUR) - build from source
yay -S spotatui

# Void Linux (Unofficial Repo)
echo repository=https://raw.githubusercontent.com/Event-Horizon-VL/blackhole-vl/repository-x86_64 | sudo tee /etc/xbps.d/20-repository-extra.conf
sudo xbps-install -S spotatui
# NixOS (Flake)

# Add spotatui to your flake inputs:
inputs = {
  spotatui = {
    url = "github:LargeModGames/spotatui";
    inputs.nixpkgs.follows = "nixpkgs";
  };
}

# Add the spotatui package from your inputs to your config:
{ inputs, ...}:{
  # Your other configurations
  environment.systemPackages = with pkgs; [
    inputs.spotatui.packages.${pkgs.stdenv.hostPlatform.system}.default
  ];
}

Or download pre-built binaries from GitHub Releases.

See the Installation Wiki for platform-specific requirements and building from source.

Quickstart

Run spotatui. On the first launch it asks which source to set up:

Welcome to spotatui! Choose your music source:

  1) Spotify        (needs login)
  2) YouTube        (free, needs the yt-dlp binary)
  3) Subsonic       (free, needs a Subsonic/Navidrome server)
  4) Internet Radio (free)
  5) Local Files    (free)

Pick a free source to skip Spotify entirely, or pick Spotify to run the auth wizard (you'll create a Spotify Developer app β€” see the Installation Wiki). Only sources compiled into your build are listed.

Once you're in:

  • Press ? for the in-app help menu of all key events.
  • Press d to open the Source & Device picker and switch sources.
  • Press z on a track to queue it; open the queue with Shift+Q.
  • Run spotatui --help for the CLI. See the Keybindings Wiki for every shortcut.

A few CLI examples to get you started:

spotatui --completions zsh                       # Shell completions (bash, powershell, and more supported)
spotatui play --name "Your Playlist" --playlist --random  # Play a random song from a playlist
spotatui playback --toggle                       # Play/pause current playback
spotatui list --liked --limit 50                 # List your liked songs
spotatui history recap --period 30d --output ./recap.html  # Generate a shareable listening recap

Adding Spotify later

Started with a free source and want Spotify too? Press d, select Spotify, and spotatui opens your browser to log in without restarting β€” enabling browsing, playlists, and controlling external devices right away. Native (librespot) streaming still requires a restart, since it initializes at startup.

Music Sources

spotatui is a general music player, not just a Spotify client. Press d to open the Source & Device picker; the sidebar and search re-scope to the active source. Playback for these sources runs through spotatui's own audio engine, so volume control and the visualizer work exactly as they do for Spotify β€” and none of them need Spotify Premium.

Source What it does Needs
Local Files Browse and play a folder of audio files (FLAC, MP3, OGG, WAV, …) Nothing; set local_music_path or use the OS music dir
Subsonic Browse, search, and stream from any Subsonic-compatible server (Navidrome, Gonic, Airsonic, Funkwhale, …) A server account
Internet Radio Play icecast/shoutcast streams with live now-playing metadata; search the radio-browser.info directory (30k+ stations) Nothing
YouTube Search YouTube and play audio; build local playlists stored in a plain file yt-dlp on your PATH (ffmpeg recommended)

Resuming your last session: quit while playing from a non-Spotify source and spotatui restores that track and its position on the next launch, following the startup_behavior setting (continue, play, or pause).

Availability: included in the Linux and Windows release binaries. Not yet on macOS (the shared audio output path is disabled there pending a fix; contributions welcome). When building from source, enable them with cargo features:

cargo install --locked spotatui --features local-files,subsonic,internet-radio,youtube

Each source has a few config keys; the essentials are below, and the full reference lives in the Configuration Wiki.

Local Files

Set a folder (defaults to the OS music directory), then pick Local Files in the d picker:

behavior:
  local_music_path: "/home/you/Music"

Subsonic / Navidrome

behavior:
  subsonic_url: "https://music.example.com"
  subsonic_username: "you"

Prefer setting the password via the SPOTATUI_SUBSONIC_PASSWORD environment variable so it never sits in the config file in plaintext.

Internet Radio

Search the radio-browser.info directory in-app (Enter plays a station directly), and press the save key (F by default) to keep a station in your sidebar. Saved stations live under behavior.radio_stations; the playbar shows a LIVE badge with the stream's now-playing title.

YouTube

Requires the yt-dlp binary (ffmpeg recommended). No Google account, API key, or cookies β€” search and playback are anonymous. If playback breaks after a YouTube change, updating yt-dlp (yt-dlp -U) is the fix; no spotatui update needed.

Local YouTube playlists live in ~/.config/spotatui/youtube_playlists.yml, a plain human-editable file you can back up or share. Create one from the sidebar, add tracks with w, and play a playlist as a queue with Enter.

Native Streaming

spotatui can play Spotify audio directly, without spotifyd or the official app β€” just run it and it appears as a Spotify Connect device.

  • Premium account required
  • Works with media keys, MPRIS (Linux), and macOS Now Playing
  • Runs on our maintained librespot fork, which backports upstream fixes for Spotify's evolving audio delivery (e.g. the HTTP 530 CDN issue that silenced native playback)

See the Native Streaming Wiki for setup details.

Configuration

The config file is at ${HOME}/.config/spotatui/config.yml. You can also configure spotatui in-app by pressing Alt-, to open Settings.

Nearly everything is customizable: keybindings, themes, icons, playbar button labels, status-line and window-title format templates, table columns (reorder/rename/resize), default sorting per screen, startup screen, and layout (sidebar/playbar position). Invalid values fall back to defaults with a logged warning β€” a config typo never blocks startup.

spotatui also stores local listening history at ${HOME}/.config/spotatui/history/listens.jsonl, which powers spotatui history recap. Short or skipped plays are stored but excluded from recap totals.

Discord Rich Presence

Enabled by default using the built-in spotatui application ID, so no setup is required. Optional overrides:

behavior:
  enable_discord_rpc: true
  discord_rpc_client_id: "your_client_id"

You can also override the app ID via SPOTATUI_DISCORD_APP_ID, or disable it in Settings or with behavior.enable_discord_rpc: false.

Anonymous Song Counter

spotatui includes an opt-in global counter showing how many songs have been played by all users worldwide (the badge and chart at the top of this README). It is completely anonymous β€” no personal information, song names, artists, or listening history is collected; it only sends a simple increment when a new song starts. It is enabled by default and can be disabled with enable_global_song_count: false in ~/.config/spotatui/config.yml. This is purely a fun community metric with zero tracking of individual users.

GitHub Profile Widget

Show what you're listening to as a live card on your GitHub profile. Create an account at spotatui.com, paste your sync token into Settings β†’ sync_token, then pick a public username and enable the widget on your dashboard. Add this to your profile README:

[![Now playing on spotatui](https://spotatui.com/widget/your-username.svg)](https://spotatui.com)

The card shows cover art, title, artist, a progress bar, and an animated equalizer while playing; internet radio gets a LIVE badge. Append ?theme=light for the light variant. Only your current track is public, and only after you opt in.

Plugins

spotatui runs user-written Lua plugins. They react to playback events, add commands and key bindings, draw popups and playbar segments, restyle the theme, and make async HTTP requests. Install one published as a git repository (requires git):

spotatui plugin add owner/repo
spotatui plugin list
spotatui plugin update
spotatui plugin remove <name>

See PLUGINS.md for the ecosystem overview, examples/plugins/ for runnable examples, and docs/scripting.md for the full API reference.

Performance

spotatui is extremely lightweight compared to the official Electron client.

Mode RAM Usage
Native Streaming (Base) ~78 MB
With Synced Lyrics ~78 MB
With System-Wide Visualizer ~80 MB

Tested on Arch Linux (Hyprland).

Playback Requirements

The free sources (Local Files, Subsonic, Internet Radio, YouTube) play through spotatui's own audio engine and need no extra setup.

Spotify is different: it uses the Web API, which doesn't stream audio itself. To play Spotify tracks you need one of:

  1. Native Streaming β€” spotatui plays audio directly using its built-in streaming. See Native Streaming. (Recommended.)
  2. Official Spotify Client β€” have the official app open on your computer.
  3. spotifyd β€” a lightweight background alternative.

Playing Spotify tracks requires a Premium account. With a free Spotify account spotatui can authenticate and browse your library/search results, but playback actions (play/pause/seek/transfer) will not work in either native streaming or Web API playback control mode.

Deprecated Spotify API Features

As of November 2024, Spotify removed access to certain API endpoints for new applications. The following features only work if your Spotify Developer application was created before November 27, 2024:

  • Related Artists β€” the "Related Artists" section on an artist page.

  • Audio Analysis β€” spotatui no longer depends on it. The audio visualizer (press v) now uses local real-time FFT analysis of your system audio, so it works regardless of your app's creation date:

    Platform Status Notes
    Windows Works out of the box Uses WASAPI loopback
    Linux Works out of the box Uses PipeWire/PulseAudio monitor devices
    macOS Requires setup Needs a virtual audio device (see below)

    macOS: macOS doesn't natively expose system audio loopback. Install a virtual audio device like BlackHole (free) or Loopback (paid), route system audio through it, and set it as your default input device.

    Note: The visualizer is system-wide β€” it captures all audio on your system, so it also reacts to YouTube videos, games, and any other source.

For more information, see Spotify's announcement about API changes.

Using with spotifyd

Note: If you're using native streaming, you don't need spotifyd!

Follow the spotifyd documentation to get set up. After that:

  1. Start the spotifyd daemon.
  2. Start spotatui.
  3. Press d to open the device selection menu β€” the spotifyd "device" should appear (if not, check these docs).

Migrating from spotify-tui

If you used the original spotify-tui before:

  • The binary name changed from spt to spotatui.
  • Config paths changed: ~/.config/spotify-tui/ β†’ ~/.config/spotatui/.

You can copy your existing config:

mkdir -p ~/.config/spotatui
cp -r ~/.config/spotify-tui/* ~/.config/spotatui/

You may be asked to re-authenticate with Spotify the first time.

Libraries used

Development

  1. Install OpenSSL
  2. Install Rust
  3. Install xorg-dev (required for clipboard support)
  4. Linux only: Install PipeWire development libraries (required for audio visualization)
    # Debian/Ubuntu
    sudo apt-get install libpipewire-0.3-dev libspa-0.2-dev
    
    # Arch Linux
    sudo pacman -S pipewire
    
    # Fedora
    sudo dnf install pipewire-devel
    
    # NixOS
    nix develop github:LargeModGames/spotatui
  5. Clone or fork this repo and cd to it
  6. And then cargo run

See CONTRIBUTING.md for pull request guidelines.

Windows Subsystem for Linux

You might get a linking error. If so, you'll probably need to install additional dependencies required by the clipboard package:

sudo apt-get install -y -qq pkg-config libssl-dev libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev

Help Wanted

spotatui is currently maintained by a solo developer. More contributors would be hugely appreciated β€” and you don't need to write code to help:

  • Star the repo to help others discover the project
  • Report bugs or request features in Issues
  • Join the community in Discussions
  • Submit a PR for code, docs, or themes

See CONTRIBUTING.md for more details!

Maintainer

Maintained by LargeModGames (@LargeModGames on Twitter).

Originally forked from spotify-tui by Alexander Keliris.

spotatui Contributors

Looking for contributors! spotatui is actively maintained but could use your help. Whether it's bug fixes, new features, documentation, or testing - all contributions are welcome!

LargeModGames
LargeModGames

πŸ’» πŸ“– 🚧 πŸ€” πŸš‡ ⚠️
MysteriousWolf
MysteriousWolf

πŸ’»
rawcode1337
rawcode1337

πŸ’» πŸ›
copeison
copeison

πŸ“¦
jacklorusso
jacklorusso

πŸ“–
H41L33
H41L33

πŸ“–
LordMZTE
LordMZTE

πŸ’» πŸ“¦
Sebastian Sarco
Sebastian Sarco

πŸ’»
Sergio Tabernero HernΓ‘ndez
Sergio Tabernero HernΓ‘ndez

πŸ’» πŸ“¦
David Novakovic
David Novakovic

πŸ’»
Paul
Paul

🎨 πŸ’»
Arun Felix
Arun Felix

πŸ’» πŸ›
MaySeikatsu
MaySeikatsu

πŸ’» πŸ“– πŸ“¦
Lorenzo Bodini
Lorenzo Bodini

πŸ’» 🎨
Vi1i Petal
Vi1i Petal

πŸ’» πŸ›
Will Sturgeon
Will Sturgeon

πŸ’» πŸ›
wfinken
wfinken

πŸ’» πŸ›
Jacob
Jacob

πŸ“¦
Dominick Lee
Dominick Lee

πŸ’»
Higor Prado
Higor Prado

πŸ’»
Vitali Kaplich
Vitali Kaplich

πŸ“–
knth
knth

πŸ’»
Lorelei Noble
Lorelei Noble

πŸ’»
Ben Allen
Ben Allen

πŸ’»
shilicioo
shilicioo

πŸ’»
Thomas Allan
Thomas Allan

πŸ’»
Pratyoosh Prakash
Pratyoosh Prakash

πŸ’» πŸ›
Tahmid Ahmed
Tahmid Ahmed

πŸ’»
Ritze
Ritze

πŸ’» πŸ›
Hansen
Hansen

πŸ“–

Want to see your name here? Check out our open issues or the Roadmap below!


Upstream Contributors (spotify-tui)

Thanks to all the contributors who built the original spotify-tui that this project is forked from:

Alexander Keliris
Alexander Keliris

πŸ’» πŸ“– 🎨 πŸ“ πŸ€” πŸš‡ πŸ“¦ πŸ‘€
Mickael Marques
Mickael Marques

πŸ’΅
Grzegorz Koperwas
Grzegorz Koperwas

πŸ“–
Austin Gassert
Austin Gassert

πŸ’»
Calen Robinette
Calen Robinette

πŸ’»
M*C*O
M*C*O

πŸš‡
Andrew Chin
Andrew Chin

πŸ’»
Sam Naser
Sam Naser

πŸ’»
Micha
Micha

πŸ’»
neriglissar
neriglissar

πŸ’»
Timon
Timon

πŸ’»
echoSayonara
echoSayonara

πŸ’»
D-Nice
D-Nice

πŸ“– πŸš‡
Grzegorz Pawlik
Grzegorz Pawlik

πŸ’»
Lennart Bernhardt
Lennart Bernhardt

πŸ’»
Arnaud Lefebvre
Arnaud Lefebvre

πŸ’»
tem1029
tem1029

πŸ’»
Peter K. Moss
Peter K. Moss

πŸ’»
Geoff Shannon
Geoff Shannon

πŸ’»
Zachary Mayhew
Zachary Mayhew

πŸ’»
jfaltis
jfaltis

πŸ’»
Marcel Schramm
Marcel Schramm

πŸ“–
Fangyi Zhou
Fangyi Zhou

πŸ’»
Max
Max

πŸ’»
Sven van der Vlist
Sven van der Vlist

πŸ’»
jacobchrismarsh
jacobchrismarsh

πŸ’»
Nils Rauch
Nils Rauch

πŸ’»
Nick Stockton
Nick Stockton

πŸ’» πŸ› 🚧 πŸ’¬ πŸ“–
Stuart Hinson
Stuart Hinson

πŸ’»
Sam Calvert
Sam Calvert

πŸ’» πŸ“–
Jeroen Wijenbergh
Jeroen Wijenbergh

πŸ“–
Kimberley Cook
Kimberley Cook

πŸ“–
Audrey Baxter
Audrey Baxter

πŸ’»
Norman
Norman

πŸ“–
Peter Maatman
Peter Maatman

πŸ’»
AlexandreS
AlexandreS

πŸ’»
Finn Vos
Finn Vos

πŸ’»
Carlos Hernandez
Carlos Hernandez

πŸ“¦
Pedro Alves
Pedro Alves

πŸ’»
jtagcat
jtagcat

πŸ“–
Benjamin Kitor
Benjamin Kitor

πŸ’»
AleΕ‘ Najmann
AleΕ‘ Najmann

πŸ“– πŸ“¦
Jeremy Stucki
Jeremy Stucki

πŸ’»
(´⌣`ΚƒΖͺ)
(´⌣`ΚƒΖͺ)

πŸ’»
Artem Polishchuk
Artem Polishchuk

πŸ“¦
Chris Sosnin
Chris Sosnin

πŸ’»
Ben Buhse
Ben Buhse

πŸ“–
Sean Li
Sean Li

πŸ’»
TimotheeGerber
TimotheeGerber

πŸ’» πŸ“–
Ferdinand Ratajczak
Ferdinand Ratajczak

πŸ’»
Sheel Choksi
Sheel Choksi

πŸ’»
Michael Hellwig
Michael Hellwig

πŸ“–
Oliver Daniel
Oliver Daniel

πŸ’»
Drew Fisher
Drew Fisher

πŸ’»
ncoder-1
ncoder-1

πŸ“–
Macguire Rintoul
Macguire Rintoul

πŸ“–
Ricardo Holguin
Ricardo Holguin

πŸ’»
Keisuke Toyota
Keisuke Toyota

πŸ’»
Craig Astill
Craig Astill

πŸ’»
Onielfa
Onielfa

πŸ’»
usrme
usrme

πŸ“–
Sergey A.
Sergey A.

πŸ’»
Hideyuki Okada
Hideyuki Okada

πŸ’»
kepae
kepae

πŸ’» πŸ“–
Γ‰rico Nogueira Rolim
Γ‰rico Nogueira Rolim

πŸ’»
Alexander Meinhardt Scheurer
Alexander Meinhardt Scheurer

πŸ’»
OndΕ™ej KinΕ‘t
OndΕ™ej KinΕ‘t

πŸ’»
Kryan90
Kryan90

πŸ“–
n-ivanov
n-ivanov

πŸ’»
bi1yeu
bi1yeu

πŸ’» πŸ“–
May
May

πŸ’»
Bruno A. MuciΓ±o
Bruno A. MuciΓ±o

πŸ’»
Finn Hediger
Finn Hediger

πŸ’»
dp304
dp304

πŸ’»
Marco Micera
Marco Micera

πŸ“–
Marco Ieni
Marco Ieni

πŸš‡
ArtΓΊr KovΓ‘cs
ArtΓΊr KovΓ‘cs

πŸ’»
Antony Kellermann
Antony Kellermann

πŸ’»
Rasmus Pedersen
Rasmus Pedersen

πŸ’»
noir-Z
noir-Z

πŸ“–
David Bailey
David Bailey

πŸ“–
sheepwall
sheepwall

πŸ’»
Hwatwasthat
Hwatwasthat

πŸ’»
Jesse
Jesse

πŸ’»
Sang
Sang

πŸ“–
Yuuki Takahashi
Yuuki Takahashi

πŸ“–
Alejandro Angulo
Alejandro Angulo

πŸ’»
Anton Kostin
Anton Kostin

πŸ“–
Justin Sexton
Justin Sexton

πŸ’»
Jiati Le
Jiati Le

πŸ“–
Matthew Cobbing
Matthew Cobbing

πŸ’»
Milo
Milo

πŸš‡
Diego Veralli
Diego Veralli

πŸ’»
Maja Bojarska
Maja Bojarska

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

Star History

Star History Chart

Roadmap

The goal is to eventually implement almost every Spotify feature.

High-priority features:

  • Scroll through result pages in every view

See the Roadmap Wiki for the full API coverage table.

About

A fast, standalone terminal music player in Rust: native Spotify streaming plus local, Subsonic, radio, and YouTube sources.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

1k stars

Watchers

74 watching

Forks

Sponsor this project

 

Contributors

Languages