This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Spotishell is a PowerShell module for interacting with the Spotify Web API. It supports PowerShell 5.0+ and runs on Windows, macOS, and Linux. The module handles OAuth authentication, token refresh, and provides cmdlets for all Spotify API endpoints including playback control.
# Import module for local development
Import-Module ./Spotishell/Spotishell.psd1 -Force
# List available commands
Get-Command -Module Spotishell
# Get help for a specific cmdlet
Get-Help <CmdletName> -FullSpotishell/Spotishell.psm1- Entry point that dot-sources all Public and Private functions and exports Public onesSpotishell/Spotishell.psd1- Module manifest with version and metadataSpotishell/Public/- Exported cmdlets organized by API category (Albums, Artists, Player, Playlists, etc.)Spotishell/Private/- Internal helper functions not exported to users
Send-SpotifyCall.ps1- Central API caller that handles all HTTP requests to Spotify, including rate limit handling (429 responses with retry-after)Get-SpotifyAccessToken.ps1- Implements OAuth Authorization Code Flow with PKCE, handles token refresh, spawns local HTTP listener for OAuth callbackGet-StorePath.ps1- Returns OS-appropriate credential storage path (~/.spotishell/on Unix,%LOCALAPPDATA%\spotishell\on Windows). It can be overridden viaSPOTISHELL_STORE_PATHenv var
- User creates app with
New-SpotifyApplication -ClientId <id> -ClientSecret <secret> - Credentials stored as JSON in the store path
- First API call triggers OAuth browser flow, tokens saved automatically
- Token refresh handled transparently by
Get-SpotifyAccessToken
- All cmdlets accept
-ApplicationNameto support multiple Spotify apps - Most cmdlets support pipeline input for batch operations
- Functions follow PowerShell verb-noun naming (Get-, Set-, Add-, Remove-, Test-, Invoke-)
Default redirect URI: http://127.0.0.1:8080/spotishell (must be added to Spotify app settings)