Skip to content

Commit

Permalink
feature(cli): Add ability to get all bookmark IDs of a list. Fixes #442
Browse files Browse the repository at this point in the history
… (#446)

Added a command that returns the ids of the bookmarks in a list
  • Loading branch information
kamtschatka authored Oct 5, 2024
1 parent b56655c commit 4bda7a9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions apps/cli/src/commands/lists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,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")
Expand Down

0 comments on commit 4bda7a9

Please sign in to comment.