import meow from "meow"; import meowHelp from "cli-meow-help"; const flags = { clear: { type: "boolean", default: true, alias: "c", desc: "Clear the console" }, noClear: { type: "boolean", default: false, desc: "Don't clear the console" }, debug: { type: "boolean", default: false, alias: "d", desc: "Print debug info" }, version: { type: "boolean", alias: "v", desc: "Print CLI version" }, setup: { type: "boolean", alias: "s", desc: "Setup ci&cd system" }, repository: { type: "string", alias: "r", desc: "Repository url for setup project" }, branch: { type: "string", alias: "b", desc: "Branch for project repo" }, targetPath: { type: "string", alias: "t", desc: "Target path for project" }, name: { type: "string", alias: "n", desc: "Project name for new directory" }, bind: { type: "string", alias: "bind", desc: "Bind ip for N - CI & CD (default 0.0.0.0)" }, generateRsa: { type: "boolean", default: false, alias: "g", desc: "Generate Git RSA Keys" }, port: { type: "number", alias: "p", desc: "N - CI & CD work port" }, privateKey: { type: "string", desc: "Private key for project" }, command: { type: "string", alias: "comm", desc: "Production build command. (Reminder. Its have prefix 'yarn'.)" }, nodeVersion: { type: "string", alias: "nVersion", desc: "Node version is required for your project (Ex. --nodeVersion 18.18.0)" }, environment: { type: "string", alias: "env", desc: "Production environment variables file directory" }, environmentVariable: { type: "string", alias: "ev", desc: "Only one environment variable (Ex. -ev NODE_ENV=production)" }, buildCommand: { type: "string", alias: "bComm", desc: "package.json npm build command for your project (Ex. build) (yarn '''build''') '''IMPORTANT COMMAND'''" }, file: { type: "string", alias: "f", desc: "Custom build file for multiple run. (Ex. -f /usr/ncicd.conf)" }, updateConf: { type: "string", alias: "uC", desc: "Update ncicd.conf for a specific project. (Ex. --updateConf \"nodeVersion:20.10.0\")" }, logs: { type: "boolean", alias: "l", desc: "Show PM2 logs. Usage: -l or -l SERVICE_NAME" }, update: { type: "boolean", alias: "u", desc: "Update ncicd CLI and restart the service" }, remove: { type: "string", alias: "rm", desc: "Remove a project service from PM2 and ncicd.conf (Ex. --remove projectName)" }, list: { type: "boolean", alias: "ls", desc: "List all configured projects in a table format" } }; const commands = { help: { desc: "Print help info" } }; const helpText = meowHelp({ name: "ncicd", flags, commands }); const options = { inferType: true, description: false, hardRejection: false, flags }; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore export default meow(helpText, options);