fix(cli): improve project metadata loading and normalize CLI error handling

This commit is contained in:
2026-05-09 12:34:58 +00:00
parent c7c1bbb460
commit adb13b027d
13 changed files with 3328 additions and 5222 deletions
+4 -4
View File
@@ -1,7 +1,7 @@
import * as plugins from '../../plugins.js';
import * as paths from '../../../paths.js';
import { tspmIpcClient } from '../../../client/tspm.ipcclient.js';
import { Logger } from '../../../shared/common/utils.errorhandler.js';
import { handleError, Logger } from '../../../shared/common/utils.errorhandler.js';
import type { CliArguments } from '../../types.js';
import { formatMemory } from '../../helpers/memory.js';
@@ -76,7 +76,7 @@ export function registerDaemonCommand(smartcli: plugins.smartcli.Smartcli) {
// Disconnect from the daemon after starting
await tspmIpcClient.disconnect();
} catch (error) {
console.error('Error starting daemon:', error.message);
console.error('Error starting daemon:', handleError(error).message);
process.exit(1);
}
break;
@@ -139,7 +139,7 @@ export function registerDaemonCommand(smartcli: plugins.smartcli.Smartcli) {
// Disconnect from the daemon after stopping
await tspmIpcClient.disconnect();
} catch (error) {
console.error('Error stopping daemon:', error.message);
console.error('Error stopping daemon:', handleError(error).message);
process.exit(1);
}
break;
@@ -169,7 +169,7 @@ export function registerDaemonCommand(smartcli: plugins.smartcli.Smartcli) {
// Disconnect from daemon after getting status
await tspmIpcClient.disconnect();
} catch (error) {
console.error('Error getting daemon status:', error.message);
console.error('Error getting daemon status:', handleError(error).message);
process.exit(1);
}
break;