feat(install): add interactive install command and module to detect and install missing @git.zone packages

This commit is contained in:
2026-02-09 17:15:54 +00:00
parent b2c926e9ae
commit 0fe92d1438
6 changed files with 196 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
import * as plugins from './tools.plugins.js';
import * as modUpdate from './mod_update/index.js';
import * as modInstall from './mod_install/index.js';
import { commitinfo } from './00_commitinfo_data.js';
export const run = async () => {
@@ -8,9 +9,12 @@ export const run = async () => {
toolsCli.standardCommand().subscribe(async (argvArg) => {
console.log('@git.zone/tools - CLI utility for managing @git.zone packages\n');
console.log('Commands:');
console.log(' update Check and update globally installed @git.zone packages');
console.log(' update -y Update without confirmation prompt');
console.log(' update --verbose Show detection diagnostics');
console.log(' update Check and update globally installed @git.zone packages');
console.log(' update -y Update without confirmation prompt');
console.log(' update --verbose Show detection diagnostics');
console.log(' install Interactively install missing @git.zone packages');
console.log(' install -y Install all missing packages without prompts');
console.log(' install --verbose Show detection diagnostics');
console.log('');
console.log('Use "gtools <command> --help" for more information about a command.');
});
@@ -21,6 +25,12 @@ export const run = async () => {
await modUpdate.run({ yes: yesFlag, verbose: verboseFlag });
});
toolsCli.addCommand('install').subscribe(async (argvArg) => {
const yesFlag = argvArg.y === true || argvArg.yes === true;
const verboseFlag = argvArg.v === true || argvArg.verbose === true;
await modInstall.run({ yes: yesFlag, verbose: verboseFlag });
});
toolsCli.addVersion(commitinfo.version);
toolsCli.startParse();
};