diff options
| author | kamtschatka <simon.schatka@gmx.at> | 2024-10-05 15:37:39 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-05 14:37:39 +0100 |
| commit | 4bda7a923025bee5251229531c0a33a07107dbd0 (patch) | |
| tree | d7b8ff09e3f8831547e6c40cb78d7353845c5487 /apps/cli/src/commands | |
| parent | b56655cd45843f7206206b62d5daf60fcd85e810 (diff) | |
| download | karakeep-4bda7a923025bee5251229531c0a33a07107dbd0.tar.zst | |
feature(cli): Add ability to get all bookmark IDs of a list. Fixes #442 (#446)
Added a command that returns the ids of the bookmarks in a list
Diffstat (limited to 'apps/cli/src/commands')
| -rw-r--r-- | apps/cli/src/commands/lists.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/cli/src/commands/lists.ts b/apps/cli/src/commands/lists.ts index 855624d6..4b157cdf 100644 --- a/apps/cli/src/commands/lists.ts +++ b/apps/cli/src/commands/lists.ts @@ -83,6 +83,24 @@ export async function addToList(listId: string, bookmarkId: string) { } listsCmd + .command("get") + .description("gets all the ids of the bookmarks assigned to the list") + .requiredOption("--list <id>", "the id of the list") + .action(async (opts) => { + const api = getAPIClient(); + try { + const results = await api.lists.get.query({ listId: opts.list }); + + printObject(results.bookmarks); + } catch (error) { + printErrorMessageWithReason( + "Failed to get the ids of the bookmarks in the list", + error as object, + ); + } + }); + +listsCmd .command("add-bookmark") .description("add a bookmark to list") .requiredOption("--list <id>", "the id of the list") |
