https://github.com/powercommands/spotifyprompt
Control spotify from your CommandPrompt
https://github.com/powercommands/spotifyprompt
Last synced: 9 days ago
JSON representation
Control spotify from your CommandPrompt
- Host: GitHub
- URL: https://github.com/powercommands/spotifyprompt
- Owner: PowerCommands
- License: gpl-3.0
- Created: 2025-04-18T12:50:16.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2025-04-26T09:03:32.000Z (29 days ago)
- Last Synced: 2025-04-26T10:19:12.202Z (29 days ago)
- Language: C#
- Size: 331 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SpotifyPromptClient
An advanced CLI client for Spotify, built on top of the PainKiller CommandPrompt framework.
Provides full terminal control over Spotify including AI-assisted artist enrichment, playlist building, tagging, backup, search, and much more.Ask ChatGPT: https://chatgpt.com/g/g-680fb8d660748191a59e8aad386c727c-playlist-prompt-client
---
## Prerequisites
- **.NET 9.0 SDK** installed.
- A **Spotify Developer** account with a registered application:
[Register here](https://developer.spotify.com/dashboard/)
You will need:
- **Client ID**
- **Redirect URI** (e.g., `http://localhost:5000/callback/`)- Store your **Client ID** securely using the built-in Security module:
```bash
secret --create "spotify_prompt"
```
- Ollama ServiceThe Spotify Prompt Client uses AI with Ollama and Gemma3 to get related artists, since Spotify removed the Get Artist's Related Artists in their WebAPI. You can download this software here: https://ollama.com/download it is a lightweight service running in the background.
You CAN USE this client without it, but some of it´s functionality regarding building playlists will not work.
---## Installation
1. **Clone** the repository:
```bash
git clone https://github.com/your-org/SpotifyPromptClient.git
cd SpotifyPromptClient
```2. **Configure** your application settings (`CommandPromptConfiguration.yaml`):
```yaml
spotify:
redirectUri: "http://localhost:5000/callback/"
refreshMarginInMinutes: 10
scopes:
- user-read-playback-state
- user-modify-playback-state
- playlist-read-private
- playlist-modify-public
- playlist-modify-private
```3. **Build** the project:
```bash
dotnet build
```4. **Run** the CommandPrompt host:
```bash
dotnet run --project src/PainKiller.CommandPrompt.Host
```---
## Available Commands
| Command | Description |
|------------------|-------------------------------------------------------------------------------------|
| `login` | Authenticate with your Spotify account. |
| `play` | Play current track, a specific track by index, or all selected tracks. |
| `pause` | Pause the current playback. |
| `next` | Skip to the next track. |
| `previous` | Go back to the previous track. |
| `shuffle` | Toggle shuffle mode. |
| `device [name]` | List devices or switch playback to a specified device. |
| `volume [value]` | Set or display the current volume. |
| `mute` | Mute volume (sets volume to 0). |
| `unmute [--volume value]` | Unmute and optionally set volume. |
| `queue [index,selected]` | View or modify the playback queue. |
| `latest` | Show latest played tracks during session, optionally create playlist from history. |
| `list [--update,--compare]` | View, update, or compare playlists. |
| `selected [--clear]` | Show or clear selected tracks, albums, or artists. |
| `track [filter]` | Select and filter saved tracks. |
| `album [filter]` | Select and filter saved albums. |
| `artist [filter]`| Select and filter saved artists, with optional AI enrichment. |
| `user` | Display Spotify user profile information. |
| `tags` | Add or repair tags for artists, albums, playlists, or tracks. |
| `search [type] "query"` | Search for tracks, albums, artists, or playlists. |
| `backup` | Backup all stored Spotify data locally. |
| `build` | Build custom playlists using templates and AI. |
| `append` | Handle append select mode, practical to build content for your playlist. |
| `ai` | Use AI to find related artists based on existing data. |
| `warped` | View your top tracks or artists statistics ("Spotify Wrapped" style). |---
## Workflow Example
1. **Login** to Spotify:
```bash
login
```2. **Update and list your playlists**:
```bash
list --update
list
```3. **Control playback**:
```bash
play
next
pause
```4. **Example Search albums and then create a playlist with build command**:
```bash
search album --artist queen //(select some great queen albums in the list)
build new //(choose * as tag, Albums, Selected, No year range, 100 as max count, 20 as number of tracks)
```5. **Use AI enrichment**:
```bash
ai
artist --ai
```---
## Notes
- **Session selections**: You can accumulate selected tracks, albums, and artists across commands (search, album, artist) and operate on them, just turn on append if you want to accumulate your selection that could be use when building a playlist with `build` command.
- **AI Integration**: Integrates with a local or remote AI server (Ollama) for artist enrichment and tagging.
- **Backup**: Important Spotify data is persisted and can be backed up at any time.
- **Automatic Token Handling**: No manual refresh needed; tokens are refreshed automatically when needed.---
## Troubleshooting
- Ensure the **Redirect URI** registered in Spotify Dashboard matches your configuration exactly.
- If the access token expires and refresh fails, first try to start your player with `play` command or run `login` again.
- Update your Spotify application scopes if you encounter permission issues.---
**Enjoy controlling Spotify directly from your terminal!**
[Learn more about Spotify Web API](https://developer.spotify.com/documentation/web-api)