@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.
Files changed (58) hide show
  1. package/README.md +31 -16
  2. package/dist/app.d.ts +4 -2
  3. package/dist/app.js +194 -93
  4. package/dist/app.js.map +1 -1
  5. package/dist/cli.js +2 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/services/catalog.service.d.ts +2 -0
  8. package/dist/services/catalog.service.js +29 -4
  9. package/dist/services/catalog.service.js.map +1 -1
  10. package/dist/services/device.service.d.ts +3 -3
  11. package/dist/services/device.service.js +19 -11
  12. package/dist/services/device.service.js.map +1 -1
  13. package/dist/services/library.service.d.ts +2 -0
  14. package/dist/services/library.service.js +16 -2
  15. package/dist/services/library.service.js.map +1 -1
  16. package/dist/services/pagination.d.ts +20 -0
  17. package/dist/services/pagination.js +11 -0
  18. package/dist/services/pagination.js.map +1 -0
  19. package/dist/services/player.service.d.ts +5 -2
  20. package/dist/services/player.service.js +45 -12
  21. package/dist/services/player.service.js.map +1 -1
  22. package/dist/services/playlist.service.d.ts +4 -0
  23. package/dist/services/playlist.service.js +26 -14
  24. package/dist/services/playlist.service.js.map +1 -1
  25. package/dist/services/queue.service.js +11 -6
  26. package/dist/services/queue.service.js.map +1 -1
  27. package/dist/services/recent.service.d.ts +2 -0
  28. package/dist/services/recent.service.js +52 -2
  29. package/dist/services/recent.service.js.map +1 -1
  30. package/dist/services/search.service.d.ts +4 -4
  31. package/dist/services/search.service.js +10 -9
  32. package/dist/services/search.service.js.map +1 -1
  33. package/dist/spotify/client.d.ts +2 -0
  34. package/dist/spotify/client.js +175 -46
  35. package/dist/spotify/client.js.map +1 -1
  36. package/dist/spotify/types.d.ts +2 -0
  37. package/dist/ui/completions.js +27 -20
  38. package/dist/ui/completions.js.map +1 -1
  39. package/dist/ui/interactive-search.d.ts +4 -1
  40. package/dist/ui/interactive-search.js +218 -55
  41. package/dist/ui/interactive-search.js.map +1 -1
  42. package/dist/ui/output.d.ts +27 -11
  43. package/dist/ui/output.js +87 -45
  44. package/dist/ui/output.js.map +1 -1
  45. package/dist/ui/pagination.d.ts +30 -0
  46. package/dist/ui/pagination.js +72 -0
  47. package/dist/ui/pagination.js.map +1 -0
  48. package/dist/ui/prompts.d.ts +23 -4
  49. package/dist/ui/prompts.js +93 -19
  50. package/dist/ui/prompts.js.map +1 -1
  51. package/dist/ui/watch.js +3 -2
  52. package/dist/ui/watch.js.map +1 -1
  53. package/dist/utils/errors.js +15 -1
  54. package/dist/utils/errors.js.map +1 -1
  55. package/dist/utils/text.d.ts +2 -0
  56. package/dist/utils/text.js +10 -0
  57. package/dist/utils/text.js.map +1 -0
  58. 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 even when a request fails.
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 "Numb"
112
- spoti play "Numb" --first
113
- spoti play "Numb" --watch
114
- spoti play "Numb" --no-watch
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 has no active device, `spoti play` and `spoti resume` automatically target it if exactly one controllable device is available.
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 are sorted consistently by name, so the displayed number can be reused with `spoti playlist <number>` or `spoti play playlist <number>`.
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 select one of the artist’s albums, and `spoti playlist` can start the selected playlist. Non-interactive runs remain display-only and never start playback implicitly.
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 dev device devs devices
226
- pl playlist pls playlists rep repeat
227
- rec recent n next prev previous
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.3.0` supports authentication and persistent client-ID setup; track, album, artist, and playlist discovery and playback; guided playback actions; current playback and watch mode; player, queue, library, device, and update controls. The current development branch adds explicit interactive search, aliases, loading indicators, shell completions, configuration polish, and Node 24-based GitHub Actions. A full Ink-based TUI remains planned for `v1.0.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;