From 33609bff9a60cb610dfafe4258289e0841e7385c Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Tue, 28 Oct 2025 12:36:50 +0000 Subject: [PATCH] fix(cli): Correct scripts subcommand argument parsing and bump smartcli dependency --- changelog.md | 6 ++++++ deno.json | 2 +- ts/00_commitinfo_data.ts | 2 +- ts/moxytool.cli.ts | 8 ++++---- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/changelog.md b/changelog.md index 5ab0b5a..505683a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2025-10-28 - 1.3.2 - fix(cli) +Correct scripts subcommand argument parsing and bump smartcli dependency + +- Fix scripts command argument indices so the subcommand is read from argvArg._[1] and subsequent arguments from argvArg._[2]. This resolves incorrect handling of 'scripts search', 'scripts info' and 'scripts run' inputs. +- Upgrade @push.rocks/smartcli dependency from ^4.0.11 to ^4.0.14 in deno.json for compatibility/stability improvements. + ## 2025-10-27 - 1.3.1 - fix(publish) Switch publish registry to internal Verdaccio instance and add local CI settings diff --git a/deno.json b/deno.json index 32f4e74..3512b99 100644 --- a/deno.json +++ b/deno.json @@ -40,7 +40,7 @@ "@push.rocks/npmextra": "npm:@push.rocks/npmextra@^5.1.2", "@push.rocks/projectinfo": "npm:@push.rocks/projectinfo@^5.0.1", "@push.rocks/qenv": "npm:@push.rocks/qenv@^6.1.0", - "@push.rocks/smartcli": "npm:@push.rocks/smartcli@^4.0.11", + "@push.rocks/smartcli": "npm:@push.rocks/smartcli@^4.0.14", "@push.rocks/smartdelay": "npm:@push.rocks/smartdelay@^3.0.5", "@push.rocks/smartfile": "npm:@push.rocks/smartfile@^11.0.23", "@push.rocks/smartjson": "npm:@push.rocks/smartjson@^5.0.20", diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index ca13a51..bdf850c 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@serve.zone/moxytool', - version: '1.3.1', + version: '1.3.2', description: 'Proxmox administration tool for vGPU setup, VM management, and cluster configuration' } diff --git a/ts/moxytool.cli.ts b/ts/moxytool.cli.ts index 48d8190..a7abd97 100644 --- a/ts/moxytool.cli.ts +++ b/ts/moxytool.cli.ts @@ -204,7 +204,7 @@ export const runCli = async () => { // Scripts management commands smartcliInstance.addCommand('scripts').subscribe(async (argvArg) => { - const subcommand = argvArg._[0]; + const subcommand = argvArg._[1]; // _[0] is 'scripts', _[1] is the subcommand if (!subcommand) { logger.log('info', 'MOXYTOOL Scripts - Proxmox Community Scripts Management'); @@ -262,7 +262,7 @@ export const runCli = async () => { } case 'search': { - const query = argvArg._[1]; + const query = argvArg._[2]; // _[0]=scripts, _[1]=search, _[2]=query if (!query) { logger.log('error', 'Please provide a search query'); @@ -292,7 +292,7 @@ export const runCli = async () => { } case 'info': { - const slug = argvArg._[1]; + const slug = argvArg._[2]; // _[0]=scripts, _[1]=info, _[2]=slug if (!slug) { logger.log('error', 'Please provide a script slug'); @@ -368,7 +368,7 @@ export const runCli = async () => { } case 'run': { - const slug = argvArg._[1]; + const slug = argvArg._[2]; // _[0]=scripts, _[1]=run, _[2]=slug if (!slug) { logger.log('error', 'Please provide a script slug');