A CLI tool to bulk-delete Spotify playlists matching a substring pattern.
- Rust 46.7%
- Nix 38.3%
- Just 15%
| .config | ||
| LICENSES | ||
| src | ||
| .copier-answers.yml | ||
| .editorconfig | ||
| .envrc | ||
| .gitignore | ||
| .ignore | ||
| biome.json | ||
| Cargo.lock | ||
| Cargo.lock.license | ||
| Cargo.toml | ||
| CLAUDE.md | ||
| cog.toml | ||
| flake.lock | ||
| flake.lock.license | ||
| flake.nix | ||
| Justfile | ||
| README.md | ||
| REUSE.toml | ||
| treefmt.toml | ||
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 setSPOTIFY_CLIENT_ID)--client-secret <SECRET>: Spotify client secret (or setSPOTIFY_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
- Go to the Spotify Developer Dashboard
- Create a new app
- Add
http://127.0.0.1:8888/callbackas a redirect URI - 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
- Starts a local server on
127.0.0.1:8888to handle OAuth callback - Opens your browser to authorize with Spotify
- Fetches all playlists owned by you
- Filters by pattern match (substring or regex)
- Shows matching playlists and prompts for confirmation
- Deletes confirmed playlists via the Spotify API
License
GPL-3.0-or-later