feat: improve doctor update flow

This commit is contained in:
Peter Steinberger
2026-01-21 05:23:22 +00:00
parent 810374d648
commit 6180603ef4
4 changed files with 49 additions and 15 deletions

View File

@@ -454,6 +454,10 @@ export function registerPluginsCli(program: Command) {
const targets = opts.all ? Object.keys(installs) : id ? [id] : [];
if (targets.length === 0) {
if (opts.all) {
defaultRuntime.log("No npm-installed plugins to update.");
return;
}
defaultRuntime.error("Provide a plugin id or use --all.");
process.exit(1);
}

View File

@@ -623,7 +623,8 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
process.env.CLAWDBOT_UPDATE_IN_PROGRESS = "1";
try {
const { doctorCommand } = await import("../commands/doctor.js");
await doctorCommand(defaultRuntime, { nonInteractive: true });
const interactiveDoctor = Boolean(process.stdin.isTTY) && !opts.json && opts.yes !== true;
await doctorCommand(defaultRuntime, { nonInteractive: !interactiveDoctor });
} catch (err) {
defaultRuntime.log(theme.warn(`Doctor failed: ${String(err)}`));
} finally {