Guide · Open source
How to use spotify-tui: install, connect and control Spotify
Updated · written with AI from the project's own documentation and checked against our catalogue data
spotify-tui is a text-based Spotify client that runs in your terminal, written in Rust. This guide is for people who want to control Spotify from the keyboard, or script it from the shell. By the end you will know how to install it, connect it to your own Spotify developer app, and use the interface and the spt command line.
Quick start
- 1Install spt. Install with Homebrew on macOS or Linux using brew install spotify-tui, or build from source with cargo install spotify-tui.
- 2Create a Spotify developer app. In the Spotify dashboard, create an app, copy the Client ID and Client Secret, and add http://localhost:8888/callback as a Redirect URI.
- 3Run spt and enter credentials. Start spt, paste your Client ID and Client Secret, and confirm the port (8888 by default).
- 4Approve access in the browser. Accept the permissions on the Spotify page. Paste the redirect URL into the terminal if the automatic handoff fails.
- 5Learn the key bindings. Press ? inside the UI to see the current key events and their actions.
- 6Script actions with the CLI. Use spt play, spt playback or spt search with flags from spt --help in your shell scripts.
Install spotify-tui
The binary executable is named spt. The project lists several install routes, depending on your system. The simplest on macOS or Linux is Homebrew, and Cargo works on any system where you can build Rust code.
- Homebrew (macOS and Linux): use the package manager route below.
- Snap, AUR helper, Nix, Scoop or Void Linux and Fedora/CentOS packages are also listed in the README.
- Cargo: install Rust with rustup first, then build from source. On Linux you also need the libssl development packages and pkg-config.
brew install spotify-tuiBuild from source with Cargo
Use this route if your architecture is not covered by the pre-built binaries on the releases page. Install Rust using the recommended rustup method, then run the install command. To update, run the same command again.
- On Linux, install the development packages for libssl and pkg-config before building.
- On Windows Subsystem for Linux, the README says you need additional dependencies.
cargo install spotify-tuiCreate a Spotify developer app and get your credentials
spotify-tui controls Spotify through Spotify's API, so it needs your own API credentials. The first time you run the app it asks for them, but the README also lists the steps to follow in advance.
- Open the Spotify dashboard at developer.spotify.com/dashboard/applications.
- Click Create an app. You will then see your Client ID and Client Secret.
- Click Edit Settings and add http://localhost:8888/callback to the Redirect URIs.
- Scroll down and click Save.
Authenticate on first run
Run spt in your terminal. The app asks you for your Client ID and Client Secret, then for a port. Press enter to accept the default port 8888 or type a custom one.
- Accept the permissions on the official Spotify page you are sent to.
- You are redirected to localhost. If the local server works, the redirect is handled automatically.
- If the local server fails, you may see a blank or Connection Refused page. Copy the full URL from the address bar and paste it into the prompt in the terminal.
sptUse the interface and the spt command
Running spt with no arguments opens the UI. Press ? to see a help menu listing the key events and what they do. The CLI can do most of what the UI does; run spt --help for the full list of options.
The README gives these examples of CLI actions: playing a playlist at random, playing a named track, liking the current song, toggling shuffle, play or pause, listing liked songs and searching with a custom output format.
- Play a random song from a playlist: spt play --name "Your Playlist" --playlist --random
- Like the current song and toggle shuffle: spt playback --like --shuffle
- Play or pause: spt playback --toggle
- List liked songs (50 is the max limit): spt list --liked --limit 50
- Print shell completions for zsh: spt --completions zsh
spt search "An even cooler song" --tracks --format "%t from %b" --limit 30Change settings in the config files
Your API credentials are stored in client.yml. Display and behaviour options live in config.yml. Both are in a spotify-tui folder under your home .config directory. Snap installs use a different path under snap/spt.
- client.yml: Spotify authentication. Edit it at any time.
- config.yml: theme colours and behaviour settings such as seek_milliseconds (sample value 5000) and volume_increment (sample value 10).
- Snap paths: ${HOME}/snap/spt/current/.config/spotify-tui/
${HOME}/.config/spotify-tui/config.ymlWhat people use it for
- Browse your library and control playback without leaving the terminal.
- Play a random track from a named playlist with a single shell command.
- Like the current song or toggle shuffle from a script or keyboard shortcut.
- Print search results in a custom format, such as song name and album, for use in other shell tools.
- Generate zsh or other shell completions for the spt command.
Frequently asked questions
Is spotify-tui free?
spotify-tui is released under the MIT licence, according to the project's README and repository information. You still need a Spotify account and the Spotify API credentials created in the developer dashboard.
How do I install spotify-tui?
On macOS or Linux, run brew install spotify-tui with Homebrew. If you prefer building from source, install Rust with rustup and run cargo install spotify-tui. Snap, AUR, Nix, Scoop and other routes are listed in the README.
Does spotify-tui need OpenSSL?
When you build with Cargo on Linux, the README says you need the libssl development packages and pkg-config. Package-manager installs are not covered by that note.
Does spotify-tui play music itself?
No. The README describes spotify-tui as a client that controls Spotify through its API, so Spotify must be running for playback. Do not expect the app to stream audio on its own.
Why does spotify-tui ask for a Client ID and Client Secret?
spotify-tui connects to Spotify's API to search music and control playback, and it needs credentials from a Spotify developer app you create. The app asks for them on first run.
What are the alternatives to spotify-tui?
The project lists spotifyd, ncspot and spotify-player as comparable projects. Look at their READMEs to compare features before choosing one.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
spotify-tui suits people who live in the terminal, use Linux or macOS and are comfortable creating a Spotify developer app and editing a config file. It is a poor fit if you want audio streamed inside the app, a graphical interface with album art, or mouse-driven controls. For those, consider the comparable projects listed in the README.
Install options & downloads