feat: add dry-run server cleanup plan

This commit is contained in:
Codex
2026-05-21 14:20:54 +00:00
parent a6144ae710
commit 9a4624a6b1
8 changed files with 1021 additions and 1 deletions
+8
View File
@@ -22,6 +22,7 @@ import { runAuthBrokerCommand } from "./src/auth-broker";
import { runGhCommand } from "./src/gh";
import { runCommanderCommand } from "./src/commander";
import { isHelpToken, rootHelp, serverHelp, sshHelp, staticNamespaceHelp } from "./src/help";
import { runServerCleanupCommand } from "./src/server-cleanup";
const remoteOptions = extractRemoteCliOptions(process.argv.slice(2));
const args = remoteOptions.args;
@@ -269,6 +270,13 @@ async function main(): Promise<void> {
emitJson(commandName, stackLogs(config, boundedNumberOption("--tail-bytes", 3000, 500_000)));
return;
}
if (sub === "cleanup") {
const result = await runServerCleanupCommand(config, args.slice(2));
const ok = (result as { ok?: unknown }).ok !== false;
emitJson(commandName, result, ok);
if (!ok) process.exitCode = 1;
return;
}
if (sub === "rebuild") {
if (!isRebuildableService(third)) {
const result = unsupportedRebuildService(third);