Skip to main content

spotify-cli-linux

Build Deploy Version

A command line interface to Spotify on Linux.

If you're using macOS, see spotify-cli-macos.

installation

pip install spotify-cli-linux

hint #1: if you encounter problems during installation, try to call command with sudo

hint #2: if you still have problems (e.g. with resolving project dependencies), try to call pip3 instead of pip

if you have any problems with pip or pip3, you can try to install the script in the alternative way as a workaround:

git clone git@github.com:pwittchen/spotify-cli-linux.git
cd spotify-cli-linux
sudo cp spotifycli/spotifycli.py /usr/local/bin/spotifycli

upgrade

pip install spotify-cli-linux --upgrade

for the upgrade, you can apply the same hints like for installation

usage

start the official Spotify desktop app

run the following command from your terminal:

spotifycli

use one of the following parameters:

-h, --help        show this help message and exit
--version         shows version number
--status          shows song name and artist
--statusshort     shows status in a short way
--statusposition  shows song name and artist, with current playback position
--song            shows the song name
--songshort       shows the song name in a short way
--artist          shows artists name
--artistshort     shows artist name in a short way
--album           shows album name
--arturl          shows album image url
--lyrics          shows lyrics for the song playing
--playbackstatus  shows playback status
--position        shows song position
--play            plays the song
--pause           pauses the song
--playpause       plays or pauses the song (toggles a state)
--next            plays the next song
--prev            plays the previous song
--clear           clear the terminal
--songuri OPENURI plays the track at the provided Uri
--listuri OPENURI plays the playlist at the provided Uri
--client CLIENT   sets client's dbus name

if you don't use any parameters, you'll enter the shell mode, where you'll be able to use all commands mentioned above

solving problems

lyriq

When, you're missing lyriq dependency, run the following command:

pip install lyriq

usage with tmux

If you want to use this script in your tmux panel, you can check tmux-plugin-spotify.

development

to install necessary tools for code formatting, static code analysis and releasing, run:

make requirements

code formatting

Source code should be formatted according to PEP8 style guides.

To format code, run:

make format

to verify code formatting, type:

make checkformat

static code analysis

To run static code analysis, execute:

make lint

docs

to update docs on gh-pages, type:

make docs

to run docs locally, type:

git checkout gh-pages && ./serve.sh

and view page with docs at: 0.0.0.0:8000

view it on-line at https://pwittchen.github.io/spotify-cli-linux

releasing

currently release is automated via deploy.yml GitHub Action, but it can be done manually too

configure your ~/.pypirc file as follows:

[distutils]
index-servers =
    pypi
[pypi]
username = __token__
password = VALID_TOKEN_GOES_HERE

then, update version in spotifycli/version.py and spotifycli/spotifycli.py and type:

make release

note: Version is not kept in a single file due to problems with importing files within another file and distributing them to PyPi. There are also Python vesion issues. If you know how to fix this issue properly to keep version in one place, I'd be happy to review your PR :-).

Metadata

Release files for spotify-cli-linux 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spotify-cli-linux 2.1.0
File Size Uploaded Provenance
spotify_cli_linux-2.1.0.tar.gz 18.8 kB Without provenance Details

Release files / spotify_cli_linux-2.1.0.tar.gz

Download URL spotify_cli_linux-2.1.0.tar.gz
Size 18.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7bf1d6c2873f54a35166957cd1f5ccb47d651132e313177523487cd1e8c9ad40
BLAKE2b-256 checksum
How to use checksums
0a034a00aa5470f4427dd923a7843ae520623a75cf33fbb9feac581bf49bdc1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.8

Security for spotify-cli-linux 2.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page