aboutsummaryrefslogtreecommitdiffstats
path: root/apps/cli/src
diff options
context:
space:
mode:
authorkamtschatka <simon.schatka@gmx.at>2024-10-05 15:37:39 +0200
committerGitHub <noreply@github.com>2024-10-05 14:37:39 +0100
commit4bda7a923025bee5251229531c0a33a07107dbd0 (patch)
treed7b8ff09e3f8831547e6c40cb78d7353845c5487 /apps/cli/src
parentb56655cd45843f7206206b62d5daf60fcd85e810 (diff)
downloadkarakeep-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')
-rw-r--r--apps/cli/src/commands/lists.ts18
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")