Configuration
Spotify Developer Setup
Section titled “Spotify Developer Setup”Before using Clispot, you must create a Spotify Developer application and configure your credentials.
Step 1: Create a Spotify Application
Section titled “Step 1: Create a Spotify Application”- Go to the Spotify Developer Dashboard and log in.
- Click on “Create an app”.
- Give your application a name and description.
- Find the “Redirect URIs” section and add the following URI:
http://127.0.0.1:9292/callback
- Save your changes.
- Now, view your application’s settings and find your Client ID and Client Secret.
Step 2: Configure Environment Variables
Section titled “Step 2: Configure Environment Variables”Linux / macOS
Section titled “Linux / macOS”Add the following lines to your shell’s configuration file (e.g., .bashrc, .zshrc, or .profile):
export SPOTIFY_CLIENT_ID="<your-client-id>"export SPOTIFY_CLIENT_SECRET="<your-client-secret>"After adding these lines, reload your shell configuration:
source ~/.bashrc # or ~/.zshrcWindows
Section titled “Windows”PowerShell
Section titled “PowerShell”To set them for the current session:
$env:SPOTIFY_CLIENT_ID="<your-client-id>"$env:SPOTIFY_CLIENT_SECRET="<your-client-secret>"To make them permanent (User level):
[System.Environment]::SetEnvironmentVariable('SPOTIFY_CLIENT_ID', '<your-client-id>', 'User')[System.Environment]::SetEnvironmentVariable('SPOTIFY_CLIENT_SECRET', '<your-client-secret>', 'User')Command Prompt (cmd)
Section titled “Command Prompt (cmd)”To set them for the current session:
set SPOTIFY_CLIENT_ID=<your-client-id>set SPOTIFY_CLIENT_SECRET=<your-client-secret>To make them permanent:
setx SPOTIFY_CLIENT_ID "<your-client-id>"setx SPOTIFY_CLIENT_SECRET "<your-client-secret>"Note: Without these credentials, Clispot will not be able to authenticate with Spotify.
Application Configuration
Section titled “Application Configuration”Clispot supports a persistent configuration file located at ~/.config/clispot/config.json (or $XDG_CONFIG_HOME/clispot/config.json). This allows you to set defaults for various options without passing flags every time.
Configuration File Structure
Section titled “Configuration File Structure”Here is an example of a complete config.json file:
{ "debug-dir": "/home/user/.local/state/clispot/logs", "cache-dir": "/home/user/.cache/clispot", "disable-cache": false, "yt-dlp-args": { "cookies-from-browser": "firefox", "cookies": "/path/to/cookies.txt" }, "skip-on-no-match": true}Configuration Options
Section titled “Configuration Options”debug-dir: Directory where debug logs are stored.cache-dir: Directory where downloaded audio files are cached.disable-cache: If set totrue, audio files will not be cached.yt-dlp-args: Arguments passed toyt-dlpfor downloading audio.cookies-from-browser: Use cookies from a specific browser (e.g., “firefox”, “chrome”).cookies: Path to a cookies file.
skip-on-no-match: If set totrue(default), Clispot will automatically play the next song in the queue if the current one cannot be found on YouTube. Iffalse, it will just show a toast message indicating the failure.
Note: Sometimes Clispot fails to find a matching song on YouTube. In this case, it shows a toast message. If
skip-on-no-matchis enabled (which is the default), it will automatically proceed to the next track.
Configuration Precedence
Section titled “Configuration Precedence”Clispot applies configuration in the following order of precedence (highest to lowest):
- Command Line Flags: Options passed directly to the
clispotcommand (e.g.,--debug-dir,--cache-dir,--headless). - Configuration File: Settings defined in
~/.config/clispot/config.json(Linux),%AppData%\clispot\config.json(Windows), or~/Library/Application Support/clispot/config.json(macOS). - Defaults: Hardcoded application defaults.
This means if you have headless-mode: true in your config file but run clispot --headless=false, the application will start in normal mode.
Authentication
Section titled “Authentication”On first run, clispot will:
- Start a local web server on port 9292
- Open your default browser to Spotify’s authorization page
- Ask you to authorize the application
- Save the authentication token to your configuration directory (e.g.,
~/.config/clispot/token.jsonor%AppData%\clispot\token.json)
The token is automatically refreshed when needed. You only need to authenticate once (unless you revoke it).
File Locations
Section titled “File Locations”- Config: (Respects
XDG_CONFIG_HOMEon Linux/macOS, defaults to~/.configon Linux,%AppData%on Windows,~/Library/Application Supporton macOS)clispot/token.json- Stores Spotify authentication tokenclispot/config.json- Application settings (optional)
- Cache: (Respects
XDG_CACHE_HOMEon Linux, defaults to~/.cacheon Linux,%LocalAppData%on Windows,~/Library/Cacheson macOS)clispot/yt-audio/- Cached audio files from YouTube
- Debug logs (State): (Respects
XDG_STATE_HOMEon Linux, defaults to~/.local/stateon Linux,%AppData%on Windows,~/Library/Stateon macOS)clispot/logs/ytstderr.log- YouTube downloader error logsclispot/logs/ffstderr.log- FFmpeg conversion error logs- Log location depends on the
-dflag:- If
-d <path>is specified: logs are saved in that directory - If not specified: logs are saved in
~/.local/state/clispot/logs(Linux),~/Library/State/clispot/logs(macOS), or%AppData%\clispot\logs(Windows).
- If
These logs can be useful for troubleshooting playback issues and reporting bugs.