fix(state): auto-migrate legacy agent dir

This commit is contained in:
Peter Steinberger
2026-01-06 22:04:23 +00:00
parent 7aa7fa79d0
commit 2771001720
6 changed files with 570 additions and 457 deletions

View File

@@ -19,6 +19,7 @@ import {
writeConfigFile,
} from "../config/config.js";
import { danger, setVerbose } from "../globals.js";
import { autoMigrateLegacyAgentDir } from "../infra/state-migrations.js";
import { loginWeb, logoutWeb } from "../provider-web.js";
import { defaultRuntime } from "../runtime.js";
import { VERSION } from "../version.js";
@@ -127,6 +128,11 @@ export function buildProgram() {
);
process.exit(1);
});
program.hook("preAction", async (_thisCommand, actionCommand) => {
if (actionCommand.name() === "doctor") return;
const cfg = loadConfig();
await autoMigrateLegacyAgentDir({ cfg });
});
const examples = [
[
"clawdbot login --verbose",