groovectl 0.1.1 → 0.2.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 (133) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +203 -45
  3. package/dist/app/collection-service.d.ts +7 -1
  4. package/dist/app/collection-service.d.ts.map +1 -1
  5. package/dist/app/collection-service.js +64 -14
  6. package/dist/app/collection-service.js.map +1 -1
  7. package/dist/app/database-service.d.ts +12 -7
  8. package/dist/app/database-service.d.ts.map +1 -1
  9. package/dist/app/database-service.js +90 -12
  10. package/dist/app/database-service.js.map +1 -1
  11. package/dist/app/marketplace-offers.d.ts +25 -0
  12. package/dist/app/marketplace-offers.d.ts.map +1 -0
  13. package/dist/app/marketplace-offers.js +237 -0
  14. package/dist/app/marketplace-offers.js.map +1 -0
  15. package/dist/app/marketplace-service.d.ts +29 -2
  16. package/dist/app/marketplace-service.d.ts.map +1 -1
  17. package/dist/app/marketplace-service.js +220 -3
  18. package/dist/app/marketplace-service.js.map +1 -1
  19. package/dist/app/user-service.d.ts +11 -0
  20. package/dist/app/user-service.d.ts.map +1 -0
  21. package/dist/app/user-service.js +73 -0
  22. package/dist/app/user-service.js.map +1 -0
  23. package/dist/cli/commands/artist.d.ts.map +1 -1
  24. package/dist/cli/commands/artist.js +29 -8
  25. package/dist/cli/commands/artist.js.map +1 -1
  26. package/dist/cli/commands/collection.d.ts.map +1 -1
  27. package/dist/cli/commands/collection.js +201 -10
  28. package/dist/cli/commands/collection.js.map +1 -1
  29. package/dist/cli/commands/config.d.ts.map +1 -1
  30. package/dist/cli/commands/config.js +15 -1
  31. package/dist/cli/commands/config.js.map +1 -1
  32. package/dist/cli/commands/database-common.d.ts +4 -3
  33. package/dist/cli/commands/database-common.d.ts.map +1 -1
  34. package/dist/cli/commands/database-common.js +9 -5
  35. package/dist/cli/commands/database-common.js.map +1 -1
  36. package/dist/cli/commands/label.d.ts.map +1 -1
  37. package/dist/cli/commands/label.js +11 -4
  38. package/dist/cli/commands/label.js.map +1 -1
  39. package/dist/cli/commands/list.d.ts +5 -0
  40. package/dist/cli/commands/list.d.ts.map +1 -0
  41. package/dist/cli/commands/list.js +58 -0
  42. package/dist/cli/commands/list.js.map +1 -0
  43. package/dist/cli/commands/marketplace.d.ts.map +1 -1
  44. package/dist/cli/commands/marketplace.js +613 -28
  45. package/dist/cli/commands/marketplace.js.map +1 -1
  46. package/dist/cli/commands/master.d.ts.map +1 -1
  47. package/dist/cli/commands/master.js +53 -11
  48. package/dist/cli/commands/master.js.map +1 -1
  49. package/dist/cli/commands/release.d.ts.map +1 -1
  50. package/dist/cli/commands/release.js +135 -23
  51. package/dist/cli/commands/release.js.map +1 -1
  52. package/dist/cli/commands/schema.d.ts +38 -0
  53. package/dist/cli/commands/schema.d.ts.map +1 -0
  54. package/dist/cli/commands/schema.js +125 -0
  55. package/dist/cli/commands/schema.js.map +1 -0
  56. package/dist/cli/commands/search.d.ts.map +1 -1
  57. package/dist/cli/commands/search.js +36 -17
  58. package/dist/cli/commands/search.js.map +1 -1
  59. package/dist/cli/commands/user.d.ts +5 -0
  60. package/dist/cli/commands/user.d.ts.map +1 -0
  61. package/dist/cli/commands/user.js +43 -0
  62. package/dist/cli/commands/user.js.map +1 -0
  63. package/dist/cli/commands/wantlist.d.ts.map +1 -1
  64. package/dist/cli/commands/wantlist.js +44 -8
  65. package/dist/cli/commands/wantlist.js.map +1 -1
  66. package/dist/cli/create-program.d.ts +3 -1
  67. package/dist/cli/create-program.d.ts.map +1 -1
  68. package/dist/cli/create-program.js +42 -10
  69. package/dist/cli/create-program.js.map +1 -1
  70. package/dist/cli/global-options.d.ts +4 -0
  71. package/dist/cli/global-options.d.ts.map +1 -1
  72. package/dist/cli/global-options.js +3 -0
  73. package/dist/cli/global-options.js.map +1 -1
  74. package/dist/cli/run-cli.d.ts.map +1 -1
  75. package/dist/cli/run-cli.js +63 -6
  76. package/dist/cli/run-cli.js.map +1 -1
  77. package/dist/cli/runtime.d.ts +7 -2
  78. package/dist/cli/runtime.d.ts.map +1 -1
  79. package/dist/cli/runtime.js +15 -11
  80. package/dist/cli/runtime.js.map +1 -1
  81. package/dist/config/schema.d.ts +1 -1
  82. package/dist/config/store.d.ts.map +1 -1
  83. package/dist/config/store.js +15 -1
  84. package/dist/config/store.js.map +1 -1
  85. package/dist/discogs/client.d.ts +126 -8
  86. package/dist/discogs/client.d.ts.map +1 -1
  87. package/dist/discogs/client.js +117 -19
  88. package/dist/discogs/client.js.map +1 -1
  89. package/dist/discogs/database-schemas.d.ts +24 -12
  90. package/dist/discogs/database-schemas.d.ts.map +1 -1
  91. package/dist/discogs/database-schemas.js +10 -0
  92. package/dist/discogs/database-schemas.js.map +1 -1
  93. package/dist/discogs/marketplace-page.d.ts +10 -0
  94. package/dist/discogs/marketplace-page.d.ts.map +1 -0
  95. package/dist/discogs/marketplace-page.js +140 -0
  96. package/dist/discogs/marketplace-page.js.map +1 -0
  97. package/dist/discogs/marketplace-schemas.d.ts +332 -1
  98. package/dist/discogs/marketplace-schemas.d.ts.map +1 -1
  99. package/dist/discogs/marketplace-schemas.js +137 -1
  100. package/dist/discogs/marketplace-schemas.js.map +1 -1
  101. package/dist/discogs/schemas.d.ts +66 -8
  102. package/dist/discogs/schemas.d.ts.map +1 -1
  103. package/dist/discogs/schemas.js +62 -4
  104. package/dist/discogs/schemas.js.map +1 -1
  105. package/dist/discogs/user-schemas.d.ts +117 -8
  106. package/dist/discogs/user-schemas.d.ts.map +1 -1
  107. package/dist/discogs/user-schemas.js +64 -0
  108. package/dist/discogs/user-schemas.js.map +1 -1
  109. package/dist/domain/database-resource.d.ts +2 -0
  110. package/dist/domain/database-resource.d.ts.map +1 -1
  111. package/dist/domain/marketplace.d.ts +124 -0
  112. package/dist/domain/marketplace.d.ts.map +1 -1
  113. package/dist/domain/marketplace.js +76 -0
  114. package/dist/domain/marketplace.js.map +1 -1
  115. package/dist/domain/release.d.ts +48 -0
  116. package/dist/domain/release.d.ts.map +1 -1
  117. package/dist/domain/search-result.d.ts +2 -0
  118. package/dist/domain/search-result.d.ts.map +1 -1
  119. package/dist/domain/user-resource.d.ts +57 -1
  120. package/dist/domain/user-resource.d.ts.map +1 -1
  121. package/dist/http/marketplace-request.d.ts +3 -0
  122. package/dist/http/marketplace-request.d.ts.map +1 -0
  123. package/dist/http/marketplace-request.js +67 -0
  124. package/dist/http/marketplace-request.js.map +1 -0
  125. package/dist/output/records.d.ts +4 -2
  126. package/dist/output/records.d.ts.map +1 -1
  127. package/dist/output/records.js +20 -4
  128. package/dist/output/records.js.map +1 -1
  129. package/package.json +2 -1
  130. package/dist/output/renderer.d.ts +0 -8
  131. package/dist/output/renderer.d.ts.map +0 -1
  132. package/dist/output/renderer.js +0 -54
  133. package/dist/output/renderer.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.0 — 2026-11-21
