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 ", "The API key to interact with the API") .makeOptionMandatory(true) .env("HOARDER_API_KEY"), ) .addOption( new Option( "--server-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();