aboutsummaryrefslogtreecommitdiffstats
path: root/apps/cli/src
diff options
context:
space:
mode:
Diffstat (limited to 'apps/cli/src')
-rw-r--r--apps/cli/src/commands/bookmarks.ts24
-rw-r--r--apps/cli/src/commands/lists.ts20
-rw-r--r--apps/cli/src/commands/tags.ts8
-rw-r--r--apps/cli/src/index.ts8
4 files changed, 30 insertions, 30 deletions
diff --git a/apps/cli/src/commands/bookmarks.ts b/apps/cli/src/commands/bookmarks.ts
index 264ad818..0d68fee0 100644
--- a/apps/cli/src/commands/bookmarks.ts
+++ b/apps/cli/src/commands/bookmarks.ts
@@ -7,7 +7,7 @@ import type { ZBookmark } from "@hoarder/shared/types/bookmarks";
export const bookmarkCmd = new Command()
.name("bookmarks")
- .description("Manipulating bookmarks");
+ .description("manipulating bookmarks");
function collect<T>(val: T, acc: T[]) {
acc.push(val);
@@ -31,7 +31,7 @@ function normalizeBookmark(bookmark: ZBookmark) {
bookmarkCmd
.command("add")
- .description("Creates a new bookmark")
+ .description("creates a new bookmark")
.option(
"--link <link>",
"the link to add. Specify multiple times to add multiple links",
@@ -87,14 +87,14 @@ bookmarkCmd
bookmarkCmd
.command("update")
- .description("Archive a bookmark")
- .option("--title <title>", "If set, the bookmark's title will be updated")
- .option("--note <note>", "If set, the bookmark's note will be updated")
- .option("--archive", "If set, the bookmark will be archived")
- .option("--no-archive", "If set, the bookmark will be unarchived")
- .option("--favourite", "If set, the bookmark will be favourited")
- .option("--no-favourite", "If set, the bookmark will be unfavourited")
- .argument("<id>", "The id of the bookmark to get")
+ .description("update a bookmark")
+ .option("--title <title>", "if set, the bookmark's title will be updated")
+ .option("--note <note>", "if set, the bookmark's note will be updated")
+ .option("--archive", "if set, the bookmark will be archived")
+ .option("--no-archive", "if set, the bookmark will be unarchived")
+ .option("--favourite", "if set, the bookmark will be favourited")
+ .option("--no-favourite", "if set, the bookmark will be unfavourited")
+ .argument("<id>", "the id of the bookmark to get")
.action(async (id, opts) => {
const api = getAPIClient();
const resp = await api.bookmarks.updateBookmark.mutate({
@@ -114,7 +114,7 @@ bookmarkCmd
"If set, archived bookmarks will be fetched as well",
false,
)
- .option("--list-id <id>", "If set, only items from that list will be fetched")
+ .option("--list-id <id>", "if set, only items from that list will be fetched")
.action(async (opts) => {
const api = getAPIClient();
const resp = await api.bookmarks.getBookmarks.query({
@@ -127,7 +127,7 @@ bookmarkCmd
bookmarkCmd
.command("delete")
.description("delete a bookmark")
- .argument("<id>", "The id of the bookmark to delete")
+ .argument("<id>", "the id of the bookmark to delete")
.action(async (id) => {
const api = getAPIClient();
await api.bookmarks.deleteBookmark.mutate({ bookmarkId: id });
diff --git a/apps/cli/src/commands/lists.ts b/apps/cli/src/commands/lists.ts
index abf6f78c..c7b2a5f0 100644
--- a/apps/cli/src/commands/lists.ts
+++ b/apps/cli/src/commands/lists.ts
@@ -6,11 +6,11 @@ import { listsToTree } from "@hoarder/shared/utils/listUtils";
export const listsCmd = new Command()
.name("lists")
- .description("Manipulating lists");
+ .description("manipulating lists");
listsCmd
.command("list")
- .description("Lists all lists")
+ .description("lists all lists")
.action(async () => {
const api = getAPIClient();
@@ -31,8 +31,8 @@ listsCmd
listsCmd
.command("delete")
- .description("Deletes a list")
- .argument("<id>", "The id of the list")
+ .description("deletes a list")
+ .argument("<id>", "the id of the list")
.action(async (id) => {
const api = getAPIClient();
@@ -44,9 +44,9 @@ listsCmd
listsCmd
.command("add-bookmark")
- .description("Add a bookmark to list")
- .requiredOption("--list <id>", "The id of the list")
- .requiredOption("--bookmark <bookmark>", "The id of the bookmark")
+ .description("add a bookmark to list")
+ .requiredOption("--list <id>", "the id of the list")
+ .requiredOption("--bookmark <bookmark>", "the id of the bookmark")
.action(async (opts) => {
const api = getAPIClient();
@@ -59,9 +59,9 @@ listsCmd
listsCmd
.command("remove-bookmark")
- .description("Remove a bookmark from list")
- .requiredOption("--list <id>", "The id of the list")
- .requiredOption("--bookmark <bookmark>", "The id of the bookmark")
+ .description("remove a bookmark from list")
+ .requiredOption("--list <id>", "the id of the list")
+ .requiredOption("--bookmark <bookmark>", "the id of the bookmark")
.action(async (opts) => {
const api = getAPIClient();
diff --git a/apps/cli/src/commands/tags.ts b/apps/cli/src/commands/tags.ts
index f74f1df6..410f1abd 100644
--- a/apps/cli/src/commands/tags.ts
+++ b/apps/cli/src/commands/tags.ts
@@ -4,11 +4,11 @@ import { getBorderCharacters, table } from "table";
export const tagsCmd = new Command()
.name("tags")
- .description("Manipulating tags");
+ .description("manipulating tags");
tagsCmd
.command("list")
- .description("Lists all tags")
+ .description("lists all tags")
.action(async () => {
const api = getAPIClient();
@@ -27,8 +27,8 @@ tagsCmd
tagsCmd
.command("delete")
- .description("Delete a tag")
- .argument("<id>", "The id of the tag")
+ .description("delete a tag")
+ .argument("<id>", "the id of the tag")
.action(async (id) => {
const api = getAPIClient();
diff --git a/apps/cli/src/index.ts b/apps/cli/src/index.ts
index cdb2956e..12cd7a13 100644
--- a/apps/cli/src/index.ts
+++ b/apps/cli/src/index.ts
@@ -7,22 +7,22 @@ import { setGlobalOptions } from "@/lib/globals";
import { Command, Option } from "@commander-js/extra-typings";
const program = new Command()
- .name("hoarder-cli")
+ .name("hoarder")
.description("A CLI interface to interact with the hoarder api")
.addOption(
- new Option("--api-key <key>", "The API key to interact with the API")
+ new Option("--api-key <key>", "the API key to interact with the API")
.makeOptionMandatory(true)
.env("HOARDER_API_KEY"),
)
.addOption(
new Option(
"--server-addr <addr>",
- "The address of the server to connect to",
+ "the address of the server to connect to",
)
.makeOptionMandatory(true)
.env("HOARDER_SERVER_ADDR"),
)
- .version(process.env.SERVER_VERSION ?? "nightly");
+ .version(process.env.npm_package_version ?? "0.0.0");
program.addCommand(bookmarkCmd);
program.addCommand(listsCmd);