Skip to content

Config

Config is TOML. OAuth credentials live in private auth files under the app config directory, not in an OS keyring. On Unix, spotuify writes its config file with mode 0600, the auth directory with mode 0700, and auth files with mode 0600.

Terminal window
spotuify config path
SPOTUIFY_CONFIG=/tmp/spotuify.toml spotuify config path

These keys are accepted by spotuify config get and spotuify config set.

KeyTypeDefaultNotes
client_idstringrequiredSpotify Developer app client id for the default PKCE flow
client_secretstringnoneoptional for PKCE; config get redacts it unless --reveal-secret is passed
redirect_uristringhttp://127.0.0.1:8888/callbackmust match the Spotify app settings
player.backendenumembeddedonly embedded (in-process librespot); Spotifyd/Connect-only backends were removed
player.bitratenumber32096, 160, or 320
player.device_namestringnonepreferred embedded/connect device name
player.audio_output_devicestringsystem defaultlocal audio output the embedded player renders to; match a name from spotuify audio-outputs
player.normalizationboolfalseplayer normalization
player.audio_cache_mibnumber0embedded playback cache size
player.pulse_propsbooltrueLinux Pulse/PipeWire app props
player.event_hookstringnonelegacy alias for analytics.hook_command
analytics.hook_commandstringnoneshell hook command for qualified listens
analytics.hook_timeout_msnumber5000hard timeout for the hook command
cache.cover_cache_mbnumber200cover-art cache cap
cache.cover_cache_ttl_daysnumber30cover-art TTL
notifications.enabledboolfalsemaster switch for desktop notifications (needs the notifications build feature)
notifications.summarystring{track}summary template ({track} {artist} {album} tokens)
notifications.bodystring{artist} - {album}body template
notifications.on_track_changebooltruenotify when the playing track changes
notifications.on_pauseboolfalsenotify on pause
notifications.on_resumeboolfalsenotify on resume
notifications.on_skipboolfalsenotify on next/previous skips
notifications.on_errorbooltruenotify on auth errors (deduped)
discord.enabledboolfalseDiscord Rich Presence (needs the discord-rpc build feature + Discord running)
discord.application_idstringnoneDiscord application id for Rich Presence
Terminal window
spotuify config get player.bitrate
spotuify config set player.bitrate 320
spotuify config get client_secret
spotuify config get client_secret --reveal-secret

The notifications.summary / notifications.body templates expand these tokens from the current track: {track}, {artist}, {album}, {duration} (m:ss), and {progress} (m:ss). Defaults are {track} / {artist} - {album}.

Some config is loaded from TOML but not yet wired through config set.

[analytics]
store_raw_queries = true
retention_progress_days = 90
retention_events_days = 365
retention_operations_days = 90
daily_rollup_hour = 3
hook_command = "/Users/me/bin/spotuify-listen-hook"
hook_timeout_ms = 5000
allow_file_credentials = false
lastfm_api_key = "lastfm-api-key"
lastfm_user = "your-lastfm-user"
[viz]
enabled = true
source = "auto"
target_fps = 30
smoothing = 0.5
noise_gate = 0.005
color_scheme = "spotify-green"

The visualizer ships on by default. Set enabled = false to opt out. It animates from the embedded librespot sink tap; when no audio is playing the spectrum draws a flat baseline. Toggle it off if you want the player to use that vertical space for queue items instead.

analytics.lastfm_api_key and analytics.lastfm_user are defaults for historical Last.fm import. CLI flags override them:

Terminal window
spotuify analytics import lastfm --user your-lastfm-user --from 2024-01-01

The default auth path is dev-app PKCE. Put client_id in config or set SPOTUIFY_CLIENT_ID before login. First-party/keymaster auth is opt-in for experiments with SPOTUIFY_USE_FIRST_PARTY=1.

Terminal window
SPOTUIFY_CLIENT_ID=... spotuify login
SPOTUIFY_CLIENT_SECRET=... spotuify login
SPOTUIFY_REDIRECT_URI=http://127.0.0.1:8888/callback spotuify login
SPOTUIFY_USE_FIRST_PARTY=1 spotuify login

Last.fm historical import also reads environment defaults:

Terminal window
SPOTUIFY_LASTFM_API_KEY=lastfm-api-key \
SPOTUIFY_LASTFM_USER=your-lastfm-user \
spotuify analytics import lastfm --from 2024-01-01 --format json

For local development and tests:

Terminal window
# Run the whole stack against fake Spotify data; never touches live
# Spotify auth. Honored by the CLI, daemon, and TUI uniformly.
SPOTUIFY_FAKE_SPOTIFY=1 spotuify

The old proactive scope-drift credential read no longer runs at daemon startup. Scope checks now reuse the first real token read from the auth file.

Media controls (MPRIS on Linux, Now Playing on macOS, SMTC on Windows) are on by default. Set SPOTUIFY_NO_MEDIA_CONTROLS=1 before starting the daemon to turn them off entirely; on Windows this also skips the hidden-window driver.

Terminal window
SPOTUIFY_NO_MEDIA_CONTROLS=1 spotuify daemon restart
Terminal window
spotuify -o player.bitrate=160 play "ambient"
spotuify -o player.normalization=true play "ambient"

Overrides apply only to that command.