aboutsummaryrefslogtreecommitdiffstats
path: root/apps/cli/index.ts
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-04-02 15:12:40 +0100
committerMohamedBassem <me@mbassem.com>2024-04-02 15:12:40 +0100
commitd4406729df2d285729ab9f2ad3301e0d726ef164 (patch)
treebfba411c289c0c0e97d760b83844de0d5dc18333 /apps/cli/index.ts
parent79321f83293bc37d37af4b0a0b2bd324f5bafe1a (diff)
downloadkarakeep-d4406729df2d285729ab9f2ad3301e0d726ef164.tar.zst
featuer: Introduce a new CLI for mass manipulation of bookmarks
Diffstat (limited to 'apps/cli/index.ts')
-rw-r--r--apps/cli/index.ts29
1 files changed, 29 insertions, 0 deletions
diff --git a/apps/cli/index.ts b/apps/cli/index.ts
new file mode 100644
index 00000000..03699e55
--- /dev/null
+++ b/apps/cli/index.ts
@@ -0,0 +1,29 @@
+import { Command, Option } from "@commander-js/extra-typings";
+import { bookmarkCmd } from "commands/bookmarks";
+import { whoamiCmd } from "commands/whoami";
+import { setGlobalOptions } from "lib/globals";
+
+const program = new Command()
+ .name("hoarder-cli")
+ .description("A CLI interface to interact with the hoarder api")
+ .addOption(
+ 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",
+ )
+ .makeOptionMandatory(true)
+ .env("HOARDER_SERVER_ADDR"),
+ )
+ .version("0.1.0");
+
+program.addCommand(bookmarkCmd);
+program.addCommand(whoamiCmd);
+
+setGlobalOptions(program.opts());
+
+program.parse();