4
+
5
+ - Add AI & automation CLI ergonomics:
6
+ `groovectl schema [command...] [--compact]` for offline machine-readable
7
+ command introspection, global `--error-format json` /
8
+ `GROOVECTL_ERROR_FORMAT=json` for structured stderr errors, global `--quiet`
9
+ (`-q`), and early-stopping `--limit <count>` on paginated list commands.
10
+ - Expand pressing-identification database reads: enrich `release get` with
11
+ `--currency`, `masterId`, `released`, `labels` + `catalogNumber`, `companies`,
12
+ `identifiers` (barcode, matrix/runout), `tracklist`, `notes`, `community`
13
+ stats, `lowestPrice`, `numForSale`, and format qty/text; add
14
+ `release rating get|set|remove`; add official Discogs filter/sort options to
15
+ `master versions` (`--media-format`, `--country`, `--label`, `--released`,
16
+ `--sort`, `--sort-order`, plus `have`/`want` counts) and `artist releases`
17
+ (`--sort`, `--sort-order`); include `masterId` and `barcodes` on `search`.
18
+ - Complete collection, wantlist, profile, and list management: add
19
+ `collection folder get|create|rename|delete`, `collection fields`,
20
+ `collection note set`, local `--query` filtering on `collection list` and
21
+ `wantlist list`, `user profile [username]`, and `list ls` / `list get`.
22
+ - Complete Marketplace capabilities: add
23
+ `marketplace price-suggestions <release-id>`,
24
+ `marketplace inventory [username]`, `marketplace listing create|update|delete`
25
+ (with `--dry-run`, `--yes`, grade normalization, and merge-on-update),
26
+ `marketplace orders list|get|update|messages|message`, and
27
+ `marketplace listings <release-id>` (best-effort website PJAX / `--html`
28
+ reader with gzip/deflate/brotli decompression, `--sort`, `--limit`,
29
+ `--verbose`, and seller/grade/price/rating filters).
30
+ - Accept empty Marketplace API shipping quotes (`{}`) as unknown rather than
31
+ rejecting an otherwise valid listing, and allow `null` pagination links.
32
+ - Validate `--fields` and `--json`/`--format` conflicts before issuing API
33
+ requests across read commands, including `--json --format table`.
34
+ - Return exit code 2 (`GROOVECTL_CONFIG_VALUE_INVALID`) when `config set`
35
+ receives an invalid enum or out-of-range value instead of an unexpected error.
36
+ - Avoid a redundant `/oauth/identity` lookup on `search`, route `--verbose`
37
+ diagnostics through the CLI stderr stream, and use the repository URL in the
38
+ API `User-Agent`.
39
+ - Fix `collection value` currency parsing for prefixed dollar currencies (such
40
+ as `CA$`, `A$`, `NZ$`, `MX$`, `R$`), ISO codes, and non-numeric placeholders.
41
+
3
42
  ## 0.1.1 — 2026-10-24
