@bzenky/spoti 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -16
- package/dist/app.d.ts +4 -2
- package/dist/app.js +194 -93
- package/dist/app.js.map +1 -1
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/services/catalog.service.d.ts +2 -0
- package/dist/services/catalog.service.js +29 -4
- package/dist/services/catalog.service.js.map +1 -1
- package/dist/services/device.service.d.ts +3 -3
- package/dist/services/device.service.js +19 -11
- package/dist/services/device.service.js.map +1 -1
- package/dist/services/library.service.d.ts +2 -0
- package/dist/services/library.service.js +16 -2
- package/dist/services/library.service.js.map +1 -1
- package/dist/services/pagination.d.ts +20 -0
- package/dist/services/pagination.js +11 -0
- package/dist/services/pagination.js.map +1 -0
- package/dist/services/player.service.d.ts +5 -2
- package/dist/services/player.service.js +45 -12
- package/dist/services/player.service.js.map +1 -1
- package/dist/services/playlist.service.d.ts +4 -0
- package/dist/services/playlist.service.js +26 -14
- package/dist/services/playlist.service.js.map +1 -1
- package/dist/services/queue.service.js +11 -6
- package/dist/services/queue.service.js.map +1 -1
- package/dist/services/recent.service.d.ts +2 -0
- package/dist/services/recent.service.js +52 -2
- package/dist/services/recent.service.js.map +1 -1
- package/dist/services/search.service.d.ts +4 -4
- package/dist/services/search.service.js +10 -9
- package/dist/services/search.service.js.map +1 -1
- package/dist/spotify/client.d.ts +2 -0
- package/dist/spotify/client.js +175 -46
- package/dist/spotify/client.js.map +1 -1
- package/dist/spotify/types.d.ts +2 -0
- package/dist/ui/completions.js +27 -20
- package/dist/ui/completions.js.map +1 -1
- package/dist/ui/interactive-search.d.ts +4 -1
- package/dist/ui/interactive-search.js +218 -55
- package/dist/ui/interactive-search.js.map +1 -1
- package/dist/ui/output.d.ts +27 -11
- package/dist/ui/output.js +87 -45
- package/dist/ui/output.js.map +1 -1
- package/dist/ui/pagination.d.ts +30 -0
- package/dist/ui/pagination.js +72 -0
- package/dist/ui/pagination.js.map +1 -0
- package/dist/ui/prompts.d.ts +23 -4
- package/dist/ui/prompts.js +93 -19
- package/dist/ui/prompts.js.map +1 -1
- package/dist/ui/watch.js +3 -2
- package/dist/ui/watch.js.map +1 -1
- package/dist/utils/errors.js +15 -1
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/text.d.ts +2 -0
- package/dist/utils/text.js +10 -0
- package/dist/utils/text.js.map +1 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -94,7 +94,7 @@ spoti interactive
|
|
|
94
94
|
# alias: spoti i
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
-
Type a query and press Enter. Use `Tab` or left/right to switch between tracks, albums, artists, and playlists; use up/down to select; press Enter to play; press Esc to exit. The terminal is restored
|
|
97
|
+
Type a query and press Enter. Use `Tab` or left/right to switch between tracks, albums, artists, and playlists; use up/down to select; press Enter to play; press Esc to exit. Type or backspace after a search to edit the query. Category results are cached while the query remains unchanged, and temporary search or playback failures can be retried without reopening the command. The terminal is always restored when the interaction ends.
|
|
98
98
|
|
|
99
99
|
Authenticate once through Spotify's browser authorization page:
|
|
100
100
|
|
|
@@ -103,24 +103,28 @@ spoti login
|
|
|
103
103
|
spoti status
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
Control playback
|
|
106
|
+
Control playback. Quotes are optional for ordinary multi-word queries because `spoti` combines the remaining command arguments. Use quotes when a query contains shell-special characters such as `&`, `*`, `?`, or parentheses.
|
|
107
107
|
|
|
108
108
|
```bash
|
|
109
109
|
spoti now
|
|
110
110
|
spoti now --watch
|
|
111
|
-
spoti play
|
|
112
|
-
spoti play
|
|
113
|
-
spoti play
|
|
114
|
-
spoti play
|
|
111
|
+
spoti play Numb
|
|
112
|
+
spoti play Fear of the Dark
|
|
113
|
+
spoti play Numb --first
|
|
114
|
+
spoti play Numb --watch
|
|
115
|
+
spoti play Numb --no-watch
|
|
115
116
|
spoti pause
|
|
116
117
|
spoti resume
|
|
117
118
|
spoti next
|
|
118
119
|
spoti previous
|
|
120
|
+
spoti volume
|
|
119
121
|
spoti volume 50
|
|
120
122
|
spoti volume +10
|
|
121
123
|
spoti volume -10
|
|
124
|
+
spoti shuffle
|
|
122
125
|
spoti shuffle on
|
|
123
126
|
spoti shuffle off
|
|
127
|
+
spoti repeat
|
|
124
128
|
spoti repeat off
|
|
125
129
|
spoti repeat track
|
|
126
130
|
spoti repeat context
|
|
@@ -136,7 +140,7 @@ spoti device "My Computer"
|
|
|
136
140
|
|
|
137
141
|
Use the displayed one-based number, exact device name, or Spotify device ID.
|
|
138
142
|
|
|
139
|
-
When playback
|
|
143
|
+
When playback reports no active device, `spoti play` and `spoti resume` retry the one active controllable device if Spotify reports one, or the only controllable device when exactly one is available. If several inactive devices are available, `spoti` asks you to select one explicitly.
|
|
140
144
|
|
|
141
145
|
Seek within the current track:
|
|
142
146
|
|
|
@@ -146,7 +150,7 @@ spoti seek +30
|
|
|
146
150
|
spoti seek -10
|
|
147
151
|
```
|
|
148
152
|
|
|
149
|
-
View the queue or search for a track to add:
|
|
153
|
+
View the queue or search for a track to add. When Spotify represents an otherwise empty queue by repeating only the current track, `spoti` reports the queue as empty instead of printing duplicate entries:
|
|
150
154
|
|
|
151
155
|
```bash
|
|
152
156
|
spoti queue
|
|
@@ -176,9 +180,9 @@ spoti play playlist "Workout"
|
|
|
176
180
|
spoti play playlist 1
|
|
177
181
|
```
|
|
178
182
|
|
|
179
|
-
User playlists
|
|
183
|
+
User playlists preserve Spotify’s order so their global displayed numbers remain stable across pages. A displayed number can be reused with `spoti playlist <number>` or `spoti play playlist <number>`, including numbers beyond the first page.
|
|
180
184
|
|
|
181
|
-
In an interactive terminal, `spoti album` can play the entire album or a selected track after showing its details. `spoti artist` can play the artist context or let you
|
|
185
|
+
In an interactive terminal, `spoti album` can play the entire album or a selected track after showing its details. `spoti artist` can play the artist context or let you browse the artist’s albums lazily, with each fetched page ordered from newest to oldest by release date. From an album selected through an artist, choose **Back to albums** to reuse that list and select another release; pressing Enter in the album browser returns to the artist actions. `spoti playlist` can start the selected playlist or browse its tracks across all available pages and play one directly. Non-interactive runs remain display-only and never start playback implicitly.
|
|
182
186
|
|
|
183
187
|
`spoti play <query>` remains shorthand for track playback. The words `track`, `album`, `artist`, and `playlist` are treated as explicit types when followed by another argument. For a track query that starts with one of those reserved words, use `spoti play track <query>` (or quote the complete query as one shell argument). Context commands support `--first` to skip interactive selection.
|
|
184
188
|
|
|
@@ -193,7 +197,7 @@ spoti recent
|
|
|
193
197
|
spoti recent --limit 10
|
|
194
198
|
```
|
|
195
199
|
|
|
196
|
-
`spoti like` and `spoti unlike` operate on the currently playing track. Episodes, advertisements, local files, and unavailable items are ignored safely.
|
|
200
|
+
`spoti like` and `spoti unlike` operate on the currently playing track. Episodes, advertisements, local files, and unavailable items are ignored safely. Artist albums, `spoti playlists`, `spoti liked`, and `spoti recent` use paginated browsers: enter a displayed number to select it, `n` for the next page, `p` for the previous page, or press Enter to go back or leave playback unchanged. Pages are requested only when needed, and previously visited pages are cached for the duration of the command. Short Spotify rate limits are retried automatically with bounded backoff; when `Retry-After` exceeds five seconds, `spoti` exits immediately with a human-readable retry time instead of holding the terminal on a spinner. For collection commands, `--limit` controls the page size from 1 to 50; artist album pages use Spotify’s maximum of 10. Non-interactive runs display only the first page and never start playback implicitly.
|
|
197
201
|
|
|
198
202
|
Check for updates or install the latest npm release:
|
|
199
203
|
|
|
@@ -212,7 +216,7 @@ spoti logout
|
|
|
212
216
|
|
|
213
217
|
When attached to an interactive terminal, `spoti play <query>` asks you to select a result. In non-interactive usage it chooses the first result automatically; `--first` makes that behavior explicit.
|
|
214
218
|
|
|
215
|
-
Watch mode continuously refreshes the current track and progress until `Ctrl+C` is pressed. `--watch` enables it for one command, while `--no-watch` overrides a saved preference.
|
|
219
|
+
Watch mode continuously refreshes the current track and progress until `Ctrl+C` is pressed. `--watch` enables it for one command, while `--no-watch` overrides a saved preference. Run `spoti volume`, `spoti shuffle`, or `spoti repeat` without a value to inspect the current state. Pass a volume value or use `spoti shuffle on|off` or `spoti repeat off|track|context` to change it.
|
|
216
220
|
|
|
217
221
|
|
|
218
222
|
### Command aliases
|
|
@@ -222,9 +226,10 @@ Common aliases include:
|
|
|
222
226
|
```text
|
|
223
227
|
i interactive p play pa pause
|
|
224
228
|
r resume np now q queue s search
|
|
225
|
-
vol volume
|
|
226
|
-
|
|
227
|
-
|
|
229
|
+
vol volume sk seek alb album
|
|
230
|
+
art artist dev device devs devices
|
|
231
|
+
pl playlist pls playlists rep repeat
|
|
232
|
+
rec recent n next prev previous
|
|
228
233
|
```
|
|
229
234
|
|
|
230
235
|
### Shell completions
|
|
@@ -247,6 +252,16 @@ spoti completion fish | source # Fish
|
|
|
247
252
|
|
|
248
253
|
Interactive network operations display a spinner on stderr. Indicators remain disabled outside a TTY.
|
|
249
254
|
|
|
255
|
+
### Terminal formatting
|
|
256
|
+
|
|
257
|
+
Interactive terminals use restrained styling for names, metadata, headings, and playback progress. Redirected output remains plain text. Set the standard `NO_COLOR` environment variable to disable decorative styling:
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
NO_COLOR=1 spoti now
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
Spotify-provided names and descriptions are normalized to safe single-line terminal text before display.
|
|
264
|
+
|
|
250
265
|
## Configuration
|
|
251
266
|
|
|
252
267
|
View all settings:
|
|
@@ -324,4 +339,4 @@ The release workflow attaches the npm package tarball and a `SHA256SUMS` file, a
|
|
|
324
339
|
|
|
325
340
|
## Current scope
|
|
326
341
|
|
|
327
|
-
Version `0.
|
|
342
|
+
Version `0.6.0` adds lazy collection pagination, nested Back navigation, playlist-track selection, current-volume output, new command aliases, visible play-search progress, and bounded rate-limit handling. A full Ink-based TUI remains planned for `v1.0.0`.
|
package/dist/app.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ import type { RecentService } from './services/recent.service.js';
|
|
|
10
10
|
import type { SearchService } from './services/search.service.js';
|
|
11
11
|
import { type UpdateService } from './services/update.service.js';
|
|
12
12
|
import { type ConfigStore } from './storage/config.js';
|
|
13
|
-
import { type Output } from './ui/output.js';
|
|
14
|
-
import { confirmUpdate, promptSpotifyClientId, selectAlbum, selectAlbumAction, selectArtist, selectArtistAction, selectPlaylist, selectPlaylistAction, selectTrack } from './ui/prompts.js';
|
|
13
|
+
import { type Output, type OutputStyles } from './ui/output.js';
|
|
14
|
+
import { confirmUpdate, promptSpotifyClientId, selectAlbum, selectAlbumAction, selectArtist, selectArtistAction, selectPageAction, selectPlaylist, selectPlaylistAction, selectTrack } from './ui/prompts.js';
|
|
15
15
|
import { type ProgressRunner } from './ui/progress.js';
|
|
16
16
|
import { type InteractiveSearchResult } from './ui/interactive-search.js';
|
|
17
17
|
import { type PlaybackWatcher } from './ui/watch.js';
|
|
@@ -32,6 +32,7 @@ export interface AppDependencies {
|
|
|
32
32
|
chooseAlbum?: typeof selectAlbum;
|
|
33
33
|
chooseArtist?: typeof selectArtist;
|
|
34
34
|
choosePlaylist?: typeof selectPlaylist;
|
|
35
|
+
choosePageAction?: typeof selectPageAction;
|
|
35
36
|
chooseAlbumAction?: typeof selectAlbumAction;
|
|
36
37
|
chooseArtistAction?: typeof selectArtistAction;
|
|
37
38
|
choosePlaylistAction?: typeof selectPlaylistAction;
|
|
@@ -39,6 +40,7 @@ export interface AppDependencies {
|
|
|
39
40
|
confirmUpdate?: typeof confirmUpdate;
|
|
40
41
|
interactiveSearch?: () => Promise<InteractiveSearchResult>;
|
|
41
42
|
progress?: ProgressRunner;
|
|
43
|
+
styles?: OutputStyles;
|
|
42
44
|
watchPlayback?: PlaybackWatcher;
|
|
43
45
|
}
|
|
44
46
|
export declare function createProgram(dependencies: AppDependencies): Command;
|