Pp spotify

From mvanhorn/printing-press-library · View interactive version

Pp spotify is an AI agent skill from the GitHub repository mvanhorn/printing-press-library. Printing Press CLI for Spotify. You can use Spotify's Web API to discover music and podcasts, manage your Spotify library, control audio playback

How to use this skill

Skill file

<!-- GENERATED FILE — DO NOT EDIT.

This file is a verbatim mirror of library/media-and-entertainment/spotify/SKILL.md,

regenerated post-merge by tools/generate-skills/. Hand-edits here are

silently overwritten on the next regen. Edit the library/ source instead.

See the repository agent guide, section "Generated artifacts: registry.json, cli-skills/". -->

Spotify — Printing Press CLI

Prerequisites: Install the CLI

This skill drives the spotify-pp-cli binary. You must verify the CLI is installed before invoking any command from this skill. If it is missing, install it first:

  1. Install via the Printing Press installer. It defaults binaries to $HOME/.local/bin on macOS/Linux and %LOCALAPPDATA%\Programs\PrintingPress\bin on Windows:

```bash

npx -y @mvanhorn/printing-press-library install spotify --cli-only

```

  1. Verify: spotify-pp-cli --version
  2. Ensure the reported install directory is on $PATH for the agent/runtime that will invoke this skill.

If the npx install fails (no Node, offline, etc.), fall back to a direct Go install (requires Go 1.26.6 or newer):

go install github.com/mvanhorn/printing-press-library/library/media-and-entertainment/spotify/cmd/spotify-pp-cli@latest

If --version reports "command not found" after install, the runtime cannot see the binary directory on $PATH. Do not proceed with skill commands until verification succeeds.

You can use Spotify's Web API to discover music and podcasts, manage your Spotify library, control audio playback, and much more. Browse our available Web API endpoints using the sidebar at left, or via the navigation bar on top of this page on smaller screens.

In order to make successful Web API requests your app will need a valid access token. One can be obtained through <a href="https://developer.spotify.com/documentation/general/guides/authorization-guide/">OAuth 2.0</a>.

The base URI for all Web API requests is https://api.spotify.com/v1.

Need help? See our <a href="https://developer.spotify.com/documentation/web-api/guides/">Web API guides</a> for more information, or visit the <a href="https://community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer">Spotify for Developers community forum</a> to ask questions and connect with other developers.

Command Reference

albums — Manage albums

artists — Manage artists

audio-analysis — Manage audio analysis

audio-features — Manage audio features

audiobooks — Manage audiobooks

browse — Manage browse

chapters — Manage chapters

episodes — Manage episodes

markets — Manage markets

me — Manage me

playlists — Manage playlists

recommendations — Manage recommendations

shows — Manage shows

spotify_web_search — Manage spotify web search

tracks — Manage tracks

users — Manage users

Turning a tracklist into a playlist

/search answers with a ranked page, and its ranking is relevance, not title exactness — a live cut, a remaster, or a cover routinely outranks the studio recording you asked for. tracks resolve owns that re-ranking (exact title beats normalized-exact beats prefix; the requested artist always beats another artist) and emits one URI per input line, so a setlist becomes a playlist in three commands instead of one search per song plus hand-written jq:

# 1. Resolve the tracklist to URIs (one title per line on stdin).
pbpaste | spotify-pp-cli tracks resolve --artist Northlane --agent > resolved.json

# 2. Check what didn't resolve before creating anything.
jq -r '.results.results[] | select(.uri == null) | .query_title' resolved.json

# 3. Create the playlist and add the URIs.
PLAYLIST=$(spotify-pp-cli me create-playlist --name "Northlane / Milan" --agent \
  --select id | jq -r '.results.id')
spotify-pp-cli playlists items add-to-playlist "$PLAYLIST" --agent \
  --uris "$(jq -c '[.results.results[].uri | select(. != null)]' resolved.json)"