4
43
 
5
44
  - Prepare the first public npm distribution under the `groovectl` command.
package/README.md CHANGED
@@ -55,7 +55,7 @@ directory is on PATH. This local installation links to the checkout, so rebuild
55
55
  with `pnpm build` after changing source code and keep the checkout in place.
56
56
 
57
57
  A built tarball can also be installed with
58
- `npm install -g /path/to/groovectl-0.1.1.tgz`; recipients need Node.js 24+, but
58
+ `npm install -g /path/to/groovectl-0.2.0.tgz`; recipients need Node.js 24+, but
59
59
  do not need pnpm or a TypeScript compiler.
60
60
 
61
61
  For local development without installing, use `pnpm start -- --help` or
@@ -80,78 +80,150 @@ unchanged. Error prefixes now use `GROOVECTL_`; scripts matching the old
80
80
 
81
81
  - `groovectl --help`
82
82
  - `groovectl version [--json]`
83
+ - `groovectl schema [command...] [--compact]`
83
84
  - `groovectl auth login|status|logout`
84
- - `groovectl search [query] [filters] [--all]`
85
- - `groovectl release get <id>`
86
- - `groovectl master get <id>` / `groovectl master versions <id>`
87
- - `groovectl artist get <id>` / `groovectl artist releases <id>`
85
+ - `groovectl config get|set`
86
+ - `groovectl search [query] [filters] [--all] [--limit <n>]`
87
+ - `groovectl release get <id> [--currency <code>]`
88
+ - `groovectl release rating get|set|remove <id>`
89
+ - `groovectl master get <id>` /
90
+ `groovectl master versions <id> [--country ...] [--media-format ...] [--label ...] [--released ...] [--sort ...]`
91
+ - `groovectl artist get <id>` / `groovectl artist releases <id> [--sort ...]`
88
92
  - `groovectl label get <id>` / `groovectl label releases <id>`
89
- - `groovectl collection folders|list|contains|add|update|remove|value`
93
+ - `groovectl collection folders|folder|fields|note|list|contains|add|update|remove|value`
90
94
  - `groovectl wantlist list|add|update|remove`
91
- - `groovectl config get|set`
95
+ - `groovectl user profile [username]`
96
+ - `groovectl list ls [username]` / `groovectl list get <list-id>`
92
97
  - `groovectl marketplace stats <release-id> [--currency <code>]`
93
- - `groovectl marketplace listing get <listing-id> [--currency <code>]`
98
+ - `groovectl marketplace price-suggestions <release-id>`
99
+ - `groovectl marketplace listings <release-id> [filters] [--sort <order>] [--limit <n>] [--html <file>]`
100
+ - `groovectl marketplace inventory [username] [--status ...] [--sort ...]`
101
+ - `groovectl marketplace listing get|create|update|delete`
102
+ - `groovectl marketplace orders list|get|update|messages|message`
94
103
  - `groovectl marketplace fee <price> [--currency <code>]`
95
104
 
96
105
  Resource commands support `--format table|json|jsonl|tsv` and `--json` as a
97
106
  shortcut. Search uses `--output` for output format because its `--format` flag
98
- filters the release medium (for example Vinyl). List commands support `--page`,
99
- `--per-page`, and `--all`. Use the global `--fields id,title,...` option to
100
- select and order output fields. JSONL streams one record per line; JSON arrays
101
- are capped at 10,000 records to avoid unbounded memory use.
107
+ filters the release medium (for example Vinyl); `master versions` uses
108
+ `--media-format` to filter release medium alongside `--format` for output. List
109
+ commands support `--page`, `--per-page`, `--all`, and `--limit` (stopping
110
+ pagination as soon as the requested record count is reached). Use global
111
+ `--fields id,title,...` to select and order output fields, `--quiet` (`-q`) to
112
+ suppress informational stderr notices, and `--error-format json` (or
113
+ `GROOVECTL_ERROR_FORMAT=json`) for structured JSON errors on stderr. JSONL
114
+ streams one record per line; JSON arrays are capped at 10,000 records to avoid
115
+ unbounded memory use.
116
+
117
+ ## Identifying specific pressings
118
+
119
+ `release get <id>` returns full pressing-identification details without opening
120
+ the Discogs website: `masterId`, `released`, `formats` (including quantity and
121
+ format text such as `180g` or `Gatefold`), `labels` with `catalogNumber`,
122
+ `companies` (pressed/mastered by), `identifiers` (barcode, matrix/runout
123
+ etchings), `tracklist`, `notes`, `community` (`have`, `want`, rating),
124
+ `lowestPrice`, and `numForSale`.
125
+
126
+ ```sh
127
+ # 1. Search by catalog number, barcode, or title/artist
128
+ groovectl search --catno "25AP 755" --type release --json
129
+
130
+ # 2. Narrow down a master release to a specific pressing
131
+ groovectl master versions 5460 --country Japan --media-format Vinyl \
132
+ --released 1978 --sort released --sort-order asc --limit 10 --json
133
+
134
+ # 3. Inspect matrix/runout, barcode, tracklist, notes, and demand
135
+ groovectl release get 249504 --currency USD --json
136
+ groovectl release rating get 249504 --json
137
+ groovectl release rating set 249504 5 --dry-run --json
138
+ ```
102
139
 
