Create and update Spotify discography playlists.
- Spotify Discography CLI
- Installation
- First-time setup
- Usage
- Track history
- Automation
- Commands
- Data storage
- Bug reporting
- License
npm install -g spotify-discography-cli
or
yarn global add spotify-discography-cli
You can download standalone tarballs from Releases section. These include the node binary so you don't have to have Node / NPM / Yarn installed.
In order to use this app, you have to provide a Spotify app's client ID and secret. To obtain these, you have to create a new app within Spotify dashboard:
- Log in to Spotify Dashboard with your account.
- Click on Create an app and provide title and description of your choice (e.g. Spotify Discography CLI)
- Check both checkboxes and click on Create
- On the app page, click on Edit Settings
- Add
http://localhost:10101
to your Redirect URIs field and click "Save" - You should see your app's client ID and secret in top left
Once you have client ID and secret, run
spotify-discography init
You will be asked for client ID and secret followed by authorization with Spotify. Once authorized, you should see a success message.
That's it! You can now start using the app.
To create a new discography playlist for specific artist, you have to get that artist's ID first. There are many ways to get an artist's ID. The easiest one is to go to an artist's page in the web player and check the url - the ID is highlighted in bold: ​https//open.spotify.com/artist/5oDtp2FC8VqBjTx1aT4P5j
Once you have artist ID, run
spotify-discography create ARTIST_ID
for example
spotify-discography create 5oDtp2FC8VqBjTx1aT4P5j
This will create a new discography private playlist and display hyperlink in supported terminals.
It is possible to update an existing playlist with new releases. In this case, you have to provide both artist and playlist IDs. The process of getting a playlist's ID is the same as it is for an artist - open a playlist in web player and check the url.
Once you have both artist and playlist IDs, run
spotify-discography update ARTIST_ID PLAYLIST_ID
for example
spotify-discography update 5oDtp2FC8VqBjTx1aT4P5j 6pyiISrb7yoHw7YDhV7xH8
Each time you create or update a playlist, the information about tracks added is saved on disk. On each update, this data is loaded and checked against. In other words, if you delete a track from a playlist, it won't be added again on next update.
You can override this behaviour using --force
flag when updating a playlist. This will ignore track history and force add all missing tracks.
To automate playlist updates, the easiest way is to set up a cron job. The following example updates the playlist with new releases once a day:
0 0 * * * /Users/jakubito/Documents/spotify-discography/bin/spotify-discography update 2CIMQHirSU0MQqyYHq0eOx 3igxuZDwGlXocuh9b2T14D
spotify-discography config [CONFIG_KEY] [CONFIG_VALUE]
spotify-discography create ARTIST_ID
spotify-discography help [COMMAND]
spotify-discography init
spotify-discography reset
spotify-discography update ARTIST_ID PLAYLIST_ID
display / update config
USAGE
$ spotify-discography config [CONFIG_KEY] [CONFIG_VALUE]
ARGUMENTS
CONFIG_KEY [optional] config key - one of "authServerPort", "userId", "clientId", "clientSecret", "accessToken",
"refreshToken", "tokenExpiration"
CONFIG_VALUE [optional] config value to save
OPTIONS
-h, --help show CLI help
EXAMPLES
$ spotify-discography config clientId 9d08c83130e2933e6a440541371fb458
$ spotify-discography config clientId
9d08c83130e2933e6a440541371fb458
$ spotify-discography config
authServerPort: 10101
clientId: 9d08c83130e2933e6a440541371fb458
See code: src/commands/config.ts
create new discography playlist
USAGE
$ spotify-discography create ARTIST_ID
ARGUMENTS
ARTIST_ID [required] Spotify artist ID
OPTIONS
-h, --help show CLI help
EXAMPLE
$ spotify-discography create 5oDtp2FC8VqBjTx1aT4P5j
Creating new playlist... done
SHY FX Discography
See code: src/commands/create.ts
display help for spotify-discography
USAGE
$ spotify-discography help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
initialize config and authorize with Spotify
USAGE
$ spotify-discography init
OPTIONS
-h, --help show CLI help
See code: src/commands/init.ts
reset config to default values
USAGE
$ spotify-discography reset
OPTIONS
-h, --help show CLI help
See code: src/commands/reset.ts
update existing discography playlist
USAGE
$ spotify-discography update ARTIST_ID PLAYLIST_ID
ARGUMENTS
ARTIST_ID [required] Spotify artist ID
PLAYLIST_ID [required] Spotify playlist ID
OPTIONS
-f, --force ignore history and force add all missing tracks
-h, --help show CLI help
EXAMPLE
$ spotify-discography update 5oDtp2FC8VqBjTx1aT4P5j 6pyiISrb7yoHw7YDhV7xH8
Updating playlist... done
SHY FX Discography
See code: src/commands/update.ts
All application data is stored locally on your computer:
- Unix:
~/.config/spotify-discography-cli
- Windows:
%LOCALAPPDATA%\spotify-discography-cli
If you find a bug, please send me an e-mail to dobes.jakub@gmail.com or open an issue here on github.
ISC