From 75d181ef437b2ff5f70663f403dfca8b84fe2b8b Mon Sep 17 00:00:00 2001 From: xion Date: Sun, 27 Apr 2025 03:26:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8A=A9=E6=89=8B=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=B8=8E=E6=9C=8D=E5=8A=A1=E5=91=BD=E4=BB=A4=E6=89=A9=E5=B1=95?= =?UTF-8?q?=E5=8F=8A=E4=BE=9D=E8=B5=96=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assistant/.npmrc | 2 + assistant/bun.config.mjs | 3 + assistant/package.json | 9 +-- assistant/src/app.ts | 10 ++- assistant/src/command/asst-server/index.ts | 31 ++++++++++ assistant/src/command/config-manager/index.ts | 39 ++++++++++++ assistant/src/config.ts | 2 +- assistant/src/index.ts | 1 + .../src/module/assistant/config/index.ts | 21 ++++++- .../local-app-manager/assistant-app.ts | 3 +- assistant/src/program.ts | 2 +- assistant/src/routes/config/index.ts | 27 ++++++++ assistant/src/routes/index.ts | 2 + assistant/src/routes/shop-install/index.ts | 61 +++++++++++++++++++ assistant/src/server.ts | 2 + assistant/src/services/app/index.ts | 1 + assistant/src/services/init/index.ts | 49 ++++++++++----- assistant/task-command/.gitignore | 4 +- assistant/task-command/bun.config.mjs | 28 +++++++++ assistant/task-command/package.json | 10 +-- assistant/tsconfig.json | 28 ++------- bin/assistant-server.js | 0 bin/assistant.js | 0 pnpm-lock.yaml | 23 +++++-- src/program.ts | 2 +- 25 files changed, 296 insertions(+), 64 deletions(-) create mode 100644 assistant/.npmrc create mode 100644 assistant/src/command/asst-server/index.ts create mode 100644 assistant/src/routes/config/index.ts create mode 100644 assistant/src/routes/index.ts create mode 100644 assistant/src/routes/shop-install/index.ts create mode 100644 assistant/src/services/app/index.ts create mode 100644 assistant/task-command/bun.config.mjs mode change 100755 => 100644 bin/assistant-server.js mode change 100755 => 100644 bin/assistant.js diff --git a/assistant/.npmrc b/assistant/.npmrc new file mode 100644 index 0000000..7446745 --- /dev/null +++ b/assistant/.npmrc @@ -0,0 +1,2 @@ +//npm.xiongxiao.me/:_authToken=${ME_NPM_TOKEN} +//registry.npmjs.org/:_authToken=${NPM_TOKEN} \ No newline at end of file diff --git a/assistant/bun.config.mjs b/assistant/bun.config.mjs index 09a4239..6760c99 100644 --- a/assistant/bun.config.mjs +++ b/assistant/bun.config.mjs @@ -35,6 +35,9 @@ await Bun.build({ naming: { entry: 'assistant-server.mjs', }, + define: { + ENVISION_VERSION: JSON.stringify(pkg.version), + }, external: ['pm2'], env: 'ENVISION_*', }); diff --git a/assistant/package.json b/assistant/package.json index 194aa5b..b7ea22a 100644 --- a/assistant/package.json +++ b/assistant/package.json @@ -33,6 +33,8 @@ "@kevisual/query": "0.0.17", "@kevisual/query-login": "0.0.5", "@kevisual/router": "^0.0.13", + "@kevisual/task-command": "^0.0.2", + "@kevisual/types": "^0.0.7", "@kevisual/use-config": "^1.0.11", "@types/bun": "^1.2.10", "@types/lodash-es": "^4.17.12", @@ -42,6 +44,7 @@ "chalk": "^5.4.1", "commander": "^13.1.0", "cross-env": "^7.0.3", + "dayjs": "^1.11.13", "dotenv": "^16.5.0", "get-port": "^7.1.0", "inquirer": "^12.6.0", @@ -52,7 +55,6 @@ "send": "^1.2.0", "supports-color": "^10.0.0", "ws": "npm:@kevisual/ws", - "dayjs": "^1.11.13", "zustand": "^5.0.3" }, "engines": { @@ -63,10 +65,5 @@ }, "dependencies": { "pm2": "^6.0.5" - }, - "overrides": { - "ws": "npm:@kevisual/ws", - "@kevisual/query": "0.0.17", - "@kevisual/router": "0.0.13" } } \ No newline at end of file diff --git a/assistant/src/app.ts b/assistant/src/app.ts index a3b12cc..2773ec7 100644 --- a/assistant/src/app.ts +++ b/assistant/src/app.ts @@ -1,7 +1,13 @@ import { App } from '@kevisual/router'; import { HttpsPem } from '@/module/assistant/https/sign.ts'; -import { assistantConfig } from '@/config.ts'; -export { assistantConfig }; +// import { AssistantConfig } from '@/module/assistant/index.ts'; +import { AssistantInit } from '@/services/init/index.ts'; +export const configDir = AssistantInit.detectConfigDir(); +export const assistantConfig = new AssistantInit({ + path: configDir, + init: true, +}); + const httpsPem = new HttpsPem(assistantConfig); export const app = new App({ serverOptions: { diff --git a/assistant/src/command/asst-server/index.ts b/assistant/src/command/asst-server/index.ts new file mode 100644 index 0000000..7234787 --- /dev/null +++ b/assistant/src/command/asst-server/index.ts @@ -0,0 +1,31 @@ +import { program, Command } from '@/program.ts'; +import { spawnSync } from 'node:child_process'; + +const command = new Command('server') + .description('启动服务') + .option('-d, --daemon', '是否以守护进程方式运行') + .option('-n, --name ', '服务名称') + .option('-p, --port ', '服务端口') + .option('-s, --start', '是否启动服务') + .action((options) => { + const { port } = options; + const shellCommands = []; + if (options.daemon) { + shellCommands.push('-d'); + } + if (options.name) { + shellCommands.push(`-n ${options.name}`); + } + if (options.start) { + shellCommands.push('-s'); + } + if (port) { + shellCommands.push(`-p ${port}`); + } + console.log(`Assistant server shell command: asst-server ${shellCommands.join(' ')}`); + const child = spawnSync('asst-server', shellCommands, { + stdio: 'inherit', + shell: true, + }); + }); +program.addCommand(command); diff --git a/assistant/src/command/config-manager/index.ts b/assistant/src/command/config-manager/index.ts index 31eba5c..f3c7d68 100644 --- a/assistant/src/command/config-manager/index.ts +++ b/assistant/src/command/config-manager/index.ts @@ -1,6 +1,9 @@ import { program, Command } from '@/program.ts'; import { AssistantInit } from '@/services/init/index.ts'; import path from 'node:path'; +import fs from 'node:fs'; +import inquirer from 'inquirer'; +import chalk from 'chalk'; type InitCommandOptions = { path?: string; @@ -24,3 +27,39 @@ const Init = new Command('init') }); program.addCommand(Init); + +const removeCommand = new Command('remove') + .description('删除助手配置文件') // TODO + .option('-p --path ', '助手路径,默认为执行命令的目录,如果助手路径不存在则创建。') + .action((opts) => { + if (opts.path && !opts.path.startsWith('/')) { + opts.path = path.join(process.cwd(), opts.path); + } else if (opts.path) { + opts.path = path.resolve(opts.path); + } + const configDir = AssistantInit.detectConfigDir(opts.path); + const assistantDir = path.join(configDir, 'assistant-app'); + + if (fs.existsSync(assistantDir)) { + inquirer + .prompt([ + { + type: 'confirm', + name: 'confirm', + message: `确定要删除助手配置文件吗?\n助手配置文件路径:${assistantDir}`, + default: false, + }, + ]) + .then((answers) => { + if (answers.confirm) { + fs.rmSync(assistantDir, { recursive: true, force: true }); + console.log(chalk.green('助手配置文件已删除')); + } else { + console.log(chalk.blue('助手配置文件未删除')); + } + }); + } else { + console.log(chalk.blue('助手配置文件不存在')); + } + }); +program.addCommand(removeCommand); diff --git a/assistant/src/config.ts b/assistant/src/config.ts index ebcb84e..bf19024 100644 --- a/assistant/src/config.ts +++ b/assistant/src/config.ts @@ -3,5 +3,5 @@ import { AssistantConfig } from '@/module/assistant/index.ts'; export const configDir = AssistantConfig.detectConfigDir(); export const assistantConfig = new AssistantConfig({ configDir, - init: true, + init: false, }); diff --git a/assistant/src/index.ts b/assistant/src/index.ts index 8216991..1db8480 100644 --- a/assistant/src/index.ts +++ b/assistant/src/index.ts @@ -1,6 +1,7 @@ import { program, runProgram } from '@/program.ts'; import './command/config-manager/index.ts'; import './command/app-manager/index.ts'; +import './command/asst-server/index.ts'; /** * 通过命令行解析器解析参数 diff --git a/assistant/src/module/assistant/config/index.ts b/assistant/src/module/assistant/config/index.ts index 92b935d..e8b84f8 100644 --- a/assistant/src/module/assistant/config/index.ts +++ b/assistant/src/module/assistant/config/index.ts @@ -20,7 +20,7 @@ export const initConfig = (configRootPath: string) => { const pageConfigPath = path.join(configDir, 'assistant-page-config.json'); const pageDir = createDir(path.join(configDir, 'page')); const appsDir = createDir(path.join(configDir, 'apps')); - const appsConfigPath = path.join(appsDir, 'assistant-apps-config.json'); + const appsConfigPath = path.join(configDir, 'assistant-apps-config.json'); const appPidPath = path.join(configDir, 'assistant-app.pid'); const envConfigPath = path.join(configDir, '.env'); return { @@ -82,17 +82,34 @@ type AssistantConfigOptions = { }; export class AssistantConfig { config: AssistantConfigData; - configPath: ReturnInitConfigType; + #configPath: ReturnInitConfigType; configDir: string; + isMountedConfig?: boolean; constructor(opts?: AssistantConfigOptions) { this.configDir = opts?.configDir || configDir; if (opts?.init) { this.init(); } } + set configPath(configPath: ReturnInitConfigType) { + this.#configPath = configPath; + } + get configPath() { + if (!this.#configPath) { + initConfig(this.configDir); + } + return this.#configPath; + } init() { this.configPath = initConfig(this.configDir); + this.isMountedConfig = true; } + checkMounted() { + if (!this.isMountedConfig) { + this.init(); + } + } + getConfigPath() {} getConfig() { try { if (!checkFileExists(this.configPath.configPath)) { diff --git a/assistant/src/module/assistant/local-app-manager/assistant-app.ts b/assistant/src/module/assistant/local-app-manager/assistant-app.ts index 7a720f1..5468b6b 100644 --- a/assistant/src/module/assistant/local-app-manager/assistant-app.ts +++ b/assistant/src/module/assistant/local-app-manager/assistant-app.ts @@ -6,7 +6,8 @@ export class AssistantApp extends Manager { config: AssistantConfig; constructor(config: AssistantConfig) { - const appsPath = config.configPath?.appsDir || path.join(process.cwd(), 'apps'); + config.checkMounted(); + const appsPath = config?.configPath?.appsDir || path.join(process.cwd(), 'apps'); const appsConfigPath = config.configPath?.appsConfigPath; const configFimename = path.basename(appsConfigPath || ''); super({ diff --git a/assistant/src/program.ts b/assistant/src/program.ts index 3af29fc..84716ca 100644 --- a/assistant/src/program.ts +++ b/assistant/src/program.ts @@ -8,7 +8,7 @@ try { if (ENVISION_VERSION) version = ENVISION_VERSION; } catch (e) {} // @ts-ignore -program.name('app').description('A CLI tool with envison').version(version); +program.name('asst').description('A CLI tool with envison').version(version, '-v, --version', 'output the current version'); const ls = new Command('ls').description('List files in the current directory').action(() => { console.log('List files'); diff --git a/assistant/src/routes/config/index.ts b/assistant/src/routes/config/index.ts new file mode 100644 index 0000000..10474b0 --- /dev/null +++ b/assistant/src/routes/config/index.ts @@ -0,0 +1,27 @@ +import { app, assistantConfig } from '@/app.ts'; +// import { getCacheAssistantConfig, setConfig } from '@/modules/config/index.ts'; +// import { reload } from '@/modules/parent-msg.ts'; + +app + .route({ + path: 'config', + description: '获取配置', + }) + .define(async (ctx) => { + ctx.body = assistantConfig.getCacheAssistantConfig(); + }) + .addTo(app); + +app + .route({ + path: 'config', + key: 'set', + description: '设置配置', + }) + .define(async (ctx) => { + const { data } = ctx.query; + // reload(); + + ctx.body = assistantConfig.setConfig(data); + }) + .addTo(app); diff --git a/assistant/src/routes/index.ts b/assistant/src/routes/index.ts new file mode 100644 index 0000000..92d5510 --- /dev/null +++ b/assistant/src/routes/index.ts @@ -0,0 +1,2 @@ +import './config/index.ts' +import './shop-install/index.ts' \ No newline at end of file diff --git a/assistant/src/routes/shop-install/index.ts b/assistant/src/routes/shop-install/index.ts new file mode 100644 index 0000000..f1ee941 --- /dev/null +++ b/assistant/src/routes/shop-install/index.ts @@ -0,0 +1,61 @@ +import { app } from '@/app.ts'; +// import { getInstallList, installApp, uninstallApp } from '@/modules/install.ts'; +const getInstallList = async () => { + return []; +}; +const installApp = async (pkg: string) => { + return { + code: 200, + message: 'success', + data: { + pkg, + }, + }; +}; +const uninstallApp = async (pkg: string) => { + return { + code: 200, + message: 'success', + }; +}; + +app + .route({ + path: 'shop', + key: 'list-installed', + }) + .define(async (ctx) => { + // https://localhost:51015/client/router?path=shop&key=list-installed + const list = await getInstallList(); + ctx.body = list; + }) + .addTo(app); + +app + .route({ + path: 'shop', + key: 'install', + }) + .define(async (ctx) => { + // https://localhost:51015/client/router?path=shop&key=install + const { pkg } = ctx.query.data; + const res = await installApp(pkg); + if (res.code !== 200) { + ctx.throw(res.code, res.message); + } + ctx.body = res; + }) + .addTo(app); + +app + .route({ + path: 'shop', + key: 'uninstall', + }) + .define(async (ctx) => { + // https://localhost:51015/client/router?path=shop&key=uninstall + const { pkg } = ctx.query.data; + const res = await uninstallApp(pkg); + ctx.body = res; + }) + .addTo(app); diff --git a/assistant/src/server.ts b/assistant/src/server.ts index 05deb1f..55a7e21 100644 --- a/assistant/src/server.ts +++ b/assistant/src/server.ts @@ -1,5 +1,7 @@ import { app } from './app.ts'; import { proxyRoute, proxyWs } from './services/proxy/proxy-page-index.ts'; +import './routes/index.ts'; + import getPort, { portNumbers } from 'get-port'; import { program } from 'commander'; import { spawnSync } from 'child_process'; diff --git a/assistant/src/services/app/index.ts b/assistant/src/services/app/index.ts new file mode 100644 index 0000000..fb3ebba --- /dev/null +++ b/assistant/src/services/app/index.ts @@ -0,0 +1 @@ +// app downlaod diff --git a/assistant/src/services/init/index.ts b/assistant/src/services/init/index.ts index 660ffd0..2dc22f7 100644 --- a/assistant/src/services/init/index.ts +++ b/assistant/src/services/init/index.ts @@ -2,6 +2,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { checkFileExists, AssistantConfig } from '@/module/assistant/index.ts'; import { chalk } from '@/module/chalk.ts'; +import { HttpsPem } from '@/module/assistant/https/sign.ts'; export type AssistantInitOptions = { path?: string; init?: boolean; @@ -15,8 +16,11 @@ export class AssistantInit extends AssistantConfig { const configDir = opts?.path || process.cwd(); super({ configDir, - init: opts?.init ?? false, + init: false, }); + if (opts?.init) { + this.init(); + } } async init() { @@ -24,38 +28,51 @@ export class AssistantInit extends AssistantConfig { if (!this.checkConfigPath()) { console.log(chalk.blue('助手路径不存在,正在创建...')); super.init(); - this.createAssistantConfig(); } else { super.init(); console.log(chalk.yellow('助手路径已存在')); - return; } + this.createAssistantConfig(); + this.createEnvConfig(); + this.createOtherConfig(); } checkConfigPath() { const assistantPath = path.join(this.configDir, 'assistant-app', 'assistant-config.json'); return checkFileExists(assistantPath); } + createEnvConfig() { + const env = this.configPath?.envConfigPath; + // 创建助手环境配置文件 env + if (!checkFileExists(env, true)) { + fs.writeFileSync(env, '# 环境配置文件\n'); + console.log(chalk.green('助手环境配置.env文件创建成功')); + } + } + createOtherConfig() { + const appsConfig = this.configPath?.appsConfigPath; + // 创建助手应用配置文件 apps + if (!checkFileExists(appsConfig, true)) { + fs.writeFileSync(appsConfig, JSON.stringify({ description: 'apps manager.', list: [] })); + console.log(chalk.green('助手应用配置文件 apps.json 创建成功')); + } + // create pem dir // + const pemDir = path.join(this.configPath?.configDir, 'pem'); + if (!checkFileExists(pemDir)) { + new HttpsPem(this); + console.log(chalk.green('助手证书目录创建成功')); + } + } createAssistantConfig() { const assistantPath = this.configPath?.configPath; // 创建助手配置文件 assistant-config.json if (!checkFileExists(assistantPath, true)) { this.setConfig({ description: '助手配置文件', + home: '/root/center', + proxy: [], + apiProxyList: [], }); console.log(chalk.green('助手配置文件assistant-config.json创建成功')); } - const env = this.configPath?.envConfigPath; - // 创建助手环境配置文件 env - if (!checkFileExists(env, true)) { - fs.writeFileSync(env, '# 环境配置文件\n'); - console.log(chalk.green('助手环境配置.env文件创建成功')); - } - - const appsConfig = this.configPath?.appsConfigPath; - // 创建助手应用配置文件 apps - if (!checkFileExists(appsConfig, true)) { - fs.writeFileSync(appsConfig, JSON.stringify({ description: 'apps manager.', list: [] })); - console.log(chalk.green('助手应用配置文件apps.json创建成功')); - } } } diff --git a/assistant/task-command/.gitignore b/assistant/task-command/.gitignore index 4edcc19..ec5120a 100644 --- a/assistant/task-command/.gitignore +++ b/assistant/task-command/.gitignore @@ -6,4 +6,6 @@ dist pack-dist .env* -!.env*example \ No newline at end of file +!.env*example + +mod.mjs \ No newline at end of file diff --git a/assistant/task-command/bun.config.mjs b/assistant/task-command/bun.config.mjs new file mode 100644 index 0000000..aca994c --- /dev/null +++ b/assistant/task-command/bun.config.mjs @@ -0,0 +1,28 @@ +// @ts-check +// https://bun.sh/docs/bundler +import path from 'node:path'; +import pkg from './package.json'; +import fs from 'node:fs'; +// bun run src/index.ts -- +import { fileURLToPath } from 'node:url'; +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +/** + * + * @param {string} p + * @returns + */ +export const w = (p) => path.join(__dirname, p); +await Bun.build({ + target: 'node', + format: 'esm', + entrypoints: [w('./mod.ts')], + outdir: w('.'), + naming: { + entry: 'mod.mjs', + }, + external: ['pm2'], + define: { + ENVISION_VERSION: JSON.stringify(pkg.version), + }, + env: 'ENVISION_*', +}); \ No newline at end of file diff --git a/assistant/task-command/package.json b/assistant/task-command/package.json index a534b3a..70dfb74 100644 --- a/assistant/task-command/package.json +++ b/assistant/task-command/package.json @@ -1,10 +1,11 @@ { "name": "@kevisual/task-command", - "version": "0.0.1", + "version": "0.0.2", "description": "", "types": "mod.d.ts", "scripts": { - "dts": "dts -i mod.ts -o mod.d.ts -d ." + "dts": "dts -i mod.ts -o mod.d.ts -d .", + "build": "bun run bun.config.mjs" }, "keywords": [], "publishConfig": { @@ -13,14 +14,15 @@ }, "files": [ "mod.ts", - "mod.d.ts" + "mod.d.ts", + "mod.mjs" ], "author": "abearxiong (https://www.xiongxiao.me)", "license": "MIT", "packageManager": "pnpm@10.7.0", "type": "module", "exports": { - ".": "./mod.ts", + ".": "./mod.mjs", "./mod.ts": "./mod.ts" } } \ No newline at end of file diff --git a/assistant/tsconfig.json b/assistant/tsconfig.json index f3f7926..75f256e 100644 --- a/assistant/tsconfig.json +++ b/assistant/tsconfig.json @@ -1,32 +1,14 @@ { + "extends": "@kevisual/types/json/backend.json", "compilerOptions": { - "module": "nodenext", - "target": "esnext", - "noImplicitAny": false, - "outDir": "./dist", - "sourceMap": false, - "newLine": "LF", - "baseUrl": "./", - "typeRoots": [ - "node_modules/@types", - ], - "declaration": true, - "noEmit": false, - "allowImportingTsExtensions": true, - "emitDeclarationOnly": true, - "moduleResolution": "NodeNext", - "experimentalDecorators": true, - "emitDecoratorMetadata": true, - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, + "baseUrl": ".", "paths": { "@/*": [ "src/*" - ], - } + ] + }, }, "include": [ - "src/**/*.ts", + "src/**/*", ], - "exclude": [], } \ No newline at end of file diff --git a/bin/assistant-server.js b/bin/assistant-server.js old mode 100755 new mode 100644 diff --git a/bin/assistant.js b/bin/assistant.js old mode 100755 new mode 100644 diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4d5eafd..08b98bf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -93,7 +93,7 @@ importers: version: 0.0.6 '@kevisual/local-app-manager': specifier: ^0.1.16 - version: 0.1.16(@kevisual/router@0.0.13)(@kevisual/types@0.0.1)(@kevisual/use-config@1.0.11(dotenv@16.5.0))(pm2@6.0.5(supports-color@10.0.0)) + version: 0.1.16(@kevisual/router@0.0.13)(@kevisual/types@0.0.7)(@kevisual/use-config@1.0.11(dotenv@16.5.0))(pm2@6.0.5(supports-color@10.0.0)) '@kevisual/query': specifier: 0.0.17 version: 0.0.17(@kevisual/ws@8.0.0)(encoding@0.1.13) @@ -103,6 +103,12 @@ importers: '@kevisual/router': specifier: ^0.0.13 version: 0.0.13 + '@kevisual/task-command': + specifier: ^0.0.2 + version: 0.0.2 + '@kevisual/types': + specifier: ^0.0.7 + version: 0.0.7 '@kevisual/use-config': specifier: ^1.0.11 version: 1.0.11(dotenv@16.5.0) @@ -548,8 +554,11 @@ packages: '@kevisual/router@0.0.13': resolution: {integrity: sha512-raji8aKXr0jigmJVOKBXb5gpstiAuyoIDy9m6SyPf4lRjCU3pspVI1bpscOUCBlaPICo6TLzPQxXhyTvvvtdWw==} - '@kevisual/types@0.0.1': - resolution: {integrity: sha512-3Wn6WjpfbOGTqIVS7YQ/0CIQEEbZEp+uCTbIWqTZyuytiA/Xoglr5kG3AbTuLFQ81AvfxjEjp5dAnFub+2IhhQ==} + '@kevisual/task-command@0.0.2': + resolution: {integrity: sha512-GVGcm2edTdIkiRaO8PoR8MhkHEyqq2xG3knMI6Ba+0YknzRECAzR0tgkHLGRPyIClG0J6gDzo2qaglf2s3ci5w==} + + '@kevisual/types@0.0.7': + resolution: {integrity: sha512-qU/vg7WilTmxbWQZ4PbYNaTDQO83KaCqoT10FbGg8FCwGG2luuEKTvCYcXfvpl7qA+AHGKcSm0JJc61s4oLCww==} '@kevisual/use-config@1.0.11': resolution: {integrity: sha512-ccilQTRZTpO075L67ZBXhr8Lp3i73/W5cCMT5enMjVrnJT5K0i5JH5IbzBhF6WY5Rj8dmVsAyyjJe24ClyM7Eg==} @@ -2614,10 +2623,10 @@ snapshots: dependencies: eventemitter3: 5.0.1 - '@kevisual/local-app-manager@0.1.16(@kevisual/router@0.0.13)(@kevisual/types@0.0.1)(@kevisual/use-config@1.0.11(dotenv@16.5.0))(pm2@6.0.5(supports-color@10.0.0))': + '@kevisual/local-app-manager@0.1.16(@kevisual/router@0.0.13)(@kevisual/types@0.0.7)(@kevisual/use-config@1.0.11(dotenv@16.5.0))(pm2@6.0.5(supports-color@10.0.0))': dependencies: '@kevisual/router': 0.0.13 - '@kevisual/types': 0.0.1 + '@kevisual/types': 0.0.7 '@kevisual/use-config': 1.0.11(dotenv@16.5.0) pm2: 6.0.5(supports-color@10.0.0) @@ -2662,7 +2671,9 @@ snapshots: path-to-regexp: 8.2.0 selfsigned: 2.4.1 - '@kevisual/types@0.0.1': {} + '@kevisual/task-command@0.0.2': {} + + '@kevisual/types@0.0.7': {} '@kevisual/use-config@1.0.11(dotenv@16.5.0)': dependencies: diff --git a/src/program.ts b/src/program.ts index 2a5c57c..c2fb758 100644 --- a/src/program.ts +++ b/src/program.ts @@ -7,7 +7,7 @@ try { if (ENVISION_VERSION) version = ENVISION_VERSION; } catch (e) {} // @ts-ignore -program.name('app').description('A CLI tool with envison').version(version); +program.name('app').description('A CLI tool with envison').version(version, '-v, --version'); const ls = new Command('ls').description('List files in the current directory').action(() => { console.log('List files');