103
- ## Collection and Wantlist
140
+ ## Collection, Wantlist, Profile, and Lists
104
141
 
105
- These commands always operate on the identity associated with the active token;
106
- they do not accept an arbitrary username.
142
+ Collection and Wantlist commands always operate on the identity associated with
143
+ the active token; they do not accept an arbitrary username. `user profile` and
144
+ `list ls` default to the authenticated user when `[username]` is omitted and can
145
+ read public profiles/lists when a username is given.
107
146
 
108
147
  ```sh
109
148
  groovectl collection folders --json
110
- groovectl collection list --folder 0 --sort added --sort-order desc --all --format jsonl
149
+ groovectl collection folder create "Japanese Pressings" --dry-run --json
150
+ groovectl collection folder rename 2 "Japan OBI Vinyl" --json
151
+ groovectl collection folder delete 3 --yes --json
152
+
153
+ # Inspect custom field IDs (e.g. Media Condition, Sleeve Condition, Notes)
154
+ groovectl collection fields --json
155
+ groovectl collection note set 1 249504 123456 1 "Very Good Plus (VG+)" --dry-run --json
156
+
157
+ # Filter locally across read pages by title, artist, label, catno, or notes
158
+ groovectl collection list --folder 0 --all --query "OBI" --limit 20 --json
111
159
  groovectl collection contains 249504 --json
112
160
  groovectl collection add 249504 --folder 1 --dry-run --json
113
161
  groovectl collection update 1 249504 123456 --rating 5 --dry-run
114
162
  groovectl collection remove 1 249504 123456 --yes
115
163
  groovectl collection value --json
116
164
 
117
- groovectl wantlist list --all --format jsonl
165
+ groovectl wantlist list --all --query "Blue Note" --limit 20 --json
118
166
  groovectl wantlist add 249504 --rating 5 --notes "Find a clean copy" --dry-run
119
167
  groovectl wantlist update 249504 --notes "Prefer first pressing"
120
168
  groovectl wantlist remove 249504 --yes
169
+
170
+ groovectl user profile --json
171
+ groovectl list ls --json
172
+ groovectl list get 123456 --json
121
173
  ```
122
174
 
123
175
  `--dry-run` still authenticates and resolves the current username, but sends no
124
- write request. Destructive `remove` commands prompt interactively; automation
125
- must pass `--yes`. Non-interactive removal without `--yes` exits with code 10.
126
- Mutation commands validate output format and selected fields before sending
127
- requests, so an invalid output option cannot accidentally modify account data.
176
+ write request. Destructive `remove` and `delete` commands prompt interactively;
177
+ automation must pass `--yes`. Non-interactive removal without `--yes` exits with
178
+ code 10. Read and mutation commands validate output format and selected fields
179
+ before sending requests.
128
180
 
129
- ## Marketplace reads
181
+ ## Marketplace
130
182
 
131
- These commands make one-shot reads of the official API. Token input remains
132
- optional, and the usual token resolution applies without a separate identity
133
- lookup. In live verification on 2026-10-11, stats worked anonymously, while
134
- listing and fee requests returned HTTP 401 without a token. When the API
135
- requires authentication, an anonymous request exits with
136
- `GROOVECTL_AUTH_REQUIRED` and instructions for supplying a token. An HTTP 401
137
- with a supplied token remains `GROOVECTL_AUTH_INVALID`; the CLI does not
138
- silently discard invalid credentials.
183
+ The official API commands cover release statistics (`stats`), condition-based
184
+ market price suggestions (`price-suggestions`), seller inventories
185
+ (`inventory`), individual listings (`listing get|create|update|delete`), orders
186
+ (`orders list|get|update|messages|message`), and selling fees (`fee`).
139
187
 
