@supacortex/cli 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +17 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -188,11 +188,12 @@ var registerWhoamiCommand = (program2) => {
|
|
|
188
188
|
// src/commands/bookmarks.ts
|
|
189
189
|
var registerBookmarksCommand = (program2) => {
|
|
190
190
|
const bookmarks = program2.command("bookmarks");
|
|
191
|
-
bookmarks.command("list").option("-l, --limit <number>", "Max results", "20").option("-o, --offset <number>", "Skip results").option("-s, --search <string>", "Search bookmarks").option("-j, --json", "Output raw JSON").description("List all bookmarks").action(async (option) => {
|
|
191
|
+
bookmarks.command("list").option("-l, --limit <number>", "Max results", "20").option("-o, --offset <number>", "Skip results").option("-s, --search <string>", "Search bookmarks").option("-t, --type <string>", "Filter by type (tweet, link, youtube)").option("-j, --json", "Output raw JSON").description("List all bookmarks").action(async (option) => {
|
|
192
192
|
const searchParams = new URLSearchParams();
|
|
193
193
|
if (option.limit) searchParams.append("limit", String(parseInt(option.limit, 10)));
|
|
194
194
|
if (option.offset) searchParams.append("offset", String(parseInt(option.offset, 10)));
|
|
195
195
|
if (option.search) searchParams.append("search", option.search);
|
|
196
|
+
if (option.type) searchParams.append("type", option.type);
|
|
196
197
|
const result = await apiRequest(
|
|
197
198
|
`bookmarks?${searchParams.toString()}`,
|
|
198
199
|
"GET"
|
|
@@ -220,6 +221,21 @@ var registerBookmarksCommand = (program2) => {
|
|
|
220
221
|
}
|
|
221
222
|
console.log(`Bookmark added: ${result.title || result.url}`);
|
|
222
223
|
});
|
|
224
|
+
bookmarks.command("get").description("Get a bookmark by ID").argument("<id>", "Bookmark ID").option("-j, --json", "Output raw JSON").action(async (id, option) => {
|
|
225
|
+
const data = await apiRequest(`bookmarks/${id}`, "GET");
|
|
226
|
+
if (option.json) {
|
|
227
|
+
console.log(JSON.stringify(data, null, 2));
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
console.log(`ID: ${data.id}`);
|
|
231
|
+
console.log(`Type: ${data.type}`);
|
|
232
|
+
console.log(`Title: ${data.title || "(none)"}`);
|
|
233
|
+
console.log(`URL: ${data.url}`);
|
|
234
|
+
if (data.author) console.log(`Author: ${data.author}`);
|
|
235
|
+
if (data.content) console.log(`Content: ${data.content.slice(0, 200)}${data.content.length > 200 ? "\u2026" : ""}`);
|
|
236
|
+
console.log(`Read: ${data.isRead ? "yes" : "no"}`);
|
|
237
|
+
console.log(`Created: ${data.createdAt}`);
|
|
238
|
+
});
|
|
223
239
|
bookmarks.command("delete").description("Delete a bookmark").argument("<id>", "Bookmark ID to delete").option("-j, --json", "Output raw JSON").action(async (id, option) => {
|
|
224
240
|
const result = await apiRequest(`bookmarks/${id}`, "DELETE");
|
|
225
241
|
if (option.json) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supacortex/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Supacortex CLI — your second brain from the terminal",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
],
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|
|
24
|
-
"url": "https://github.com/monorepo-labs/supacortex"
|
|
24
|
+
"url": "git+https://github.com/monorepo-labs/supacortex.git"
|
|
25
25
|
},
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"dependencies": {
|