npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pi-spotify-widget

v0.1.7

Published

Lightweight Spotify Now Playing widget for Pi Coding Agent.

Readme

pi-spotify-widget

CI Publish npm version npm downloads License: MIT Pi package Trusted Publishing

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:[email protected]

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.

Option A — Interactive setup (recommended)

  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

| Command | Description | |---|---| | /spotify:login | Open Dashboard, enter Client ID (if needed), OAuth PKCE login | | /spotify:status | Secret-safe auth status (no token values) | | /spotify:logout | Remove stored tokens | | /spotify:refresh | Force Now Playing snapshot fetch | | /spotify:prev | Skip to previous track | | /spotify:next | Skip to next track | | /spotify:pause | Pause playback | | /spotify:play | Resume playback | | /spotify:help | Playback command list for AI/user | | /spotify:share | Open X compose with Now Playing (optional prefix text) | | /spotify:play-uri | Play a Spotify track URL or URI |

Package contents

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

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
git push

On main, .github/workflows/auto-release.yml checks package.json version. If v<version> does not exist yet, it creates the tag, creates the GitHub Release, then explicitly dispatches .github/workflows/publish.yml for that tag.

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.

Links

  • npm: https://www.npmjs.com/package/pi-spotify-widget
  • GitHub: https://github.com/eiei114/pi-spotify-widget
  • Issues: https://github.com/eiei114/pi-spotify-widget/issues

License

MIT