A CLI tool to bulk-delete Spotify playlists matching a substring pattern.
  • Rust 46.7%
  • Nix 38.3%
  • Just 15%
Find a file
2025-12-22 20:54:11 -05:00
.config chore: initial commit 2025-12-22 20:54:11 -05:00
LICENSES chore: initial commit 2025-12-22 20:54:11 -05:00
src chore: initial commit 2025-12-22 20:54:11 -05:00
.copier-answers.yml chore: initial commit 2025-12-22 20:54:11 -05:00
.editorconfig chore: initial commit 2025-12-22 20:54:11 -05:00
.envrc chore: initial commit 2025-12-22 20:54:11 -05:00
.gitignore chore: initial commit 2025-12-22 20:54:11 -05:00
.ignore chore: initial commit 2025-12-22 20:54:11 -05:00
biome.json chore: initial commit 2025-12-22 20:54:11 -05:00
Cargo.lock chore: initial commit 2025-12-22 20:54:11 -05:00
Cargo.lock.license chore: initial commit 2025-12-22 20:54:11 -05:00
Cargo.toml chore: initial commit 2025-12-22 20:54:11 -05:00
CLAUDE.md chore: initial commit 2025-12-22 20:54:11 -05:00
cog.toml chore: initial commit 2025-12-22 20:54:11 -05:00
flake.lock chore: initial commit 2025-12-22 20:54:11 -05:00
flake.lock.license chore: initial commit 2025-12-22 20:54:11 -05:00
flake.nix chore: initial commit 2025-12-22 20:54:11 -05:00
Justfile chore: initial commit 2025-12-22 20:54:11 -05:00
README.md chore: initial commit 2025-12-22 20:54:11 -05:00
REUSE.toml chore: initial commit 2025-12-22 20:54:11 -05:00
treefmt.toml chore: initial commit 2025-12-22 20:54:11 -05:00

spotify-playlist-bulk-delete

A CLI tool to bulk-delete Spotify playlists matching a substring or regex pattern.

Usage

spotify-playlist-bulk-delete --pattern <PATTERN> [OPTIONS]

Options

  • -p, --pattern <PATTERN>: Pattern to match against playlist names (required)
  • --regex: Treat pattern as a regular expression
  • --dry-run: Show what would be deleted without deleting
  • --no-confirm: Skip the confirmation prompt
  • --client-id <ID>: Spotify client ID (or set SPOTIFY_CLIENT_ID)
  • --client-secret <SECRET>: Spotify client secret (or set SPOTIFY_CLIENT_SECRET)

Examples

Delete all playlists containing "Copy of":

spotify-playlist-bulk-delete --pattern "Copy of"

Preview playlists matching a regex without deleting:

spotify-playlist-bulk-delete --pattern "^Daily Mix \d+" --regex --dry-run

Setup

1. Create a Spotify App

  1. Go to the Spotify Developer Dashboard
  2. Create a new app
  3. Add http://127.0.0.1:8888/callback as a redirect URI
  4. Note your Client ID and Client Secret

2. Set Environment Variables

export SPOTIFY_CLIENT_ID="your_client_id"
export SPOTIFY_CLIENT_SECRET="your_client_secret"

3. Build and Run

cargo build --release
./target/release/spotify-playlist-bulk-delete --pattern "some pattern"

How It Works

  1. Starts a local server on 127.0.0.1:8888 to handle OAuth callback
  2. Opens your browser to authorize with Spotify
  3. Fetches all playlists owned by you
  4. Filters by pattern match (substring or regex)
  5. Shows matching playlists and prompts for confirmation
  6. Deletes confirmed playlists via the Spotify API

License

GPL-3.0-or-later