Skip to content

Commit b73dedf

Browse files
authored
feat(cli): Modify list via HTTP POST (#2)
1 parent 683293c commit b73dedf

File tree

6 files changed

+245
-70
lines changed

6 files changed

+245
-70
lines changed

README.md

Lines changed: 122 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# mdblist-cli
22

33
[![GitHub license](https://img.shields.io/github/license/luckylittle/mdblist-cli.svg)](https://github.com/luckylittle/mdblist-cli/blob/master/LICENSE)
4-
[![Version](https://img.shields.io/badge/Version-1.0.0-green.svg)](https://github.com/luckylittle/mdblist-cli/releases)
4+
[![Version](https://img.shields.io/badge/Version-0.0.6-green.svg)](https://github.com/luckylittle/mdblist-cli/releases)
55
[![Go Report Card](https://goreportcard.com/badge/github.com/luckylittle/mdblist-cli)](https://goreportcard.com/report/github.com/luckylittle/mdblist-cli)
66

77
## Overview
@@ -12,21 +12,23 @@
1212

1313
### About `mdblist-cli`
1414

15-
The idea is to perform basic MDBList operations directly from your command line, regardless of what OS you use. This Golang project leverages it's [native API](https://api.mdblist.com/) - the API documentation is located here: [Apiary](https://mdblist.docs.apiary.io/).
15+
The idea is to perform basic MDBList operations directly from your command line, regardless of what OS you use. This Golang project leverages it's [native API](https://api.mdblist.com/) - the API documentation is located on [Apiary](https://mdblist.docs.apiary.io/).
1616

1717
## Download
1818

1919
See the latest [release](https://github.com/luckylittle/mdblist-cli/releases/). We have single binary for MacOSX/ARM64, MacOSX/x86_64, FreeBSD, Linux/ARM, Linux/ARM64, Linux/x86_64, Windows x64.
2020

2121
## Usage
2222

23-
* Set up the API key environment variable in your Shell:
23+
* :warning: Set up the API key environment variable in your Shell first :warning:
2424

2525
```bash
2626
export MDBLIST_API_KEY=abcdefghijklmnopqrstuvwxy
2727
```
2828

29-
* Help - No arguments
29+
* No arguments - available commands
30+
31+
<details>
3032

3133
```bash
3234
$ ./mdblist-cli
@@ -40,7 +42,7 @@ Available Commands:
4042
get Get resources from MDBList
4143
help Help about any command
4244
search Search resources in MDBList
43-
update Update resources on MDBList
45+
update Update resources in MDBList
4446

4547
Flags:
4648
-h, --help help for mdblist-cli
@@ -49,26 +51,30 @@ Flags:
4951
Use "mdblist-cli [command] --help" for more information about a command.
5052
```
5153

54+
</details>
55+
5256
* Help - Get
5357

58+
<details>
59+
5460
```bash
5561
$ ./mdblist-cli get --help
56-
Get resources from MDBList
62+
Get resources from MDBList.
5763

5864
Usage:
5965
mdblist-cli get [command]
6066

6167
Available Commands:
62-
last-activities Fetch the last activity timestamps for sync
63-
list Fetch a specific list by ID or by username and list name
64-
list-changes Fetch changes for a list by its ID
65-
list-items Fetch items from a list by ID or by username and list name
68+
last-activities Fetch the last activity timestamps for sync.
69+
list Retrieves details of a list.
70+
list-changes Returns Trakt IDs for items changed after the last list update.
71+
list-items Fetches items from a specified list.
6672
media-info Fetch information about a media item
67-
my-limits Get information about your API limits
68-
my-lists Fetch your lists
69-
top-lists Fetch the top lists
70-
user-lists Fetch a user's lists by ID or username
71-
watchlist-items Fetch items from the user's watchlist
73+
my-limits Show information about user limits.
74+
my-lists Fetches users lists.
75+
top-lists Outputs the top lists sorted by Trakt likes.
76+
user-lists Fetch a user's lists.
77+
watchlist-items Fetches watchlist items, they are sorted by date added.
7278
7379
Flags:
7480
-h, --help help for get
@@ -79,18 +85,22 @@ Global Flags:
7985
Use "mdblist-cli get [command] --help" for more information about a command.
8086
```
8187
88+
</details>
89+
8290
* Help - Search
8391
92+
<details>
93+
8494
```bash
8595
$ ./mdblist-cli search --help
86-
Search resources in MDBList
96+
Search resources in MDBList.
8797
8898
Usage:
8999
mdblist-cli search [command]
90100
91101
Available Commands:
92-
lists Search for public lists
93-
media Search for media
102+
lists Search public lists by title.
103+
media Search for movie, show or both (any).
94104
95105
Flags:
96106
-h, --help help for search
@@ -101,17 +111,22 @@ Global Flags:
101111
Use "mdblist-cli search [command] --help" for more information about a command.
102112
```
103113
114+
</details>
115+
104116
* Help - Update
105117
118+
<details>
119+
106120
```bash
107121
$ ./mdblist-cli update --help
108-
Update resources on MDBList
122+
Update resources in MDBList.
109123
110124
Usage:
111125
mdblist-cli update [command]
112126
113127
Available Commands:
114-
list-name Update a list's name by ID or by username and list name
128+
list-items You can modify static list by adding or removing items.
129+
list-name Updates the name of a list.
115130
116131
Flags:
117132
-h, --help help for update
@@ -122,10 +137,14 @@ Global Flags:
122137
Use "mdblist-cli update [command] --help" for more information about a command.
123138
```
124139
140+
</details>
141+
125142
## Examples
126143
127144
* `mdblist-cli get my-limits` - Get information about the API key's limits
128145

146+
<details>
147+
129148
```json
130149
{
131150
"api_requests": 1000,
@@ -136,8 +155,12 @@ Use "mdblist-cli update [command] --help" for more information about a command.
136155
}
137156
```
138157

158+
</details>
159+
139160
* `mdblist-cli get top-lists` - Top lists **JSON** (omitted)
140161

162+
<details>
163+
141164
```json
142165
[
143166
{
@@ -155,7 +178,11 @@ Use "mdblist-cli update [command] --help" for more information about a command.
155178
...
156179
```
157180
158-
* `mdblist-cli get top-lists --output=yaml` - Same as above, Top lists **YAML** (omitted)
181+
</details>
182+
183+
* `mdblist-cli get top-lists --output=yaml` - Top lists again, but **YAML** (omitted)
184+
185+
<details>
159186
160187
```yaml
161188
- id: 2194
@@ -172,8 +199,12 @@ Use "mdblist-cli update [command] --help" for more information about a command.
172199
...
173200
```
174201
202+
</details>
203+
175204
* `mdblist-cli get list --id 2194` - Specific list details
176205
206+
<details>
207+
177208
```json
178209
[
179210
{
@@ -191,8 +222,12 @@ Use "mdblist-cli update [command] --help" for more information about a command.
191222
]
192223
```
193224
225+
</details>
226+
194227
* `mdblist-cli get list-items --username garycrawfordgc --listname "latest-tv-shows"` - Get items from the list (omitted)
195228
229+
<details>
230+
196231
```json
197232
{
198233
"movies": [],
@@ -212,7 +247,11 @@ Use "mdblist-cli update [command] --help" for more information about a command.
212247
...
213248
```
214249
215-
* `mdblist-cli get media-info imdb show tt32159809 --output=yaml` - Get details about the media
250+
</details>
251+
252+
* `mdblist-cli get media-info imdb show tt32159809 --output=yaml` - Get details about the media, **YAML** (omitted)
253+
254+
<details>
216255
217256
```yaml
218257
title: The Paper
@@ -239,7 +278,11 @@ ratings:
239278
...
240279
```
241280
242-
* `mdblist-cli search media any -q "The Paper"` - Search query
281+
</details>
282+
283+
* `mdblist-cli search media any -q "The Paper"` - Search query, first 100 items (omitted)
284+
285+
<details>
243286
244287
```json
245288
...
@@ -258,10 +301,61 @@ ratings:
258301
}
259302
}
260303
],
261-
"total": 40
304+
"total": 100
262305
}
263306
```
264307
308+
</details>
309+
310+
* `mdblist-cli update list-items -a add -i 113124 --movie-imdb tt26581740` - Add item to the static list
311+
312+
<details>
313+
314+
`List items updated successfully (action: add).`
315+
316+
```json
317+
{
318+
"added": {
319+
"episodes": 0,
320+
"movies": 1,
321+
"seasons": 0,
322+
"shows": 0
323+
},
324+
"existing": {
325+
"episodes": 0,
326+
"movies": 0,
327+
"seasons": 0,
328+
"shows": 0
329+
},
330+
"not_found": {
331+
"episodes": 0,
332+
"movies": 0,
333+
"seasons": 0,
334+
"shows": 0
335+
}
336+
}
337+
```
338+
339+
</details>
340+
341+
* `mdblist-cli update list-items -a remove -i 113124 --movie-imdb tt26581740 --output yaml` - Remove item from the static list, **YAML**
342+
343+
<details>
344+
345+
`List items updated successfully (action: remove).`
346+
347+
```yaml
348+
added: {}
349+
existing: {}
350+
notfound:
351+
episodes: 0
352+
movies: 0
353+
seasons: 0
354+
shows: 0
355+
```
356+
357+
</details>
358+
265359
## Development
266360
267361
### Requirements
@@ -276,15 +370,15 @@ Tested with `go version go1.24.3 linux/amd64`.
276370
277371
`go mod tidy`
278372
279-
### Get help (test)
373+
### Get help (test before build)
280374
281375
`go run . --help`
282376
283-
### Get your API limits (test)
377+
### Get your API limits (test before build)
284378
285379
`go run . get my-limits`
286380
287-
### Get your lists (test)
381+
### Get your lists (test before build)
288382
289383
`go run . get my-lists`
290384
@@ -296,4 +390,4 @@ GNU General Public License
296390
297391
Lucian Maly <<lmaly@redhat.com>>
298392
299-
_Last update: Sat 06 Sep 2025 10:02:43 UTC_
393+
_Last update: Tue 09 Sep 2025 07:04:27 UTC_

0 commit comments

Comments
 (0)