Skip to content

japiirainen/sp

Repository files navigation

sp

Table of contents

A spotify CLI

Installation

You can install sp via the following mechanisms.

nix

sp is a nix flake, so you can run it directly from this github repo without installing at all!

nix run github:japiirainen/sp -- --help

cabal

cabal install

Usage of sp

Authorization

  1. Got to Spotify dashboard and register an app

  2. In options, set Redirect URIs to "http://localhost:7777/callback"

  3. Install sp via nix or cabal.

  4. Run sp authorize and follow instructions (paste in client-id and client-secret from spotify application when prompted)

  5. Done!

Basic commands

authorize

Run authoration flow.

sp authorize

play

Play current song.

sp play

pause

Pause current song.

sp pause

next

Skips to next track in queue.

sp next

prev

Skips to previous track in queue.

sp prev

replay

Replay current song from the beginning.

sp replay

seek

Seeks to the given position in the currently playing track.

sp seek 60

track

Search for tracks.

sp track 'Ehtaa tavaraa'

album

Search for albums.

sp album 'After Hours'

Development

You can develop sp with cabal.

cabal build all

cabal run sp

Nix support

You can alternatively use nix for dev environment and for building the project.

Build:

nix build .

Run:

nix run .

Start Nix shell:

nix-shell

Tips

  • Run nix flake update to update all flake inputs.
  • Run just fmt to run formatters.
  • Run just docs to start local hoogle server.
  • Run the application without installing: nix run github:japiirainen/sp (or nix run . from checkout)

About

A command-line client for spotify.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published