140
188
  ```sh
189
+ # Release market valuation
141
190
  groovectl marketplace stats 249504 --currency USD --json
142
- # Supply a token when required (hidden prompt); auth login also supports reuse.
143
- # Replace the example with a known listing ID from a Discogs item URL.
144
- groovectl --token marketplace listing get 123456789 --currency EUR --json
145
- groovectl --token marketplace fee 45.00 --currency USD --json
146
- groovectl marketplace stats 249504 --fields releaseId,lowestPrice,numForSale --format tsv
191
+ groovectl marketplace price-suggestions 249504 --json
192
+
193
+ # Browse any seller's shop (public) or your own inventory (omit username)
194
+ groovectl marketplace inventory some-record-shop --status "For Sale" --sort price --sort-order asc --limit 25 --json
195
+ groovectl marketplace inventory --all --format jsonl
196
+
197
+ # Inspect or manage individual listings (create defaults to Draft; update merges existing fields)
198
+ groovectl marketplace listing get 123456789 --currency EUR --json
199
+ groovectl marketplace listing create 249504 --condition VG+ --sleeve-condition VG+ --price 45.00 --dry-run --json
200
+ groovectl marketplace listing update 123456789 --price 39.99 --dry-run --json
201
+ groovectl marketplace listing delete 123456789 --yes --json
202
+
203
+ # Inspect and manage seller orders and fees
204
+ groovectl marketplace orders list --status "Payment Received" --json
205
+ groovectl marketplace orders get 12345-1 --json
206
+ groovectl marketplace orders messages 12345-1 --json
207
+ groovectl marketplace orders update 12345-1 --status Shipped --dry-run --json
208
+ groovectl marketplace orders message 12345-1 --message "Shipped today" --dry-run --json
209
+ groovectl marketplace fee 45.00 --currency USD --json
147
210
  ```
148
211
 
149
- All three commands support table, JSON, JSONL, TSV, and `--fields` with
150
- top-level output field names (for example `price` or `seller`, not
151
- `price.value`). Monetary values are `{ value, currency }` objects. Missing
152
- prices/counts remain `null` in JSON/JSONL; table and TSV display null as an
153
- empty value. No-stock and blocked releases are successful results. A missing
154
- listing is a not-found error.
212
+ For `stats`, `listing get`, and `fee`, token input remains optional, and the
213
+ usual token resolution applies without a separate identity lookup. When the API
214
+ requires authentication, an anonymous request exits with
215
+ `GROOVECTL_AUTH_REQUIRED` and instructions for supplying a token. An HTTP 401
216
+ with a supplied token remains `GROOVECTL_AUTH_INVALID`; the CLI does not
217
+ silently discard invalid credentials. An empty `shipping_price: {}` is treated
218
+ as an unknown shipping quote (`shippingPrice: null`), not a zero charge.
219
+ `price-suggestions` requires an authenticated token for an account with Discogs
220
+ seller settings configured.
221
+
222
+ All commands support table, JSON, JSONL, TSV, and `--fields` with top-level
223
+ output field names (for example `price` or `seller`, not `price.value`).
224
+ Monetary values are `{ value, currency }` objects. Missing prices/counts remain
225
+ `null` in JSON/JSONL; table and TSV display null as an empty value. No-stock and
226
+ blocked releases are successful results. A missing listing is a not-found error.
155
227
 
156
228
  Supported currencies: USD, GBP, EUR, CAD, AUD, JPY, CHF, MXN, BRL, NZD, SEK,
157
229
  ZAR. Omitting `--currency` leaves the choice to Discogs: stats use USD
@@ -162,10 +234,10 @@ symbols.
162
234
 
163
235
  Stats contain the lowest **item price**, not a delivered total including
164
236
  shipping and taxes. The official API does not document an endpoint to list every
165
- offer for a release; `listing get` needs an existing listing ID. Listing output
166
- uses `release.description` and normalizes original price currency and seller
167
- rating. Only a stable public subset is exposed, including when the token belongs
168
- to the listing owner; private inventory fields and cart state are omitted.
237
+ offer for a release; `listing get` needs an existing listing ID. Public
238
+ `listing get` output uses `release.description` and strips private owner-only
239
+ fields and cart state. `listing update` reads the existing listing internally so
240
+ partial updates (such as changing only `--price`) preserve other listing fields.
169
241
 
170
242
  There is no watch mode, scheduler, notification service, price history, or
171
243
  Marketplace cache/state file. Data is read for the current invocation and is not
@@ -175,6 +247,92 @@ Discogs. See the
175
247
  and
