feat(cli/daemon/processmonitor): Add flexible target resolution and search command; improve restart/backoff and error handling
This commit is contained in:
@@ -9,17 +9,16 @@ export function registerEditCommand(smartcli: plugins.smartcli.Smartcli) {
|
||||
smartcli,
|
||||
'edit',
|
||||
async (argvArg: CliArguments) => {
|
||||
const idRaw = argvArg._[1];
|
||||
if (!idRaw) {
|
||||
console.error('Error: Please provide a process ID to edit');
|
||||
console.log('Usage: tspm edit <id>');
|
||||
const target = argvArg._[1];
|
||||
if (!target) {
|
||||
console.error('Error: Please provide a process target to edit');
|
||||
console.log('Usage: tspm edit <id | id:N | name:LABEL>');
|
||||
return;
|
||||
}
|
||||
|
||||
const id = idRaw;
|
||||
|
||||
// Load current config
|
||||
const { config } = await tspmIpcClient.request('describe', { id });
|
||||
// Resolve and load current config
|
||||
const resolved = await tspmIpcClient.request('resolveTarget', { target: String(target) });
|
||||
const { config } = await tspmIpcClient.request('describe', { id: resolved.id });
|
||||
|
||||
// Interactive editing is temporarily disabled - needs smartinteract API update
|
||||
console.log('Interactive editing is temporarily disabled.');
|
||||
@@ -63,7 +62,7 @@ export function registerEditCommand(smartcli: plugins.smartcli.Smartcli) {
|
||||
};
|
||||
|
||||
const updateResponse = await tspmIpcClient.request('update', {
|
||||
id,
|
||||
id: resolved.id,
|
||||
updates,
|
||||
});
|
||||
|
||||
@@ -73,4 +72,3 @@ export function registerEditCommand(smartcli: plugins.smartcli.Smartcli) {
|
||||
{ actionLabel: 'edit process config' },
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user