UNPKG

@kareemaly/researcher

Version:
36 lines (35 loc) 1.34 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.createCli = createCli; const commander_1 = require("commander"); const path_1 = __importDefault(require("path")); const logger_1 = require("../utils/logger"); const search_1 = require("./search"); const list_1 = require("./list"); const show_1 = require("./show"); const clean_1 = require("./clean"); const log = (0, logger_1.createLogger)("cli"); function createCli() { const program = new commander_1.Command(); program .name("researcher") .description("CLI tool for research automation") .version("1.0.0") .option("-o, --output <dir>", "output directory", path_1.default.join(process.cwd(), "research")) .option("-v, --verbose", "enable verbose logging") .hook("preAction", (thisCommand) => { // Enable debug logging if verbose flag is set if (thisCommand.opts().verbose) { process.env.DEBUG = "researcher:*"; } }); // Add commands (0, search_1.searchCommand)(program); (0, list_1.listCommand)(program); (0, show_1.showCommand)(program); (0, clean_1.cleanCommand)(program); return program; }