Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
szktkfm committed Jan 14, 2024
1 parent e51670d commit 6a363c9
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ all: build
build:
go build -o test ./cmd/spotui

install:
go install ./cmd/spotui

.PHONY: test
test:
go test ./...
Expand Down
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,42 @@
# spotui
[![Go Report Card](https://goreportcard.com/badge/github.com/szktkfm/spotui)](https://goreportcard.com/report/github.com/szktkfm/spotui)

<img src="assets/demo.gif" width="500">

## Overview
spotui is a terminal-based client for Spotify, written in Go and leveraging the [charmbracelet/bubbletea](https://github.com/charmbracelet/bubbletea) library.
spotui is a Spotify TUI player, written in Go and leveraging the [charmbracelet/bubbletea](https://github.com/charmbracelet/bubbletea) library.

## Installation
Visit the [GitHub Releases](https://github.com/szktkfm/spotui/releases) page for spotui and download the appropriate binary for your operating system.

Or, just install it with `go`:
```bash
go install github.com/szktkfm/spotui@latest
```

## Usage
### Connecting to Spotify’s API
To use spotui, you need to connect it to Spotify's API. Follow these steps:

### Key Bindings
1. [Go to the Spotify Dashboard](https://developer.spotify.com/dashboard).
2. Create a new app to obtain your Client ID and Client Secret.
3. In 'Edit Settings', add http://localhost:21112/callback to the 'Redirect URIs'. Don’t forget to save your changes.
4. Set your Client ID as an environment variable `SPOTIFY_ID`.
5. Run spotui. You will see an official Spotify URL for authentication.

```bash
# Replace your_client_id with the actual Client ID you obtained from Spotify.
SPOTIFY_ID=your_client_id spotui
```
6. Open the provided URL in a web browser and log in to your Spotify account to grant the necessary permissions.
After granting permission, you might be redirected to a blank page. This is normal and indicates that the authentication process is complete.

Once authenticated, you are ready to use spotui!

### API Token Storage
Once authenticated, your Spotify API token will be stored at `${HOME}/.config/spotui/spotify_token.json`. Ensure this file is kept secure as it contains sensitive information.

### Key Bindings
Here are the key bindings for spotui:

| Key | Action |
Expand Down
Binary file added assets/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions assets/spotui.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Set Width 800
Set Height 900

Set PlaybackSpeed 1.5
Set TypingSpeed 200ms

Set Shell zsh
Sleep 1.5s
Type "spotui"
Enter
Sleep 1.5s
Type "ljjjjjjjjjjjjjjjjjjjjjjjjhjjjjjjk"
Enter
Type "jjjjjjjjjkk"
Sleep 500ms
Enter
Sleep 7.0s
Type ":next"
Enter
Sleep 15.0s
Type "q"
Sleep 1s

0 comments on commit 6a363c9

Please sign in to comment.