other
Spotify CLI for Headless Automation
Use the Spotify CLI for headless automation with headless JSON commands, schema discovery, credentials, and permission controls.
8 functions 7 read 1 write Manual OAuth token auth
Spotify CLI for Headless Automation
Use KosmoKrator as a non-interactive integration runtime for local automations and wrappers.
Use headless automation when another tool needs a stable local command surface. The Spotify CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Spotify CLI for Headless Automation
kosmokrator integrations:configure spotify --set access_token="$SPOTIFY_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmo integrations:call spotify.spotify_search '{"q":"example_q","type":"example_type","limit":1,"offset":1}' --json Discovery Before Execution
Agents and scripts can inspect Spotify docs and schemas before choosing a function.
kosmo integrations:docs spotify --json
kosmo integrations:docs spotify.spotify_search --json
kosmo integrations:schema spotify.spotify_search --json
kosmo integrations:search "Spotify" --json
kosmo integrations:list --json Useful Spotify CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
spotify.spotify_search | Read | q, type, limit, offset | Search for tracks, artists, albums, or playlists on Spotify. Returns matching items with basic metadata. Use specific get tools for detailed information about a single item. |
spotify.spotify_get_track | Read | id | Get detailed information about a specific Spotify track, including artists, album, duration, and popularity. |
spotify.spotify_get_artist | Read | id | Get detailed information about a specific Spotify artist, including followers, genres, and popularity. |
spotify.spotify_list_playlists | Read | limit, offset | List the current user's Spotify playlists. Returns playlist names, IDs, and track counts. |
spotify.spotify_get_playlist | Read | id, limit, offset | Get detailed information about a Spotify playlist, including its tracks with artist and album details. |
spotify.spotify_create_playlist | Write | user_id, name, description, public | Create a new Spotify playlist for the current user. Use the "Get Current User" tool first if you need the user ID. |
spotify.spotify_list_albums | Read | id, include_groups, limit, offset | List albums by a specific Spotify artist. Includes singles and compilations by default. |
spotify.spotify_get_current_user | Read | none | Get the authenticated user's Spotify profile, including their user ID (needed for creating playlists), display name, and follower count. |
Automation Notes
- Use
--jsonfor machine-readable output. - Keep credentials out of argv by using environment variables or stored KosmoKrator configuration.
- Configure read/write policy before unattended runs; use
--forceonly for trusted automation. - Use the MCP gateway instead when the agent needs dynamic tool discovery inside a conversation.