176
248
  [API Terms of Use](https://support.discogs.com/hc/en-us/articles/360009334593-API-Terms-of-Use).
177
249
 
250
+ ### Find offers by release (website reader)
251
+
252
+ `marketplace listings` discovers actual item links from a release's English
253
+ Marketplace HTML page using its PJAX request (`_pjax=#pjax_container`,
254
+ `X-PJAX: true`, `X-PJAX-Container: #pjax_container`). Both full saved pages and
255
+ PJAX fragments are supported. It uses the website, **not a release-listings
256
+ API**. Website access is best-effort: Discogs may return HTTP 403 or a challenge
257
+ even when API access works. The command reports that failure instead of
258
+ returning an empty inventory; it does not retry, bypass challenges, use API
259
+ tokens or cookies, or launch a browser. Website requests use Node's HTTPS
260
+ client; API requests continue using their existing transport. A PJAX read of
261
+ release 2980551 returned 22 offers on 2026-10-25, matching the API's sale count.
262
+ This undocumented website route may change independently of the public API.
263
+
264
+ ```sh
265
+ groovectl --quiet marketplace listings 2980551 --ships-from "United Kingdom" \
266
+ --currency GBP --min-media "VG+" --min-sleeve "VG+" \
267
+ --max-price 150 --min-seller-rating 99 --sort price-asc --all --limit 10 --json
268
+
269
+ # Alternatively save the English release Marketplace page as HTML in a browser.
270
+ groovectl marketplace listings 2117312 --html "/path/to/saved-page.html" \
271
+ --ships-from "United Kingdom" --min-media "VG+" --json
272
+ ```
273
+
274
+ The default reads one page (50 offers); `--page`, `--per-page` (max 100),
275
+ `--all`, `--limit`, and `--sort` (`price-asc`, `price-desc`, `listed-desc`,
276
+ `listed-asc`, `condition-desc`, `condition-asc`) are supported for live reads.
277
+ `--all` reads pages serially, with a 100-page ceiling; `--limit` stops fetching
278
+ further pages once enough matching offers are emitted; a failed later page exits
279
+ nonzero. JSON buffers the result until completion; JSONL can contain partial
280
+ rows before an error. `--html` reads only one supplied page and cannot be
281
+ combined with `--page`, `--all`, or `--sort`. Local HTML is read without network
282
+ access, is limited to 10 MiB, and has unknown freshness. Unrecognized markup,
283
+ wrong releases, inconsistent pagination, and challenge/login pages are errors
284
+ rather than zero offers.
285
+
286
+ Filters apply to the pages read. `--ships-from` filters the **seller's**
287
+ country, not the release's country or the shipping destination. `--currency`
288
+ filters the original item currency; it does not request conversion.
289
+ `--max-price` requires `--currency` and excludes shipping/tax. Grade choices,
290
+ from lowest to highest, are `P`, `F`, `G`, `G+`, `VG`, `VG+`, `NM`, `M`.
291
+ Unknown/generic sleeve grades and unknown ratings do not pass a requested
292
+ minimum. Offers marked unavailable on the page are excluded unless
293
+ `--include-unavailable` is supplied.
294
+
295
+ Each result includes `marketplaceUrl`, item `price`, `condition`,
296
+ `sleeveCondition`, `comments`, `shipsFrom`, `seller` (username, positive
297
+ feedback percentage, feedback count), `shippingText`, `availability`, `source`,
298
+ `sourceUrl`, and `readAt`. `readAt` is the time the CLI parsed the page, not the
299
+ time a saved HTML snapshot was captured. `shippingText` is an unverified page
300
+ quote for the page's destination, which may be unknown; it is not added to the
301
+ price. Grades and playback notes are seller claims, and these offers have not
302
+ been checked against `listing get`. Use that existing command with a candidate
303
+ ID for an independent API check when access permits. No cart state, private
304
+ account fields, or credentials are output.
305
+
306
+ ## AI agent & automation usage
307
+
308
+ Groovectl is designed as a pure Discogs CLI that AI agents and scripts can call
309
+ reliably without scraping web pages:
310
+
311
+ - **Discover commands offline**: run `groovectl schema --compact` (or
312
+ `groovectl schema marketplace`) for live machine-readable JSON metadata of
313
+ commands, arguments, options, choices, safety flags, and exit codes.
314
+ - **Structured errors**: pass `--error-format json` or set
315
+ `GROOVECTL_ERROR_FORMAT=json` so every usage, auth, rate-limit, or upstream
316
+ error is emitted as a single JSON object on stderr
317
+ (`{ error: { code, kind, message, remediation, httpStatus, exitCode } }`).
318
+ - **Clean output & token budget**: combine `--quiet`, `--json` (or
319
+ `--format jsonl`), `--fields`, and `--limit` to keep stdout clean and bounded.
320
+ - **Safe non-interactive mutations**: non-TTY invocations never hang on prompts;
321
+ preview every write with `--dry-run`, and pass `--yes` only after explicit
322
+ confirmation for deletions.
323
+
324
+ ```sh
325
+ # Recommended environment for AI tool callers
326
+ export GROOVECTL_ERROR_FORMAT=json
327
+
328
+ groovectl schema --compact
329
+ groovectl --quiet search "Kind of Blue" --type master --limit 5 --json
330
+ groovectl --quiet master versions 5460 --country Japan --media-format Vinyl --limit 10 --json
331
+ groovectl --quiet release get 249504 --fields id,title,labels,identifiers,notes,community,lowestPrice,numForSale --json
332
+ groovectl --quiet marketplace price-suggestions 249504 --json
333
+ groovectl --quiet marketplace listings 249504 --min-media VG+ --limit 10 --json
334
+ ```
335
+
178
336
  ## Authentication
179
337
 
180
338
  Public Database reads work anonymously. Database search requires a Discogs User
@@ -1,9 +1,15 @@
1
1
  import type { CollectionListParameters, DiscogsClient } from "../discogs/client.js";
2
- import type { CollectionAddResult, CollectionFolder, CollectionItem, CollectionValue } from "../domain/user-resource.js";
2
+ import type { CollectionAddResult, CollectionField, CollectionFolder, CollectionItem, CollectionValue } from "../domain/user-resource.js";
3
3
  export declare class CollectionService {
4
4
  #private;
5
5
  constructor(client: DiscogsClient);
6
6
  folders(username: string): Promise<CollectionFolder[]>;
7
+ getFolder(username: string, folderId: number): Promise<CollectionFolder>;
8
+ createFolder(username: string, name: string): Promise<CollectionFolder>;
9
+ renameFolder(username: string, folderId: number, name: string): Promise<CollectionFolder>;
10
+ deleteFolder(username: string, folderId: number): Promise<void>;
11
+ fields(username: string): Promise<CollectionField[]>;
12
+ setField(username: string, folderId: number, releaseId: number, instanceId: number, fieldId: number, value: string): Promise<void>;
7
13
  list(username: string, folderId: number, parameters: CollectionListParameters): Promise<CollectionItem[]>;
8
14
  listAll(username: string, folderId: number, parameters: Omit<CollectionListParameters, "page">): AsyncGenerator<CollectionItem>;
9
15
  contains(username: string, releaseId: number): Promise<CollectionItem[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"collection-service.d.ts","sourceRoot":"","sources":["../../src/app/collection-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,aAAa,EACd,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,eAAe,EAEhB,MAAM,4BAA4B,CAAC;AAGpC,qBAAa,iBAAiB;;gBAGhB,MAAM,EAAE,aAAa;IAI3B,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,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B,OAAO,CAAC,mBAAmB,CAAC;IAczB,MAAM,CACV,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAC9C,OAAO,CAAC,IAAI,CAAC;IAUV,MAAM,CACV,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC;IASV,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;CAoCxD"}
@@ -5,13 +5,34 @@ export class CollectionService {
5
5
  this.#client = client;
6
6
  }
7
7
  async folders(username) {
8
- return (await this.#client.getCollectionFolders(username)).map((folder) => ({
9
- id: folder.id,
10
- name: folder.name,
11
- count: folder.count,
12
- resourceUrl: folder.resource_url,
8
+ return (await this.#client.getCollectionFolders(username)).map((folder) => this.#mapFolder(folder));
9
+ }
10
+ async getFolder(username, folderId) {
11
+ return this.#mapFolder(await this.#client.getCollectionFolder(username, folderId));
12
+ }
13
+ async createFolder(username, name) {
14
+ return this.#mapFolder(await this.#client.createCollectionFolder(username, name));
15
+ }
16
+ async renameFolder(username, folderId, name) {
17
+ return this.#mapFolder(await this.#client.updateCollectionFolder(username, folderId, name));
18
+ }
19
+ async deleteFolder(username, folderId) {
20
+ await this.#client.deleteCollectionFolder(username, folderId);
21
+ }
22
+ async fields(username) {
23
+ return (await this.#client.getCollectionFields(username)).map((field) => ({
24
+ id: field.id,
25
+ name: field.name,
26
+ type: field.type,
27
+ position: field.position,
28
+ public: field.public ?? null,
29
+ lines: field.lines ?? null,
30
+ options: field.options,
13
31
  }));
14
32
  }
33
+ async setField(username, folderId, releaseId, instanceId, fieldId, value) {
34
+ await this.#client.setCollectionInstanceField(username, folderId, releaseId, instanceId, fieldId, value);
35
+ }
15
36
  async list(username, folderId, parameters) {
16
37
  return (await this.#client.getCollectionItems(username, folderId, parameters)).map((item) => this.#mapItem(item));
17
38
  }
@@ -46,6 +67,14 @@ export class CollectionService {
46
67
  maximum: parseMoney(value.maximum),
47
68
  };
48
69
  }
70
+ #mapFolder(folder) {
71
+ return {
72
+ id: folder.id,
73
+ name: folder.name,
74
+ count: folder.count,
75
+ resourceUrl: folder.resource_url,
76
+ };
77
+ }
49
78
  #mapItem(item) {
50
79
  return {
51
80
  ...mapBasicInformation(item.basic_information),
@@ -60,19 +89,40 @@ export class CollectionService {
60
89
  };
61
90
  }
62
91
  }
92
+ const currencyTokens = [
93
+ ["CA$", "CAD"],
94
+ ["AU$", "AUD"],
95
+ ["A$", "AUD"],
96
+ ["NZ$", "NZD"],
97
+ ["MX$", "MXN"],
98
+ ["R$", "BRL"],
99
+ ["US$", "USD"],
100
+ ["CHF", "CHF"],
101
+ ["SEK", "SEK"],
102
+ ["ZAR", "ZAR"],
103
+ ["CAD", "CAD"],
104
+ ["AUD", "AUD"],
105
+ ["NZD", "NZD"],
106
+ ["MXN", "MXN"],
107
+ ["BRL", "BRL"],
108
+ ["USD", "USD"],
109
+ ["EUR", "EUR"],
110
+ ["GBP", "GBP"],
111
+ ["JPY", "JPY"],
112
+ ["€", "EUR"],
113
+ ["£", "GBP"],
114
+ ["¥", "JPY"],
115
+ ];
63
116
  function parseMoney(display) {
64
- const symbols = {
65
- $: "USD",
66
- "€": "EUR",
67
- "£": "GBP",
68
- "¥": "JPY",
69
- };
70
- const symbol = Object.keys(symbols).find((candidate) => display.includes(candidate));
117
+ const matched = currencyTokens.find(([token]) => display.includes(token))?.[1];
118
+ const currency = matched ?? (/(?<![A-Za-z])\$/u.test(display) ? "USD" : null);
71
119
  const normalized = display.replace(/[^0-9.,-]/gu, "").replaceAll(",", "");
72
- const parsed = Number(normalized);
120
+ const parsed = /^-?\d+(?:\.\d+)?$/u.test(normalized)
121
+ ? Number(normalized)
122
+ : Number.NaN;
73
123
  return {
74
124
  value: Number.isFinite(parsed) ? parsed : null,
75
- currency: symbol === undefined ? null : (symbols[symbol] ?? null),
125
+ currency,
76
126
  display,
77
127
  };
78
128
  }
@@ -1 +1 @@
1
- {"version":3,"file":"collection-service.js","sourceRoot":"","sources":["../../src/app/collection-service.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,OAAO,iBAAiB;IACnB,OAAO,CAAgB;IAEhC,YAAY,MAAqB;QAC/B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,QAAgB;QAC5B,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAC5D,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YACX,EAAE,EAAE,MAAM,CAAC,EAAE;YACb,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,WAAW,EAAE,MAAM,CAAC,YAAY;SACjC,CAAC,CACH,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,IAAI,CACR,QAAgB,EAChB,QAAgB,EAChB,UAAoC;QAEpC,OAAO,CACL,MAAM,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,CAAC,CACtE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,CAAC,OAAO,CACZ,QAAgB,EAChB,QAAgB,EAChB,UAAkD;QAElD,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,qBAAqB,CACzD,QAAQ,EACR,QAAQ,EACR,UAAU,CACX,EAA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aginationParameters, SearchParameters } from "../discogs/client.js";
1
+ import type { ArtistReleasesParameters, DiscogsClient, MasterVersionsParameters, PaginationParameters, SearchParameters } from "../discogs/client.js";
2
2
  import type { Artist, ArtistRelease, Label, LabelRelease, Master, MasterVersion } from "../domain/database-resource.js";
3
- import type { Release } from "../domain/release.js";
3
+ import type { MarketplaceCurrency } from "../domain/marketplace.js";
4
+ import type { Release, ReleaseCommunityRating, ReleaseUserRating } from "../domain/release.js";
4
5
  import type { SearchResult } from "../domain/search-result.js";
5
6
  export declare class DatabaseService {
6
7
  #private;
7
8
  constructor(client: DiscogsClient);
8
- getRelease(id: number): Promise<Release>;
9
+ getRelease(id: number, currency?: MarketplaceCurrency): Promise<Release>;
10
+ getReleaseCommunityRating(id: number): Promise<ReleaseCommunityRating>;
11
+ getReleaseUserRating(id: number, username: string): Promise<ReleaseUserRating>;
12
+ setReleaseRating(id: number, username: string, rating: number): Promise<ReleaseUserRating>;
13
+ deleteReleaseRating(id: number, username: string): Promise<void>;
9
14
  search(parameters: SearchParameters): Promise<SearchResult[]>;
10
15
  getMaster(id: number): Promise<Master>;
11
- getMasterVersions(id: number, parameters: PaginationParameters): Promise<MasterVersion[]>;
12
- getMasterVersionsAll(id: number, parameters: Omit<PaginationParameters, "page">): AsyncGenerator<MasterVersion>;
16
+ getMasterVersions(id: number, parameters: MasterVersionsParameters): Promise<MasterVersion[]>;
17
+ getMasterVersionsAll(id: number, parameters: Omit<MasterVersionsParameters, "page">): AsyncGenerator<MasterVersion>;
13
18
  getArtist(id: number): Promise<Artist>;
14
- getArtistReleases(id: number, parameters: PaginationParameters): Promise<ArtistRelease[]>;
15
- getArtistReleasesAll(id: number, parameters: Omit<PaginationParameters, "page">): AsyncGenerator<ArtistRelease>;
19
+ getArtistReleases(id: number, parameters: ArtistReleasesParameters): Promise<ArtistRelease[]>;
20
+ getArtistReleasesAll(id: number, parameters: Omit<ArtistReleasesParameters, "page">): AsyncGenerator<ArtistRelease>;
16
21
  getLabel(id: number): Promise<Label>;
17
22
  getLabelReleases(id: number, parameters: PaginationParameters): Promise<LabelRelease[]>;
18
23
  getLabelReleasesAll(id: number, parameters: Omit<PaginationParameters, "page">): AsyncGenerator<LabelRelease>;
@@ -1 +1 @@
1
- {"version":3,"file":"database-service.d.ts","sourceRoot":"","sources":["../../src/app/database-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,KAAK,EACV,MAAM,EACN,aAAa,EACb,KAAK,EACL,YAAY,EACZ,MAAM,EACN,aAAa,EACd,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,qBAAa,eAAe;;gBAGd,MAAM,EAAE,aAAa;IAI3B,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAwBxC,MAAM,CAAC,UAAU,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAK7D,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAetC,iBAAiB,CACrB,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,oBAAoB,GAC/B,OAAO,CAAC,aAAa,EAAE,CAAC;IAMpB,oBAAoB,CACzB,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC,GAC7C,cAAc,CAAC,aAAa,CAAC;IAS1B,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IActC,iBAAiB,CACrB,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,oBAAoB,GAC/B,OAAO,CAAC,aAAa,EAAE,CAAC;IAMpB,oBAAoB,CACzB,EAAE,EAAE,MAAM,EACV,UAAU,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