diff options
| author | Mohamed Bassem <me@mbassem.com> | 2026-01-26 01:12:37 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-26 01:12:37 +0000 |
| commit | 42cdc937c867f5e35c75534f55caea51c60d388a (patch) | |
| tree | 4676519f6b557c00f0598d4e7705dc08cd87f1f5 /apps/cli/src/commands/lists.ts | |
| parent | 5656e394d3d879d9cd48c18400cd7ce4c12f416e (diff) | |
| download | karakeep-42cdc937c867f5e35c75534f55caea51c60d388a.tar.zst | |
feat(cli): Add bookmark search command (#2426)
* feat(cli): Add search subcommand to bookmarks
Add a new search subcommand that uses the searchBookmarks API endpoint.
The command supports:
- Full-text search with advanced query matchers (tag:, is:, list:, etc.)
- Pagination with --all flag to fetch all results
- Sorting by relevance, ascending, or descending order
- Optional full content inclusion with --include-content
- Configurable result limit per page
Example usage:
bookmarks search "is:fav tag:important"
bookmarks search "kotlin" --sort-order desc --limit 20
bookmarks search "title:api" --include-content --all
* fixes + format
---------
Co-authored-by: Claude <noreply@anthropic.com>
Diffstat (limited to 'apps/cli/src/commands/lists.ts')
| -rw-r--r-- | apps/cli/src/commands/lists.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/cli/src/commands/lists.ts b/apps/cli/src/commands/lists.ts index 864fa790..1d9341d7 100644 --- a/apps/cli/src/commands/lists.ts +++ b/apps/cli/src/commands/lists.ts @@ -86,15 +86,24 @@ listsCmd .command("get") .description("gets all the ids of the bookmarks assigned to the list") .requiredOption("--list <id>", "the id of the list") + .option( + "--include-content", + "include full bookmark content in results", + false, + ) .action(async (opts) => { const api = getAPIClient(); try { - let resp = await api.bookmarks.getBookmarks.query({ listId: opts.list }); + let resp = await api.bookmarks.getBookmarks.query({ + listId: opts.list, + includeContent: opts.includeContent, + }); let results: string[] = resp.bookmarks.map((b) => b.id); while (resp.nextCursor) { resp = await api.bookmarks.getBookmarks.query({ listId: opts.list, cursor: resp.nextCursor, + includeContent: opts.includeContent, }); results = [...results, ...resp.bookmarks.map((b) => b.id)]; } |
