feat(cli): Add CLI support with command parsing and version display

This commit is contained in:
2025-03-01 19:19:28 +00:00
parent 761f9ca1b6
commit c4a082031e
7 changed files with 56 additions and 2 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@git.zone/tspm',
version: '1.2.0',
version: '1.3.0',
description: 'a no fuzz process manager'
}

21
ts/cli.ts Normal file
View File

@ -0,0 +1,21 @@
import * as plugins from './plugins.js';
import * as paths from './paths.js';
export const run = async () => {
const tspmProjectinfo = new plugins.projectinfo.ProjectInfo(paths.packageDir);
const smartcliInstance = new plugins.smartcli.Smartcli();
smartcliInstance.addVersion(tspmProjectinfo.npm.version);
smartcliInstance.standardCommand().subscribe({
next: (argvArg) => {
console.log(`Please specify a command.`)
},
});
smartcliInstance.addCommand('restart').subscribe({
})
smartcliInstance.startParse();
}

View File

@ -1,2 +1,11 @@
export * from './classes.tspm.js';
export * from './classes.processmonitor.js';
import * as cli from './cli.js';
/**
* called to run as cli
*/
export const runCli = async () => {
await cli.run();
}

View File

@ -8,10 +8,12 @@ export {
}
// @push.rocks scope
import * as projectinfo from '@push.rocks/projectinfo';
import * as smartpath from '@push.rocks/smartpath';
import * as smartcli from '@push.rocks/smartcli';
export {
projectinfo,
smartpath,
smartcli,
}