feat(cli/daemon/processmonitor): Add flexible target resolution and search command; improve restart/backoff and error handling
This commit is contained in:
@@ -9,16 +9,17 @@ export function registerDescribeCommand(smartcli: plugins.smartcli.Smartcli) {
|
||||
smartcli,
|
||||
'describe',
|
||||
async (argvArg: CliArguments) => {
|
||||
const id = argvArg._[1];
|
||||
if (!id) {
|
||||
console.error('Error: Please provide a process ID');
|
||||
console.log('Usage: tspm describe <id>');
|
||||
const target = argvArg._[1];
|
||||
if (!target) {
|
||||
console.error('Error: Please provide a process target');
|
||||
console.log('Usage: tspm describe <id | id:N | name:LABEL>');
|
||||
return;
|
||||
}
|
||||
|
||||
const response = await tspmIpcClient.request('describe', { id });
|
||||
const resolved = await tspmIpcClient.request('resolveTarget', { target: String(target) });
|
||||
const response = await tspmIpcClient.request('describe', { id: resolved.id });
|
||||
|
||||
console.log(`Process Details: ${id}`);
|
||||
console.log(`Process Details: ${response.config.name || resolved.id}`);
|
||||
console.log('─'.repeat(40));
|
||||
console.log(`Status: ${response.processInfo.status}`);
|
||||
console.log(`PID: ${response.processInfo.pid || 'N/A'}`);
|
||||
|
Reference in New Issue
Block a user