match_kind on each row says how the match was made (exact, normalized, prefix, substring, or *_other_artist when only a different artist's recording matched), so an agent can decide which rows need a human look. Add --fail-on-miss to exit 2 when any title fails to resolve.

Reading playlist contents: `.item`, not `.track`

playlists items get-playlists calls Spotify's /playlists/{id}/items endpoint, whose rows carry the track under item. Spotify's own documentation and most examples describe the older /playlists/{id}/tracks endpoint, whose rows use track — so a jq '.results.items[].track' copied from the docs silently returns null here. Use .item:

spotify-pp-cli playlists items get-playlists <playlist_id> --agent \
  | jq -r '.results.items[].item.name'

The playlists tracks ... subtree targets the legacy /tracks endpoint, which Spotify now answers with HTTP 403 for current app credentials. Prefer the playlists items ... subtree.

Finding the right command

When you know what you want to do but not which command does it, ask the CLI directly:

spotify-pp-cli which "<capability in your own words>"

which resolves a natural-language capability query to the best matching command from this CLI's curated feature index. Exit code 0 means at least one match; exit code 2 means no confident match — fall back to --help or use a narrower query.

Auth Setup

Run spotify-pp-cli auth setup for the URL and steps to obtain a token (add --launch to open the URL). Then store it:

spotify-pp-cli auth set-token YOUR_TOKEN_HERE

Or set SPOTIFY_OAUTH_2_0 as an environment variable.

Run spotify-pp-cli doctor to verify setup.

Agent Mode

Add --agent to any command. Expands to: --json --compact --no-input --no-color --yes.

```bash

spotify-pp-cli audio-analysis mock-value --agent --select id,name,status

```

A --select that matches nothing is an error, not an empty result: the CLI exits 2 and returns a diagnostic naming the fields that were available, instead of falling back to the full payload. Paths are relative to the data, not to the {meta, results} envelope — write --select tracks.items.name, not --select results.tracks.items.name:

```bash

spotify-pp-cli spotify-web-search --q "track:4D artist:Northlane" --type track \

--json --select results.tracks.items.name

# exit 2

# {"results":{"error":"--select matched no fields","select":"results.tracks.items.name",

# "available_fields":["tracks","tracks.href","tracks.items", ...]}}

```

Response envelope

Commands that read from the local store or the API wrap output in a provenance envelope:

{
  "meta": {"source": "live" | "local", "synced_at": "...", "reason": "..."},
  "results": <data>
}

Parse .results for data and .meta.source to know whether it's live or local. A human-readable N results (live) summary is printed to stderr only when stdout is a terminal AND no machine-format flag (--json, --csv, --compact, --quiet, --plain, --select) is set — piped/agent consumers and explicit-format runs get pure JSON on stdout.

Envelope guarantees:

Live search

search <query> hits Spotify's live /search endpoint, which requires a type parameter — the CLI resolves the requested types (all catalog types by default, or the one named with --type), sends them explicitly, and aggregates every populated per-type response. Types Spotify serves no live endpoint for (e.g. me, chapters) are local-only: asking for them with --data-source live fails fast with exit 2 and names the working alternatives (local or auto).

Paths and state

Agents should treat the CLI's path resolver as part of the runtime contract:

```json

{

"mcpServers": {

"spotify": {

"command": "spotify-pp-mcp",

"env": {

"SPOTIFY_HOME": "/srv/spotify"

}

}

}

}

```

Fleet precedence: an inherited per-kind env var overrides an explicit --home for that kind. Use SPOTIFY_HOME or per-kind vars as durable fleet levers, and use --home only for a single invocation. Relocation is not reversible by unsetting env vars; move files manually before clearing SPOTIFY_HOME, or doctor will not find credentials left under the former root.

Agent Feedback

When you (or the agent) notice something off about this CLI, record it:

spotify-pp-cli feedback "the --since flag is inclusive but docs say exclusive"
spotify-pp-cli feedback --stdin < notes.txt
spotify-pp-cli feedback list --json --limit 10

Entries are stored locally as feedback.jsonl under the resolved data dir. They are never POSTed unless SPOTIFY_FEEDBACK_ENDPOINT is set AND either --send is passed or SPOTIFY_FEEDBACK_AUTO_SEND=true. Default behavior is local-only.

Write what surprised you, not a bug report. Short, specific, one line: that is the part that compounds.

Output Delivery

Every command accepts --deliver <sink>. The output goes to the named sink in addition to (or instead of) stdout, so agents can route command results without hand-piping. Three sinks are supported:

| Sink | Effect |

|------|--------|

| stdout | Default; write to stdout only |

| file:<path> | Atomically write output to <path> (tmp + rename) |

| webhook:<url> | POST the output body to the URL (application/json or application/x-ndjson when --compact) |

Unknown schemes are refused with a structured error naming the supported set. Webhook failures return non-zero and log the URL + HTTP status on stderr.

Named Profiles

A profile is a saved set of flag values, reused across invocations. Use it when a scheduled or recurring agent reuses the same saved flags while providing different input each run.

spotify-pp-cli profile save briefing --json
spotify-pp-cli --profile briefing audio-analysis mock-value
spotify-pp-cli profile list --json
spotify-pp-cli profile show briefing
spotify-pp-cli profile delete briefing --yes

Explicit flags always win over profile values; profile values win over defaults. agent-context lists all available profiles under available_profiles so introspecting agents discover them at runtime.

Exit Codes

| Code | Meaning |

|------|---------|

| 0 | Success |

| 2 | Usage error (wrong arguments) |

| 3 | Resource not found |

| 4 | Authentication required |

| 5 | API error (upstream issue) |

| 7 | Rate limited (wait and retry) |

| 10 | Config error |

Argument Parsing

Parse $ARGUMENTS:

  1. Empty, help, or --help → show spotify-pp-cli --help output
  2. Starts with install → ends with mcp → MCP installation; otherwise → see Prerequisites above
  3. Anything else → Direct Use (execute as CLI command with --agent)

MCP Server Installation

Install the MCP binary from this CLI's published public-library entry or pre-built release, then register it:

claude mcp add spotify-pp-mcp -- spotify-pp-mcp

Verify: claude mcp list

Direct Use

  1. Check if installed: which spotify-pp-cli

If not found, offer to install (see Prerequisites at the top of this skill).

  1. Match the user query to the best command from the Unique Capabilities and Command Reference above.
  2. Execute with the --agent flag:

```bash

spotify-pp-cli <command> [subcommand] [args] --agent

```

  1. If ambiguous, drill into subcommand help: spotify-pp-cli <command> --help.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.