Compare commits

...

2 Commits

Author SHA1 Message Date
7bfda01768 4.1.0
Some checks failed
Default (tags) / security (push) Successful in 51s
Default (tags) / test (push) Failing after 3m57s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-08-29 12:16:43 +00:00
27384d03c7 feat(cli): Add support for restarting all processes from CLI; improve usage message and reporting 2025-08-29 12:16:43 +00:00
4 changed files with 31 additions and 6 deletions

View File

@@ -1,5 +1,12 @@
# Changelog # Changelog
## 2025-08-29 - 4.1.0 - feat(cli)
Add support for restarting all processes from CLI; improve usage message and reporting
- CLI 'restart' command now accepts 'all' to restart all processes via the daemon (tspm restart all).
- Improved usage/help output when no process id is provided.
- CLI now prints summaries of restarted process IDs and failed restarts and sets a non-zero exit code when any restarts failed.
## 2025-08-29 - 4.0.0 - BREAKING CHANGE(cli) ## 2025-08-29 - 4.0.0 - BREAKING CHANGE(cli)
Add persistent process registration (tspm add), alias remove, and change start to use saved process IDs (breaking CLI behavior) Add persistent process registration (tspm add), alias remove, and change start to use saved process IDs (breaking CLI behavior)

View File

@@ -1,6 +1,6 @@
{ {
"name": "@git.zone/tspm", "name": "@git.zone/tspm",
"version": "4.0.0", "version": "4.1.0",
"private": false, "private": false,
"description": "a no fuzz process manager", "description": "a no fuzz process manager",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",

View File

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

View File

@@ -8,13 +8,31 @@ export function registerRestartCommand(smartcli: plugins.smartcli.Smartcli) {
smartcli, smartcli,
'restart', 'restart',
async (argvArg: CliArguments) => { async (argvArg: CliArguments) => {
const id = argvArg._[1]; const arg = argvArg._[1];
if (!id) { if (!arg) {
console.error('Error: Please provide a process ID'); console.error('Error: Please provide a process ID or "all"');
console.log('Usage: tspm restart <id>'); console.log('Usage:');
console.log(' tspm restart <id>');
console.log(' tspm restart all');
return; return;
} }
if (String(arg).toLowerCase() === 'all') {
console.log('Restarting all processes...');
const res = await tspmIpcClient.request('restartAll', {});
if (res.restarted.length > 0) {
console.log(`✓ Restarted ${res.restarted.length} processes:`);
for (const id of res.restarted) console.log(` - ${id}`);
}
if (res.failed.length > 0) {
console.log(`✗ Failed to restart ${res.failed.length} processes:`);
for (const f of res.failed) console.log(` - ${f.id}: ${f.error}`);
process.exitCode = 1;
}
return;
}
const id = String(arg);
console.log(`Restarting process: ${id}`); console.log(`Restarting process: ${id}`);
const response = await tspmIpcClient.request('restart', { id }); const response = await tspmIpcClient.request('restart', { id });