← Catalog

pi-spotify-widget

Lightweight Spotify Now Playing widget for Pi Coding Agent.

Package

Install

Install with PiG

pig install npm:pi-spotify-widget

Install with Pi

pi install npm:pi-spotify-widget
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "skills": [
    "./skills/spotify-playback"
  ],
  "extensions": [
    "./extensions"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.20 (README.md). PiG does not review it.

pi-spotify-widget

Join dotfield.xyz on Discord

CI Publish npm version npm downloads License: MIT Pi package Trusted Publishing Buy Me A Coffee

Show Spotify playback status in Pi's prompt editor widget.

What this is

TypeScript-first Pi package that displays Now Playing (track, artist, playing/paused) in the prompt editor widget. Auth uses OAuth 2.0 + PKCE against Spotify Web API — not a static API key.

Features

  • Now Playing widget — track, artist, playback state, compact progress seek bar
  • OAuth login — /spotify:login opens Dashboard + browser, stores tokens locally
  • Secret-safe status — /spotify:status without exposing token values
  • Playback controls — /spotify:prev, /spotify:next, /spotify:pause, /spotify:play
  • Share to X — /spotify:share opens compose with Now Playing text (soccer-widget style)
  • Manual refresh — /spotify:refresh
  • Token refresh — access token lifecycle before API calls

Install

Install the published npm package with Pi:

pi install npm:pi-spotify-widget

Pin a specific version when you want reproducible installs:

pi install npm:pi-spotify-widget@0.1.20

Install into the current project instead of your user Pi settings:

pi install npm:pi-spotify-widget -l

Or install from GitHub:

pi install git:github.com/eiei114/pi-spotify-widget

Try it without permanently installing:

pi -e npm:pi-spotify-widget

Spotify Developer setup (required)

Each user creates their own Spotify app (v1 BYO Client ID policy). Client Secret is not needed for PKCE.

  1. Install the package (see Install) and start Pi.
  2. Run /spotify:login — the Spotify Developer Dashboard opens automatically.
  3. Create an app and add redirect URI: http://127.0.0.1:8888/callback
  4. Paste your Client ID into the Pi prompt when asked.
  5. Complete browser OAuth authorization.

The Client ID is saved locally at ~/.pi/agent/pi-spotify-widget-config.json (not sent to the model). OAuth tokens are stored separately at ~/.pi/agent/pi-spotify-widget-auth.json.

Option B — Environment variable

Set PI_SPOTIFY_CLIENT_ID before starting Pi to skip the Client ID prompt:

# PowerShell
$env:PI_SPOTIFY_CLIENT_ID="your_client_id_here"
# bash
export PI_SPOTIFY_CLIENT_ID="your_client_id_here"

Bundled Client ID and Extended Quota are planned for a future release. v1 does not ship a shared maintainer app.

Quick start

pi install npm:pi-spotify-widget

Try locally from a git checkout:

pi -e .

Then run:

/spotify:login
/spotify:status
/spotify:refresh

Commands

CommandDescription
/spotify:loginOpen Dashboard, enter Client ID (if needed), OAuth PKCE login
/spotify:statusSecret-safe auth status (no token values)
/spotify:logoutRemove stored tokens
/spotify:refreshForce Now Playing snapshot fetch
/spotify:prevSkip to previous track
/spotify:nextSkip to next track
/spotify:pausePause playback
/spotify:playResume playback
/spotify:helpPlayback command list for AI/user
/spotify:shareOpen X compose with Now Playing (optional prefix text)
/spotify:play-uriPlay a Spotify track URL or URI

Package contents

PathPurpose
extensions/Pi TypeScript extension entrypoints (index.ts)
lib/Spotify auth, API client, widget render
skills/spotify-playback Agent Skill
docs/Release and examples

Development

npm install
npm run ci
npm run pack:check   # equivalent to: npm pack --dry-run

npm run ci runs typecheck, tests, and the pack check. Run npm pack --dry-run directly when you only want to verify tarball contents.

Release

Before tagging, confirm npm run ci and npm pack --dry-run pass locally.

This package is set up for npm Trusted Publishing, so no NPM_TOKEN is required.

npm version patch --no-git-tag-version
git push

Merging or pushing a version bump runs CI only; it does not release or publish. After separate release authorization, manually dispatch .github/workflows/auto-release.yml on main to create the tag and GitHub Release, then hand off to .github/workflows/publish.yml.

See docs/release.md for setup details.

Docs

Security

Pi packages can execute code with your local permissions. This package:

  • sends network requests to Spotify Web API
  • stores OAuth tokens under ~/.pi/agent/ (local only)
  • opens your system browser for login

Review extensions before installing third-party packages. For vulnerability reporting, see SECURITY.md.

License

MIT