# Octo TUI Octo TUI is a Rust terminal interface for playing music from an [Octo server](https://github.com/winters27/octo). It also supports **Navidrome and Subsonic** and is based on the features and protocol implementation in [Octo Player](https://github.com/winters27/octo-player). Browse with Vim keys, stream music, build a queue, and discover songs beyond your library when connected to Octo. ## Screenshots ![Octo TUI general view](screenshots/octo-tui-1.png) Vim-like shortcut mapping, available in the player by pressing `?`: ![Octo TUI help panel showing vim-like keyboard shortcuts](screenshots/octo-tui-2.png) ## Run Requires Rust/Cargo and **mpv** for audio playback on Linux or macOS. Browsing works without mpv. ```sh # Debian / Ubuntu sudo apt install mpv cargo build --release ``` Connect to your server using environment variables: ```sh export OCTO_SERVER=https://music.example.com export OCTO_USERNAME=your-name read -rs 'OCTO_PASSWORD?Server password: '; echo # Zsh export OCTO_PASSWORD cargo run --release ``` Alternatively copy `config.example.toml` to `~/.config/octo-tui/config.toml`. `--config PATH` selects another file. Environment variables override configuration. Servers with API-key authentication can use `OCTO_API_KEY` instead of username/password. Server addresses may include a reverse-proxy subpath, such as `https://example.com/music`. The config supports `server`, `username`, `password`, `api_key`, `volume` (0–100), and `theme`. Prefer environment variables for secrets; use `chmod 600` if storing credentials in a file. HTTPS is recommended: Subsonic token authentication does not encrypt the connection. Credentials and signed URLs are excluded from displayed HTTP errors and saved queues. ## Features - `0 Home` opens immediately at startup, with Recently played, Recently added, Most played, Rediscover, Highest rated, History, Discover new music, and Stations. Move with `j`/`k` and press Enter to open a section. The first five sections browse server-provided album lists; open an album to browse or play its tracks. Recently played and Most played reflect history recorded by your server, not a separate local history. Use `<`/`>` for additional album pages, `R` to refresh, and Backspace to return to Home. - Albums with newest, alphabetical, frequent, recent and random ordering; artists, songs, genres, and playlists. Press `i` on a song to open its artist’s tracks in one flattened list, with an Album column. Albums load concurrently, up to four at a time, while retaining the server’s album and track order. Songs without an artist ID use an exact-name lookup; ambiguous or missing matches show an error. - Press `a` on a song to choose an existing playlist with `j`/`k`, then Enter to append it. Select “Create new playlist” or press `n` to enter a name and create it with the selected song. Esc cancels or returns to the picker. All playlists are shown, matching panel `4`. Lists explicitly marked read-only by the server are labeled and cannot be modified; normal playlist updates remain subject to server permissions. Errors stay visible in the dialog. - Song lists include a Year column when space permits, using the server’s release year (or album year when the track omits it); unknown years show “—”. - `/` finds the first matching title, artist, or album in the current view as you type, keeping every row visible. Enter keeps the cursor position; Esc restores the original position. It searches only loaded rows. `1 Search` opens server search across songs, albums and artists; Enter submits the query. `2 Artists` opens artists. Album and song pages contain 100 entries, with explicit paging. - Octo charts, station tracks and song radio. Standard Subsonic discovery uses random library songs and server-supported similar songs. - Clear `DISCOVER` labels for external tracks, with `d` to request a download into your server library. - A “Suggested by” column shows the service Octo reports (Last.fm, YouTube Music, Sounds alike, ListenBrainz, etc.). The selected song's source also appears in the footer on narrow terminals. Chart-level sources fill missing per-track sources; absent external-song sources are labeled “Unknown”. This identifies the recommendation provider, not necessarily the audio host. - A separate “Loaded from” column and footer label distinguish playback origin from recommendation source. Library tracks show “Library”; external tracks on a confirmed Octo server show “YouTube (default)”; other unknown external providers show “Unknown”. Octo's public song API does not report the upstream actually chosen for a particular stream: the default label follows its [documented playback behavior](https://github.com/winters27/octo#playback-and-acquisition), and a ready local/acquired copy can take precedence. It is not a live provider verification. - SIXEL album/song covers follow the currently playing track, including while paused; browsing does not change the cover. The song title and artist appear below it. Downloads and decoding run in the background with an eight-image memory cache. - Dark, Monokai, Spotifyish, Nord, Gruvbox, Daylight and Paper themes (Spotifyish is the default); switch live with `t`. - A live **Queue** box immediately below the cover shows the current track and upcoming songs. It follows playback and queue edits; press `8` to manage the full queue. Playing songs keep their normal text color in both queue panels. Panel `8` opens at the current song. All song-list panels mark the current song with a bold `PLAYING` or `PAUSED` status independently of your cursor; Queue marks only the active occurrence of duplicate songs. On wide terminals it remains available with `--no-art` when the queue has songs. - **History (`9`)** appears below Queue (`8`) and remembers songs played in this TUI, newest first. It records once a track has loaded and playback advances; queued songs and failed starts are excluded. It keeps the latest 1,000 distinct tracks per server/account across restarts. Press `a` on a history entry to add it to a playlist. History is local to this player, separate from Home’s server-provided Recently played album list. - Streaming through mpv, pause, seek, volume, automatic next track, queue repeat, shuffle, removal and reordering. - Navidrome Now Playing notifications when library tracks start. The server can display the current track, and play counts are unaffected by the notification. - Queue, listening history, volume and the selected theme saved separately for each server/account under `$XDG_CONFIG_HOME/octo-tui` (default `~/.config/octo-tui`). Playback starts only on request after restarting. - Background network workers keep navigation responsive; outdated navigation responses are discarded. ## Library-only mode Press `m` to toggle **Library only**; the header shows when it is enabled. The choice is saved per server/account. Search, radio, stations, albums, artists, playlists and History hide songs Octo marks as external. Discover offers random library songs. No additional audio downloads are requested by this mode; library audio still streams from your server. Enabling it removes external songs from the current queue and stops playback if the current track is external. Library tracks keep playing. History is preserved, and online results become available again when you switch the mode off. A radio or station that returns only external tracks shows an empty library-only view. ## Covers and themes SIXEL support is queried at startup. The cover panel appears on terminals at least 100 columns wide and 20 rows high; it hides automatically on smaller terminals. Terminals without detected SIXEL support retain the text interface. ```sh cargo run -- --theme monokai cargo run -- --theme spotifyish cargo run -- --no-art ``` `--no-art` disables artwork and the capability query. Inside tmux, enable `allow-passthrough` for graphics support. Missing or failed covers show a placeholder and do not interrupt playback. **Gruvbox** is a dark theme using the [original Gruvbox palette](https://github.com/morhetz/gruvbox): warm gray backgrounds, cream text and yellow accents. Select it with `--theme gruvbox` or `theme = "gruvbox"` in your config. For bright surroundings, **Daylight** uses a white background with dark text and blue accents; **Paper** uses a warm ivory background with dark text and brown accents. Both use stronger borders and high-contrast secondary text. Select them with `--theme daylight` / `--theme paper`, or press `t` to cycle. Set a default in your config: ```toml theme = "monokai" # dark, monokai, spotifyish, nord, gruvbox, daylight, paper ``` Theme priority at startup is `--theme`, then config `theme`, then your saved session choice, then Spotifyish. Live changes are saved per server/account. ## Server compatibility and playback troubleshooting The API was checked against [Octo Player revision `1f46c3a8`](https://github.com/winters27/octo-player/commit/1f46c3a8) (2026-11-15). Its Subsonic protocol version remains `1.16.1`. Stream requests use `format=raw` and an `octoPlay` token per queue entry, preserved when replaying or reordering that entry. Tokens are regenerated when a new queue replaces the current one or the app restarts. Playlist browsing and the add dialog share response parsing. Empty lists, malformed replies and request failures have distinct messages. Playlist writes check `octoSkipped`, including successful responses that did not add the song, and recognize `octoConflict`. Imported read-only copies and library upkeep action/notice lists cannot be used as ordinary add targets; request lists remain available. Unknown acquisition stages remain pending and continue polling. New stream-version selection, playlist folders and acquisition keep-anyway actions are not exposed by this TUI. Playback uses your normal mpv configuration, including audio device settings, with terminal input and video disabled. Playback errors distinguish stream access, unsupported server responses, decoding and audio output failures when mpv supplies that information. Errors do not echo signed stream URLs. If ordinary local playback works but the TUI fails, retry with the updated binary and use its specific error to distinguish server stream access from audio output problems. ## Development ```sh cargo fmt --check cargo test cargo clippy --all-targets -- -D warnings ``` Tests cover original-player response compatibility, authenticated request encoding, discovery/source parsing, cover limits and stale responses, SIXEL encoding, theme persistence, download actions, navigation, queue transitions, and rendering at different terminal sizes. The test fixture in `tests/fixtures/search3.json` comes from [Octo Player’s Subsonic module](https://github.com/winters27/octo-player/tree/1f46c3a8/subsonic). Uses [ratatui-image](https://docs.rs/ratatui-image/4.2.0/ratatui_image/) for SIXEL integration with the existing Ratatui version, [Ratatui](https://docs.rs/ratatui/0.29.0/ratatui/), [Reqwest](https://docs.rs/reqwest/0.12.28/reqwest/), and [mpv JSON IPC](https://mpv.io/manual/stable/#json-ipc). GPL-3.0-only; see `LICENSE` and the original [Octo Player project](https://github.com/winters27/octo-player).