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

@shuyangli/spotify-cli

v0.0.1

Published

CLI for building Spotify playlists and controlling Spotify Connect playback. Designed to be driven by an LLM agent.

Readme

spotify-cli

A small CLI for building Spotify playlists and controlling Spotify Connect playback. Designed to be driven by a Hermes agent, but works fine standalone.

Every command emits a single JSON object/array on stdout. Errors land on stderr in a {"error": {...}} envelope with a non-zero exit code.

Install

npm install -g spotify-cli

Or from source:

git clone <this-repo>
cd spotify-cli && npm install && npm run build && npm link

Requires Node ≥ 20.

Authenticate

  1. Register an app at https://developer.spotify.com/dashboard.
  2. In the app settings, add http://127.0.0.1/callback as a redirect URI. (The CLI uses an ephemeral loopback port — Spotify accepts any port for 127.0.0.1 redirects, but the URI must be registered.)
  3. Export your client ID and run auth login:
export SPOTIFY_CLIENT_ID=xxxxxxxxxxxxxxxxxxxxxxxx
spotify-cli auth login

The token is cached at ~/.config/spotify-cli/token.json (mode 0600) and auto-refreshed before expiry.

Examples

# Search and build
spotify-cli search "miles davis" --type artist
spotify-cli playlist create --name "Tonight"
spotify-cli playlist add 7vxxx... spotify:track:aaa spotify:track:bbb

# Connect playback
spotify-cli devices list
spotify-cli playback transfer <deviceId> --play
spotify-cli playback play --context-uri spotify:playlist:7vxxx...
spotify-cli playback volume 30

See spotify-cli --help for the full surface.

Rate limiting

Spotify enforces a per-app rolling 30-second quota. The CLI:

  • Serializes outbound requests within a process and inserts a minimum inter-request gap (default 250 ms; override with SPOTIFY_CLI_MIN_INTERVAL_MS).
  • Honors Retry-After on 429 responses with jittered retries.
  • Backs off exponentially on 5xx (max 3 attempts).
  • Refreshes the access token automatically on 401 (once per request).

If you're driving this from an agent, never issue spotify-cli calls in parallel — the CLI's pacer only protects against intra-process bursts; the quota is shared across all processes using the same app.

Hermes skill

The skill/ directory packages this CLI as a Hermes agent skill. See skill/SKILL.md. Publish with:

hermes skills publish skill --to github --repo <owner>/<repo>

Development

npm install
npm test          # 57 unit/integration tests, no network
npm run build
npx tsx src/index.ts --help

License

MIT